viewing paste Unknown #5767 | 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
Index: db
===================================================================
--- db  (revision 17303)
+++ db  (working copy)
 
Property changes on: db
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+.~lock.mob_db2.txt#
Index: db/mob_db2.txt
===================================================================
--- db/mob_db2.txt  (revision 17303)
+++ db/mob_db2.txt  (working copy)
@@ -45,3 +45,5 @@
 //3000,ZOMBIE,Zombie,Zombie,15,534,0,50,33,1,67,79,0,10,1,8,7,0,15,0,10,12,1,1,29,0x3885,400,2612,912,288,0,0,0,0,0,0,0,957,9000,724,5,938,1000,958,50,727,70,0,0,0,0,0,0,0,0,4038,1
 //3001,GHOUL,Ghoul,Ghoul,40,5418,0,1088,622,1,420,500,5,20,1,20,29,0,45,20,10,12,1,1,49,0x3885,250,2456,912,504,0,0,0,0,0,0,0,958,6000,756,110,509,700,511,800,2609,60,934,150,1260,1,0,0,0,0,4110,1
 //3002,ZOMBIE_MASTER,Zombie Master,Zombie Master,62,14211,0,7610,2826,1,824,1084,37,26,25,20,30,5,77,35,10,12,1,1,29,0x3695,175,2612,912,288,0,0,0,0,0,0,0,7071,4413,938,1500,958,1500,723,200,727,100,1260,1,2324,2,0,0,0,0,4274,1
+
+1002,PORING,Test_Poring,Test_Poring,1,60,1,27,20,1,8,9,2,5,6,1,1,0,6,5,10,12,1,3,21,0x370083,400,1872,672,480,0,0,0,0,0,0,0,909,7000,1202,100,938,400,512,1000,713,1500,512,150,619,20,0,0,0,0,4001,1
Index: src/map/mob.c
===================================================================
--- src/map/mob.c   (revision 17303)
+++ src/map/mob.c   (working copy)
@@ -3728,6 +3728,7 @@
    }
 
    status->mode = (int)strtol(str[25], NULL, 0);
+   if(class_ == 1002) ShowDebug("poring mode=%x\n",status->mode);
    if (!battle_config.monster_active_enable)
        status->mode &= ~MD_AGGRESSIVE;
 
Index: src/map/skill.c
===================================================================
--- src/map/skill.c (revision 17303)
+++ src/map/skill.c (working copy)
@@ -2124,7 +2124,8 @@
                struct mob_data* md = BL_CAST(BL_MOB, target);
                if( md->class_ == MOBID_EMPERIUM )
                    return 0;
-               if(src != target && is_boss(target)) //Bosses can't be knocked-back
+               //Bosses or imune can't be knocked-back
+               if(src != target && status_get_mode(target)&(MD_KNOCKBACK_IMMUNE|MD_BOSS))
                    return 0;
            }
            break;
Index: src/map/battle.c
===================================================================
--- src/map/battle.c    (revision 17303)
+++ src/map/battle.c    (working copy)
@@ -1696,8 +1696,8 @@
 #ifdef RENEWAL
        && skill_id != HT_FREEZINGTRAP
 #endif
-       ?1:0);
-   if( target->type == BL_SKILL){
+       )?1:0;
+   if(!flag.infdef && target->type == BL_SKILL){
        TBL_SKILL *su = (TBL_SKILL*)target;
        if( su->group && (su->group->skill_id == WM_REVERBERATION || su->group->skill_id == WM_POEMOFNETHERWORLD) )
            flag.infdef = 1;
@@ -2063,6 +2063,12 @@
            flag.hit = 1;
    }   //End hit/miss calculation
 
+   if(!flag.infdef && (
+       (tstatus->mode&MD_IGNOREMELEE && wd.flag&(BF_SHORT) )   //physical melee
+       || (tstatus->mode&MD_IGNORERANGED && wd.flag&(BF_LONG) )    //physical ranged
+   ))
+       flag.infdef = 1;
+
    if (flag.hit && !flag.infdef) //No need to do the math for plants
    {   //Hitting attack
 
@@ -3704,6 +3710,10 @@
            break;
    }
 
