viewing paste Unknown #5718 | Diff

Posted on the | Last edited on
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496
Index: db/packet_db.txt
===================================================================
--- db/packet_db.txt    (revision 17292)
+++ db/packet_db.txt    (working copy)
@@ -1832,6 +1832,8 @@
 0x094E,-1,searchstoreinfo,2:4:5:9:13:14:15
 //0x0835,2,searchstoreinfonextpage,0
 //0x0838,12,searchstoreinfolistitemclick,2:6:10
+0x0447,2
+0x99b,8
 
 // New cashshop
 0x0844,2,cashshopopen,0
Index: src/common/mmo.h
===================================================================
--- src/common/mmo.h    (revision 17292)
+++ src/common/mmo.h    (working copy)
@@ -47,7 +47,7 @@
 // 20120307 - 2012-03-07aRagexeRE+ - 0x970
 
 #ifndef PACKETVER
-   #define PACKETVER 20120410
+   #define PACKETVER 20130320
    //#define PACKETVER 20111116
 #endif
 
Index: src/login/Makefile.in
===================================================================
--- src/login/Makefile.in   (revision 17292)
+++ src/login/Makefile.in   (working copy)
@@ -36,7 +36,7 @@
 
 clean:
    @echo " CLEAN   login"
-   @rm -rf *.o obj_sql ../../login-server@EXEEXT@ ../../login-server_sql@EXEEXT@
+   @rm -rf *.o obj_sql ../../login-server_sql@EXEEXT@
 
 help:
    @echo "possible targets are 'sql' 'all' 'clean' 'help'"
Index: src/map/clif.c
===================================================================
--- src/map/clif.c  (revision 17292)
+++ src/map/clif.c  (working copy)
@@ -66,14 +66,12 @@
 struct s_packet_db packet_db[MAX_PACKET_VER + 1][MAX_PACKET_DB + 1];
 
 //Converts item type in case of pet eggs.
