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)
@@ -2152,6 +2152,9 @@
#if PACKETVER >= 20071002
WFIFOW(fd,27)=0; // unknown
#endif
+#if PACKETVER >= 20120925
+ WFIFOW(fd,29)=0; // unknown
+#endif
}
else
{
@@ -3264,55 +3267,81 @@
}
-/// Notifies the client about the result of a request to equip an item (ZC_REQ_WEAR_EQUIP_ACK).
-/// 00aa <index>.W <equip location>.W <result>.B
+/// Notifies the client about the result of a request to equip an item .
+/// 00aa <index>.W <equip location>.W <result>.B (ZC_REQ_WEAR_EQUIP_ACK)
/// 00aa <index>.W <equip location>.W <view id>.W <result>.B (PACKETVER >= 20100629)
+/// 08d0 <index>.W <equip location>.W <view id>.W <result>.B (ZC_REQ_WEAR_EQUIP_ACK2)
+/// 0999 <index>.W <equip location>.L <view id>.W <result>.B (ZC_ACK_WEAR_EQUIP_V5)
/// result:
/// 0 = failure
/// 1 = success
/// 2 = failure due to low level
void clif_equipitemack(struct map_session_data *sd,int n,int pos,int ok)
{
- int fd;
-
+ int fd,header,offs=0;
+#if PACKETVER < 20110824
+ header = 0xaa;
+#elif PACKETVER < 20120925
+ header = 0x8d0;
+#else
+ header = 0x999;
+#endif
nullpo_retv(sd);
fd=sd->fd;
- WFIFOHEAD(fd,packet_len(0xaa));
- WFIFOW(fd,0)=0xaa;
- WFIFOW(fd,2)=n+2;
- WFIFOW(fd,4)=pos;
+ WFIFOHEAD(fd,packet_len(header));
+ WFIFOW(fd,offs+0)=header;
+ WFIFOW(fd,offs+2)=n+2;
+#if PACKETVER >= 20120925
+ WFIFOL(fd,offs+4)=pos;
+ offs+=2;
+#else
+ WFIFOW(fd,offs+4)=(int)pos;
+#endif
#if PACKETVER < 20100629
- WFIFOB(fd,6)=ok;
+ WFIFOB(fd,offs+6)=ok;
#else
if (ok && sd->inventory_data[n]->equip&EQP_VISIBLE)
- WFIFOW(fd,6)=sd->inventory_data[n]->look;
+ WFIFOW(fd,offs+6)=sd->inventory_data[n]->look;
else
- WFIFOW(fd,6)=0;
- WFIFOB(fd,8)=ok;
+ WFIFOW(fd,offs+6)=0;
+ WFIFOB(fd,offs+8)=ok;
#endif
- WFIFOSET(fd,packet_len(0xaa));
+ WFIFOSET(fd,packet_len(header));
}
-/// 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 +10210,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 +10224,11 @@
index = RFIFOW(fd,2)-2;
if (index < 0 || index >= MAX_INVENTORY)
return; //Out of bounds check.
-
+#if PACKETVER >= 20120925
+ req_pos = RFIFOL(fd,4);
+#else
+ req_pos = RFIFOW(fd,4);
+#endif
if(sd->npc_id) {
if (!sd->npc_item_flag)
return;
@@ -10220,7 +10254,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);
}
@@ -16727,7 +16761,7 @@
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
//#0x08C0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,
- 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 9, 7, 10, 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, 0, 0,
//#0x0900
@@ -16742,7 +16776,7 @@
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,
- 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0,
+ 31, 0, 0, 0, 0, 0, 0, 0, 8, 11, 9, 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, 14, 0, 0, 0, 0, 0, 0, 0, 0,
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: db
===================================================================
--- db (revision 17303)
+++ db (working copy)
Property changes on: db
___________________________________________________________________
Added: svn:ignore
## -0,0 +1 ##
+.~lock.mob_db2.txt#
Index: db/packet_db.txt
===================================================================
--- db/packet_db.txt (revision 17303)
+++ db/packet_db.txt (working copy)
@@ -1629,6 +1629,7 @@
0x0857,-1
0x0858,-1
0x0859,-1
+0x08d0,9
//2011-10-05aRagexeRE
packet_ver: 27
@@ -1645,6 +1646,7 @@
0x0838,6,solvecharname,2
0x0439,8,useitem,2:4
0x08d2,10
+0x08d1,7
// 2011-11-02aRagexe
packet_ver: 28
@@ -1837,6 +1839,12 @@
0x990,31 //additem
0x99b,8 //maptypeproperty2
0x84b,19 //fallitem4
+0x090f,-1 // notify_newentry7
+0x914,-1 // notify_moveentry
+0x915,-1 // notify_standentry
+0x99a,9 // take_off_equipv5
+0x998,6,equipitem,2:4
+0x999,11 // cz_wear_equipv5
// New cashshop
0x0844,2,cashshopopen,0
Index: npc/re/scripts_athena.conf
===================================================================
--- npc/re/scripts_athena.conf (revision 17303)
+++ npc/re/scripts_athena.conf (working copy)
@@ -1,7 +1,7 @@
// --------------------------------------------------------------
// - Renewal Core Scripts -
// --------------------------------------------------------------
-npc: npc/re/tester.txt
+
// -------------------------- Airport ---------------------------
npc: npc/re/airports/izlude.txt