From 49cb99c7de9a82ae6bfd5b3e05ac68cc2f448909 Mon Sep 17 00:00:00 2001 From: glighta Date: Mon, 29 Apr 2013 10:55:15 +0000 Subject: [PATCH] -Follow up r17303 --fix typo (unintented test npc added) bugreport:7618 --missing elfe case for clif_additem -Add attr-column (extend mode as choosen), MD_MVP is incomplete git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@17304 54d463be-8e91-2dee-dedb-b68131a5f0ec --- npc/re/scripts_athena.conf | 2 +- src/map/battle.c | 23 +++++++++++++------- src/map/clif.c | 3 +++ src/map/skill.c | 3 ++- src/map/status.c | 8 +++++++ src/map/status.h | 43 ++++++++++++++++++++++---------------- 6 files changed, 54 insertions(+), 28 deletions(-) diff --git a/npc/re/scripts_athena.conf b/npc/re/scripts_athena.conf index 29ba74dba8..bb2ef9d7db 100644 --- a/npc/re/scripts_athena.conf +++ b/npc/re/scripts_athena.conf @@ -1,7 +1,7 @@ // -------------------------------------------------------------- // - Renewal Core Scripts - // -------------------------------------------------------------- -npc: npc/re/tester.txt + // -------------------------- Airport --------------------------- npc: npc/re/airports/izlude.txt diff --git a/src/map/battle.c b/src/map/battle.c index f2f2e7981b..e3e39803b8 100644 --- a/src/map/battle.c +++ b/src/map/battle.c @@ -1696,8 +1696,8 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo #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 @@ static struct Damage battle_calc_weapon_attack(struct block_list *src,struct blo 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 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list 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 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * 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 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * 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 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list * break; } + if(tstatus->mode&MD_IGNOREMISC && md.flag&(BF_MISC) ) //misc @TODO optimize me + md.damage = md.damage2 = 1; + return md; } /*========================================== diff --git a/src/map/clif.c b/src/map/clif.c index 9425026d18..072a02388c 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2151,6 +2151,9 @@ void clif_additem(struct map_session_data *sd, int n, int amount, int fail) #endif #if PACKETVER >= 20071002 WFIFOW(fd,27)=0; // unknown +#endif +#if PACKETVER >= 20120925 + WFIFOW(fd,29)=0; // unknown #endif } else diff --git a/src/map/skill.c b/src/map/skill.c index 590873de32..5f725d9ac5 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -2124,7 +2124,8 @@ int skill_blown(struct block_list* src, struct block_list* target, int count, in 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; diff --git a/src/map/status.c b/src/map/status.c index 5ff8d0d931..ee9b0e9b10 100644 --- a/src/map/status.c +++ b/src/map/status.c @@ -6976,6 +6976,14 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty 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) { diff --git a/src/map/status.h b/src/map/status.h index 3d6ff0c17c..c893af4486 100644 --- a/src/map/status.h +++ b/src/map/status.h @@ -1411,23 +1411,30 @@ extern int current_equip_card_id; //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 @@ struct status_data { batk, matk_min, matk_max, speed, - amotion, adelay, dmotion, - mode; + amotion, adelay, dmotion; + enum e_mode mode; short hit, flee, cri, flee2, def2, mdef2,