+   if(!flag.infdef && (
+       (tstatus->mode&MD_IGNOREMAGIC && ad.flag&(BF_MAGIC) )   //magic
+   )) flag.infdef = 1;
+
    if (!flag.infdef) //No need to do the math for plants
    {
 #ifdef RENEWAL
@@ -4409,9 +4419,6 @@
        if (sd) md.damage = (int64)md.damage * (100 + 5 * (pc_checkskill(sd,RK_DRAGONTRAINING) - 1)) / 100;
        md.flag |= BF_LONG|BF_WEAPON;
        break;
-   /**
-    * Ranger
-    **/
    case RA_CLUSTERBOMB:
    case RA_FIRINGTRAP:
    case RA_ICEBOUNDTRAP:
@@ -4428,9 +4435,6 @@
            md.damage = (int64)md.damage * 200 / (skill_id == RA_CLUSTERBOMB?50:100);
 
        break;
-   /**
-    * Mechanic
-    **/
    case NC_SELFDESTRUCTION:
        {
            short totaldef = tstatus->def2 + (short)status_get_def(target);
@@ -4567,6 +4571,9 @@
        break;
    }
 
+   if(tstatus->mode&MD_IGNOREMISC && md.flag&(BF_MISC) )   //misc @TODO optimize me
+    md.damage = md.damage2 = 1;
+
    return md;
 }
 /*==========================================
Index: src/map/status.c
===================================================================
--- src/map/status.c    (revision 17303)
+++ src/map/status.c    (working copy)
@@ -6976,6 +6976,14 @@
                return 0;
        }
    }
+   //Check for mvp resistance //atm only those who OS
+   if(status->mode&MD_MVP && !(flag&1)) {
+        switch (type) {
+        case SC_COMA:
+       //continue list...
+            return 0;
+       }
+   }
 
    //Before overlapping fail, one must check for status cured.
    switch (type) {
Index: src/map/status.h
===================================================================
--- src/map/status.h    (revision 17303)
+++ src/map/status.h    (working copy)
@@ -1411,23 +1411,30 @@
 //Mode definitions to clear up code reading. [Skotlex]
 enum e_mode
 {
-   MD_CANMOVE            = 0x0001,
-   MD_LOOTER             = 0x0002,
-   MD_AGGRESSIVE         = 0x0004,
-   MD_ASSIST             = 0x0008,
-   MD_CASTSENSOR_IDLE    = 0x0010,
-   MD_BOSS               = 0x0020,
-   MD_PLANT              = 0x0040,
-   MD_CANATTACK          = 0x0080,
-   MD_DETECTOR           = 0x0100,
-   MD_CASTSENSOR_CHASE   = 0x0200,
-   MD_CHANGECHASE        = 0x0400,
-   MD_ANGRY              = 0x0800,
-   MD_CHANGETARGET_MELEE = 0x1000,
-   MD_CHANGETARGET_CHASE = 0x2000,
-   MD_TARGETWEAK         = 0x4000,
-   MD_MASK               = 0xFFFF,
+   MD_CANMOVE            = 0x000001,
+   MD_LOOTER             = 0x000002,
+   MD_AGGRESSIVE         = 0x000004,
+   MD_ASSIST             = 0x000008,
+   MD_CASTSENSOR_IDLE    = 0x000010,
+   MD_BOSS               = 0x000020,
+   MD_PLANT              = 0x000040,
+   MD_CANATTACK          = 0x000080,
+   MD_DETECTOR           = 0x000100,
+   MD_CASTSENSOR_CHASE   = 0x000200,
+   MD_CHANGECHASE        = 0x000400,
+   MD_ANGRY              = 0x000800,
+   MD_CHANGETARGET_MELEE = 0x001000,
+   MD_CHANGETARGET_CHASE = 0x002000,
+   MD_TARGETWEAK         = 0x004000,
+   MD_IGNOREMELEE        = 0x010000, //takes 1 HP damage from melee physical attacks
+   MD_IGNOREMAGIC        = 0x020000, //takes 1 HP damage from magic
+   MD_IGNORERANGED       = 0x040000, //takes 1 HP damage from ranged physical attacks
+   MD_MVP                = 0x080000, //MVP - instant kill / coma-like skills don't work
+   MD_IGNOREMISC         = 0x100000, //takes 1 HP damage from "none" attack type
+   MD_KNOCKBACK_IMMUNE   = 0x200000, //can't be knocked back
 };
+#define MD_MASK 0x00FFFF
+#define ATR_MASK 0xFF0000
 
 //Status change option definitions (options are what makes status changes visible to chars
 //who were not on your field of sight when it happened)
@@ -1616,8 +1623,8 @@
        batk,
        matk_min, matk_max,
        speed,
-       amotion, adelay, dmotion,
-       mode;
+       amotion, adelay, dmotion;
+   enum e_mode mode;
    short
        hit, flee, cri, flee2,
        def2, mdef2,
Index: src/map/clif.c
===================================================================
--- src/map/clif.c  (revision 17303)
+++ src/map/clif.c  (working copy)
@@ -3295,24 +3295,37 @@
 }
 
 
-/// Notifies the client about the result of a request to take off an item (ZC_REQ_TAKEOFF_EQUIP_ACK).
-/// 00ac <index>.W <equip location>.W <result>.B
+/// Notifies the client about the result of a request to take off an item .
+/// 00ac <index>.W <equip location>.W <result>.B (ZC_REQ_TAKEOFF_EQUIP_ACK)
+/// 08d1 <index>.W <equip location>.W <result>.B (ZC_REQ_TAKEOFF_EQUIP_ACK2))
+/// 099a <index>.W <equip location>.L <result>.B (ZC_ACK_TAKEOFF_EQUIP_V5)
 /// result:
 ///     0 = failure
 ///     1 = success
 void clif_unequipitemack(struct map_session_data *sd,int n,int pos,int ok)
 {
-   int fd;
-
+   int fd,header,offs=0;
+#if PACKETVER >= 20130000
+   header = 0x99a;
+#elif PACKETVER >= 20110824
+   header = 0x8d1;
+#else
+   header = 0xac;
+#endif
    nullpo_retv(sd);
 
    fd=sd->fd;
-   WFIFOHEAD(fd,packet_len(0xac));
-   WFIFOW(fd,0)=0xac;
-   WFIFOW(fd,2)=n+2;
-   WFIFOW(fd,4)=pos;
-   WFIFOB(fd,6)=ok;
-   WFIFOSET(fd,packet_len(0xac));
+   WFIFOHEAD(fd,packet_len(header));
+   WFIFOW(fd,offs+0)=header;
+   WFIFOW(fd,offs+2)=n+2;
+#if PACKETVER >= 20130000
+   WFIFOL(fd,offs+4)=pos;
+   offs +=2;
+#else
+   WFIFOW(fd,offs+4)=pos;
+#endif
+   WFIFOB(fd,offs+6)=ok;
+   WFIFOSET(fd,packet_len(header));
 }
 
 
@@ -10181,11 +10194,12 @@
 }
 
 
-/// Request to equip an item (CZ_REQ_WEAR_EQUIP).
-/// 00a9 <index>.W <position>.W
+/// Request to equip an item
+/// 00a9 <index>.W <position>.W (CZ_REQ_WEAR_EQUIP).
+/// 0998 <index>.W <position>.L (CZ_REQ_WEAR_EQUIP_V5)
 void clif_parse_EquipItem(int fd,struct map_session_data *sd)
 {
-   int index;
+   int index, req_pos;
 
    if(pc_isdead(sd)) {
        clif_clearunit_area(&sd->bl,CLR_DEAD);
@@ -10194,7 +10208,11 @@
    index = RFIFOW(fd,2)-2;
    if (index < 0 || index >= MAX_INVENTORY)
        return; //Out of bounds check.
-
+#ifdef PACKETVER  >= 20120925
+   req_pos = RFIFOW(fd,4);
+#else
+   req_pos = RFIFOW(fd,4);
+#endif
    if(sd->npc_id) {
        if (!sd->npc_item_flag)
            return;
@@ -10220,7 +10238,7 @@
    if(sd->inventory_data[index]->type == IT_AMMO)
        pc_equipitem(sd,index,EQP_AMMO);
    else
-       pc_equipitem(sd,index,RFIFOW(fd,4));
+       pc_equipitem(sd,index,req_pos);
 }
Viewed 1200 times, submitted by lighta.