-static inline int itemtype(int type)
-{
+static inline int itemtype(int type) {
    return ( type == IT_PETEGG ) ? IT_WEAPON : type;
 }
 
 
-static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsigned char dir)
-{
+static inline void WBUFPOS(uint8* p, unsigned short pos, short x, short y, unsigned char dir) {
    p += pos;
    p[0] = (uint8)(x>>2);
    p[1] = (uint8)((x<<6) | ((y>>4)&0x3f));
@@ -82,8 +80,7 @@
 
 
 // client-side: x0+=sx0*0.0625-0.5 and y0+=sy0*0.0625-0.5
-static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0)
-{
+static inline void WBUFPOS2(uint8* p, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) {
    p += pos;
    p[0] = (uint8)(x0>>2);
    p[1] = (uint8)((x0<<6) | ((y0>>4)&0x3f));
@@ -94,20 +91,17 @@
 }
 
 
-static inline void WFIFOPOS(int fd, unsigned short pos, short x, short y, unsigned char dir)
-{
+static inline void WFIFOPOS(int fd, unsigned short pos, short x, short y, unsigned char dir) {
    WBUFPOS(WFIFOP(fd,pos), 0, x, y, dir);
 }
 
 
-static inline void WFIFOPOS2(int fd, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0)
-{
+static inline void WFIFOPOS2(int fd, unsigned short pos, short x0, short y0, short x1, short y1, unsigned char sx0, unsigned char sy0) {
    WBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0);
 }
 
 
-static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* y, unsigned char* dir)
-{
+static inline void RBUFPOS(const uint8* p, unsigned short pos, short* x, short* y, unsigned char* dir) {
    p += pos;
 
    if( x ) {
@@ -124,8 +118,7 @@
 }
 
 
-static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0)
-{
+static inline void RBUFPOS2(const uint8* p, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) {
    p += pos;
 
    if( x0 ) {
@@ -154,28 +147,24 @@
 }
 
 
-static inline void RFIFOPOS(int fd, unsigned short pos, short* x, short* y, unsigned char* dir)
-{
+static inline void RFIFOPOS(int fd, unsigned short pos, short* x, short* y, unsigned char* dir) {
    RBUFPOS(RFIFOP(fd,pos), 0, x, y, dir);
 }
 
 
-static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0)
-{
+static inline void RFIFOPOS2(int fd, unsigned short pos, short* x0, short* y0, short* x1, short* y1, unsigned char* sx0, unsigned char* sy0) {
    RBUFPOS2(WFIFOP(fd,pos), 0, x0, y0, x1, y1, sx0, sy0);
 }
 
 
 //To idenfity disguised characters.
-static inline bool disguised(struct block_list* bl)
-{
+static inline bool disguised(struct block_list* bl) {
    return (bool)( bl->type == BL_PC && ((TBL_PC*)bl)->disguise );
 }
 
 
 //Guarantees that the given string does not exceeds the allowed size, as well as making sure it's null terminated. [Skotlex]
-static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned int max)
-{
+static inline unsigned int mes_len_check(char* mes, unsigned int len, unsigned int max) {
    if( len > max )
        len = max;
 
@@ -196,8 +185,7 @@
 /*==========================================
  * Ip setting of map-server
  *------------------------------------------*/
-int clif_setip(const char* ip)
-{
+int clif_setip(const char* ip) {
    char ip_str[16];
    map_ip = host2ip(ip);
    if (!map_ip) {
@@ -307,8 +295,7 @@
    nullpo_ret(src_bl = va_arg(ap,struct block_list*));
    type = va_arg(ap,int);
 
-   switch(type)
-   {
+   switch(type) {
    case AREA_WOS:
        if (bl == src_bl)
            return 0;
@@ -317,8 +304,7 @@
        if (sd->chatID || bl == src_bl)
            return 0;
    break;
-   case AREA_WOSC:
-   {
+       case AREA_WOSC: {
        if(src_bl->type == BL_PC){
            struct map_session_data *ssd = (struct map_session_data *)src_bl;
            if (ssd && sd->chatID && (sd->chatID == ssd->chatID))
@@ -542,8 +528,7 @@
 
        if (g) {
            for(i = 0; i < g->max_member; i++) {
-               if( (sd = g->member[i].sd) != NULL )
-               {
+                   if( (sd = g->member[i].sd) != NULL ) {
                    if( !(fd=sd->fd) )
                        continue;
 
@@ -594,10 +579,8 @@
    case BG_SAMEMAP_WOS:
    case BG:
    case BG_WOS:
-       if( sd && sd->bg_id && (bg = bg_team_search(sd->bg_id)) != NULL )
-       {
-           for( i = 0; i < MAX_BG_MEMBERS; i++ )
-           {
+           if( sd && sd->bg_id && (bg = bg_team_search(sd->bg_id)) != NULL ) {
+               for( i = 0; i < MAX_BG_MEMBERS; i++ ) {
                if( (sd = bg->members[i].sd) == NULL || !(fd = sd->fd) )
                    continue;
                if( sd->bl.id == bl->id && (type == BG_WOS || type == BG_SAMEMAP_WOS || type == BG_AREA_WOS) )
@@ -880,8 +863,7 @@
 }
 
 //To make the assignation of the level based on limits clearer/easier. [Skotlex]
-static int clif_setlevel_sub(int lv)
-{
+static int clif_setlevel_sub(int lv) {
    if( lv < battle_config.max_lv ) {
        ;
    } else if( lv < battle_config.aura_lv ) {
@@ -893,8 +875,7 @@
    return lv;
 }
 
-static int clif_setlevel(struct block_list* bl)
-{
+static int clif_setlevel(struct block_list* bl) {
    int lv = status_get_lv(bl);
    if( battle_config.client_limit_unit_lv&bl->type )
        return clif_setlevel_sub(lv);
@@ -1647,13 +1628,12 @@
 /*==========================================
  *
  *------------------------------------------*/
-void clif_quitsave(int fd,struct map_session_data *sd)
-{
+void clif_quitsave(int fd,struct map_session_data *sd) {
    if (!battle_config.prevent_logout ||
        DIFF_TICK(gettick(), sd->canlog_tick) > battle_config.prevent_logout)
        map_quit(sd);
-   else if (sd->fd)
-   {   //Disassociate session from player (session is deleted after this function was called)
+   else if (sd->fd) {
+       //Disassociate session from player (session is deleted after this function was called)
        //And set a timer to make him quit later.
        session[sd->fd]->session_data = NULL;
        sd->fd = 0;
@@ -5570,7 +5550,33 @@
    WFIFOSET(fd,packet_len(0x199));
 }
 
+void clif_maptypeproperty2(struct block_list *bl,enum send_target t) {
+#if PACKETVER >= 20130000 /* not entirely sure when this started */
+   uint8 buf[8];
 
+   WBUFW(buf,0)=0x99b; //2
+   WBUFW(buf,2)=0x28; //2
+
+   WBUFB(buf,4) = RBUFB(buf,4)|0x01; //party
+   WBUFB(buf,4) = RBUFB(buf,4)|0x02; //guild
+   WBUFB(buf,4) = RBUFB(buf,4)|((map_flag_gvg2(bl->m))?0x04:0); //siege
+   WBUFB(buf,4) = RBUFB(buf,4)|0x08; //mineffect
+   WBUFB(buf,4) = RBUFB(buf,4)|0x10; //nolockon
+   WBUFB(buf,4) = RBUFB(buf,4)|((map[bl->m].flag.pvp)?0x20:0); //countpk
+   WBUFB(buf,4) = RBUFB(buf,4)|0; //nopartyformation
+   WBUFB(buf,4) = RBUFB(buf,4)|((map[bl->m].flag.battleground)?0x80:0); //battleground
+
+   WBUFB(buf,5) = RBUFB(buf,5)|0x01; //noitemconsumption
+   WBUFB(buf,5) = RBUFB(buf,5)|0x02; //cart
+   WBUFB(buf,5) = RBUFB(buf,5)|0x04; //summonstarmiracle
+// WBUFB(buf,5) = RBUFB(buf,5)&0xf8;  //sparebit[0-4]
+
+   WBUFW(buf,6) = 0; //sparebit [5-15], + extra[4]
+
+   clif_send(buf,packet_len(0x99b),bl,t);
+#endif
+}
+
 /// Set the map type (ZC_NOTIFY_MAPPROPERTY2).
 /// 01d6 <type>.W
 void clif_map_type(struct map_session_data* sd, enum map_type type)
@@ -8248,6 +8254,7 @@
 
    mail_clear(sd);
 
+
    if( disguised(&sd->bl) ) {/* refresh-da */
        short disguise = sd->disguise;
        pc_disguise(sd, 0);
@@ -9312,6 +9319,8 @@
 
    mail_clear(sd);
 
+   clif_maptypeproperty2(&sd->bl,SELF);
+
    /* Guild Aura Init */
    if( sd->state.gmaster_flag ) {
        guild_guildaura_refresh(sd,GD_LEADERSHIP,guild_checkskill(sd->state.gmaster_flag,GD_LEADERSHIP));
@@ -16704,8 +16713,8 @@
        0,  0,  0,  0,  0,  0,  0, 14,  0,  0,  0,  0,  0,  0,  0,  0,
    //#0x0980
        0,  0,  0, 29,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
+       0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  8,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-       0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
        0,  0,  0,  0,  0,  0,  0, 14,  0,  0,  0,  0,  0,  0,  0,  0,
 
    };
Index: src/map/clif.h
===================================================================
--- src/map/clif.h  (revision 17292)
+++ src/map/clif.h  (working copy)
@@ -585,6 +585,7 @@
 void clif_heal(int fd,int type,int val);
 void clif_resurrection(struct block_list *bl,int type);
 void clif_map_property(struct map_session_data* sd, enum map_property property);
+void clif_maptypeproperty2(struct block_list *bl,enum send_target t);
 void clif_pvpset(struct map_session_data *sd, int pvprank, int pvpnum,int type);
 void clif_map_property_mapall(int map, enum map_property property);
 void clif_refine(int fd, int fail, int index, int val);
Index: src/map/script.c
===================================================================
--- src/map/script.c    (revision 17292)
+++ src/map/script.c    (working copy)
@@ -10854,6 +10854,7 @@
        sd->pvp_lost = 0;
    }
    clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
+   clif_maptypeproperty2(&sd->bl,SELF);
    return 0;
 }
 BUILDIN_FUNC(setmapflag)
@@ -10884,9 +10885,14 @@
                break;
            case MF_PVP_NOPARTY:        map[m].flag.pvp_noparty = 1; break;
            case MF_PVP_NOGUILD:        map[m].flag.pvp_noguild = 1; break;
-           case MF_GVG:
+           case MF_GVG: {
+               struct block_list bl;
                map[m].flag.gvg = 1;
                clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
+               bl.type = BL_NUL;
+               bl.m = m;
+               clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+               }
                break;
            case MF_GVG_NOPARTY:        map[m].flag.gvg_noparty = 1; break;
            case MF_NOTRADE:            map[m].flag.notrade = 1; break;
@@ -10958,15 +10964,25 @@
            case MF_NOBRANCH:           map[m].flag.nobranch = 0; break;
            case MF_NOPENALTY:          map[m].flag.noexppenalty = 0; map[m].flag.nozenypenalty = 0; break;
            case MF_NOZENYPENALTY:      map[m].flag.nozenypenalty = 0; break;
-           case MF_PVP:
+           case MF_PVP: {
+               struct block_list bl;
+               bl.type = BL_NUL;
+               bl.m = m;
                map[m].flag.pvp = 0;
                clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+               clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+               }
                break;
            case MF_PVP_NOPARTY:        map[m].flag.pvp_noparty = 0; break;
            case MF_PVP_NOGUILD:        map[m].flag.pvp_noguild = 0; break;
-           case MF_GVG:
+           case MF_GVG: {
+               struct block_list bl;
+               bl.type = BL_NUL;
+               bl.m = m;
                map[m].flag.gvg = 0;
                clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+               clif_maptypeproperty2(&bl,ALL_SAMEMAP);
+               }
                break;
            case MF_GVG_NOPARTY:        map[m].flag.gvg_noparty = 0; break;
            case MF_NOTRADE:            map[m].flag.notrade = 0; break;
@@ -11026,6 +11042,7 @@
    const char *str;
    TBL_PC* sd = NULL;
    struct s_mapiterator* iter;
+   struct block_list bl;
 
    str = script_getstr(st,2);
    m = map_mapname2mapid(str);
@@ -11034,6 +11051,9 @@
 
    map[m].flag.pvp = 1;
    clif_map_property_mapall(m, MAPPROPERTY_FREEPVPZONE);
+   bl.type = BL_NUL;
+   bl.m = m;
+   clif_maptypeproperty2(&bl,ALL_SAMEMAP);
 
    if(battle_config.pk_mode) // disable ranking functions if pk_mode is on [Valaris]
        return 0;
@@ -11071,6 +11091,7 @@
 {
    int16 m;
    const char *str;
+   struct block_list bl;
 
    str=script_getstr(st,2);
    m = map_mapname2mapid(str);
@@ -11079,6 +11100,9 @@
 
    map[m].flag.pvp = 0;
    clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+   bl.type = BL_NUL;
+   bl.m = m;
+   clif_maptypeproperty2(&bl,ALL_SAMEMAP);
 
    if(battle_config.pk_mode) // disable ranking options if pk_mode is on [Valaris]
        return 0;
@@ -11091,12 +11115,16 @@
 {
    int16 m;
    const char *str;
+   struct block_list bl;
 
    str=script_getstr(st,2);
    m = map_mapname2mapid(str);
    if(m >= 0 && !map[m].flag.gvg) {
        map[m].flag.gvg = 1;
        clif_map_property_mapall(m, MAPPROPERTY_AGITZONE);
+       bl.type = BL_NUL;
+       bl.m = m;
+       clif_maptypeproperty2(&bl,ALL_SAMEMAP);
    }
 
    return 0;
@@ -11109,8 +11137,12 @@
    str=script_getstr(st,2);
    m = map_mapname2mapid(str);
    if(m >= 0 && map[m].flag.gvg) {
+       struct block_list bl;
        map[m].flag.gvg = 0;
        clif_map_property_mapall(m, MAPPROPERTY_NOTHING);
+       bl.type = BL_NUL;
+       bl.m = m;
+       clif_maptypeproperty2(&bl,ALL_SAMEMAP);
    }
 
    return 0;
Index: src/map/battle.c
===================================================================
--- src/map/battle.c    (revision 17292)
+++ src/map/battle.c    (working copy)
@@ -3630,8 +3630,8 @@
    short s_ele = 0;
    unsigned int skillratio = 100;  //Skill dmg modifiers.
 
-    TBL_PC *sd;
-//    TBL_PC *tsd;
+   TBL_PC *sd;
+// TBL_PC *tsd;
    struct status_change *sc, *tsc;
    struct Damage ad;
    struct status_data *sstatus = status_get_status_data(src);
@@ -3661,7 +3661,7 @@
    flag.imdef = nk&NK_IGNORE_DEF?1:0;
 
    sd = BL_CAST(BL_PC, src);
-//    tsd = BL_CAST(BL_PC, target);
+// tsd = BL_CAST(BL_PC, target);
    sc = status_get_sc(src);
    tsc = status_get_sc(target);
 
Index: src/map/duel.c
===================================================================
--- src/map/duel.c  (revision 17292)
+++ src/map/duel.c  (working copy)
@@ -95,6 +95,7 @@
    clif_disp_onlyself(sd, output, strlen(output));
 
    clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
+   clif_maptypeproperty2(&sd->bl,SELF);
    //clif_misceffect2(&sd->bl, 159);
    return i;
 }
@@ -141,6 +142,7 @@
    sd->duel_group = 0;
    duel_savetime(sd);
    clif_map_property(sd, MAPPROPERTY_NOTHING);
+   clif_maptypeproperty2(&sd->bl,SELF);
 }
 
 void duel_accept(const unsigned int did, struct map_session_data* sd)
@@ -157,6 +159,7 @@
    clif_disp_message(&sd->bl, output, strlen(output), DUEL_WOS);
 
    clif_map_property(sd, MAPPROPERTY_FREEPVPZONE);
+   clif_maptypeproperty2(&sd->bl,SELF);
    //clif_misceffect2(&sd->bl, 159);
 }
 
Index: src/config/const.h
===================================================================
--- src/config/const.h  (revision 17292)
+++ src/config/const.h  (working copy)
@@ -13,7 +13,7 @@
  */
 
 /**
- * "Sane Checks" to save you from compiling with cool bugs 
+ * "Sane Checks" to save you from compiling with cool bugs
  **/
 #if SECURE_NPCTIMEOUT_INTERVAL <= 0
    #error SECURE_NPCTIMEOUT_INTERVAL should be at least 1 (1s)
@@ -79,7 +79,7 @@
        if( status_get_lv(src) > 100 ) \
            md.damage = md.damage * 150 / 100 + md.damage * status_get_lv(src) / 100;
 #else
-   #define RE_LVL_DMOD(val) 
+   #define RE_LVL_DMOD(val)
    #define RE_LVL_MDMOD(val)
    #define RE_LVL_TMDMOD()
 #endif
Viewed 1233 times, submitted by lighta.