summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorMatheus Macabu <mkbu95@gmail.com>2013-07-04 17:25:18 -0300
committerMatheus Macabu <mkbu95@gmail.com>2013-07-04 17:25:18 -0300
commit5b1d3c5ebcbeab9730f8f4603c769c090ca4c8d1 (patch)
treeb3b02e05f343a3e24b7cceb34ce04bbb8721ed1c /src/map/battle.c
parent5ea7b8b9e172ed16fda6ee5a051ae0dbb767b4ac (diff)
parentaefa8d6bd88e5056080f45ed89f86258f1bf81d7 (diff)
downloadhercules-5b1d3c5ebcbeab9730f8f4603c769c090ca4c8d1.tar.gz
hercules-5b1d3c5ebcbeab9730f8f4603c769c090ca4c8d1.tar.bz2
hercules-5b1d3c5ebcbeab9730f8f4603c769c090ca4c8d1.tar.xz
hercules-5b1d3c5ebcbeab9730f8f4603c769c090ca4c8d1.zip
Merge branch 'master' of https://github.com/HerculesWS/Hercules
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c279
1 files changed, 139 insertions, 140 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 31a4ddc89..b9669c319 100644
--- a/src/map/battle.c
+++ b/src/map/battle.c
@@ -130,7 +130,7 @@ int battle_getenemy_sub(struct block_list *bl, va_list ap) {
if (*c >= 24)
return 0;
- if (status_isdead(bl))
+ if (iStatus->isdead(bl))
return 0;
if (battle->check_target(target, bl, BCT_ENEMY) > 0) {
@@ -172,7 +172,7 @@ int battle_getenemyarea_sub(struct block_list *bl, va_list ap) {
if( *c >= 23 )
return 0;
- if( status_isdead(bl) )
+ if( iStatus->isdead(bl) )
return 0;
if( battle->check_target(src, bl, BCT_ENEMY) > 0 ) {// Is Enemy!...
@@ -220,7 +220,7 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
struct block_list* src;
struct block_list* target = iMap->id2bl(dat->target_id);
- if( !target || status_isdead(target) ) {/* nothing we can do */
+ if( !target || iStatus->isdead(target) ) {/* nothing we can do */
ers_free(delay_damage_ers, dat);
return 0;
}
@@ -233,7 +233,7 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
{
iMap->freeblock_lock();
status_fix_damage(src, target, dat->damage, dat->delay);
- if( dat->attack_type && !status_isdead(target) && dat->additional_effects )
+ if( dat->attack_type && !iStatus->isdead(target) && dat->additional_effects )
skill->additional_effect(src,target,dat->skill_id,dat->skill_lv,dat->attack_type,dat->dmg_lv,tick);
if( dat->dmg_lv > ATK_BLOCK && dat->attack_type )
skill->counter_additional_effect(src,target,dat->skill_id,dat->skill_lv,dat->attack_type,tick);
@@ -258,7 +258,7 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
nullpo_ret(src);
nullpo_ret(target);
- sc = status_get_sc(target);
+ sc = iStatus->get_sc(target);
if( sc && sc->data[SC_DEVOTION] && damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD )
damage = 0;
@@ -266,7 +266,7 @@ int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src,
if ( !battle_config.delay_battle_damage || amotion <= 1 ) {
iMap->freeblock_lock();
status_fix_damage(src, target, damage, ddelay); // We have to seperate here between reflect damage and others [icescope]
- if( attack_type && !status_isdead(target) && additional_effects )
+ if( attack_type && !iStatus->isdead(target) && additional_effects )
skill->additional_effect(src, target, skill_id, skill_lv, attack_type, dmg_lv, iTimer->gettick());
if( dmg_lv > ATK_BLOCK && attack_type )
skill->counter_additional_effect(src, target, skill_id, skill_lv, attack_type, iTimer->gettick());
@@ -313,8 +313,8 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
struct status_change *sc=NULL, *tsc=NULL;
int ratio;
- if (src) sc = status_get_sc(src);
- if (target) tsc = status_get_sc(target);
+ if (src) sc = iStatus->get_sc(src);
+ if (target) tsc = iStatus->get_sc(target);
if (atk_elem < 0 || atk_elem >= ELE_MAX)
atk_elem = rnd()%ELE_MAX;
@@ -341,7 +341,7 @@ int battle_attr_fix(struct block_list *src, struct block_list *target, int damag
struct block_list *src;
if( !su || !su->alive || (sg = su->group) == NULL || !sg || sg->val3 == -1 ||
- (src = iMap->id2bl(sg->src_id)) == NULL || status_isdead(src) )
+ (src = iMap->id2bl(sg->src_id)) == NULL || iStatus->isdead(src) )
return 0;
if( sg->unit_id != UNT_FIREWALL ) {
@@ -420,10 +420,10 @@ int battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, uin
if( !src || !bl )
return 0;
- sc = status_get_sc(src);
+ sc = iStatus->get_sc(src);
sd = BL_CAST(BL_PC, src);
- damage = status_get_weapon_atk(src, watk, flag);
+ damage = iStatus->get_weapon_atk(src, watk, flag);
if( sd ){
if( type == EQI_HAND_R )
@@ -444,7 +444,7 @@ int battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, uin
#ifdef RENEWAL_EDP
if( sc->data[SC_EDP] && skill_id != AS_GRIMTOOTH && skill_id != AS_VENOMKNIFE && skill_id != ASC_BREAKER ){
eatk = eatk * sc->data[SC_EDP]->val4 / 100;
- damage += damage * sc->data[SC_EDP]->val3 / 100;
+ damage += damage * sc->data[SC_EDP]->val3 / 100;
}
#endif
}
@@ -489,9 +489,9 @@ int battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, uin
int battle_calc_base_damage(struct block_list *src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, int nk, bool n_ele, short s_ele, short s_ele_, int type, int flag, int flag2)
{
int damage, batk;
- struct status_data *status = status_get_status_data(src);
+ struct status_data *status = iStatus->get_status_data(src);
- batk = battle->calc_elefix(src, bl, skill_id, skill_lv, status_calc_batk(bl, status_get_sc(src), status->batk, false), nk, n_ele, ELE_NEUTRAL, ELE_NEUTRAL, false, flag);
+ batk = battle->calc_elefix(src, bl, skill_id, skill_lv, iStatus->calc_batk(bl, iStatus->get_sc(src), status->batk, false), nk, n_ele, ELE_NEUTRAL, ELE_NEUTRAL, false, flag);
if( type == EQI_HAND_L )
damage = batk + 3 * battle->calc_weapon_damage(src, bl, skill_id, skill_lv, &status->lhw, nk, n_ele, s_ele, s_ele_, status_get_size(bl), type, flag, flag2) / 4;
@@ -592,7 +592,7 @@ int battle_calc_sizefix(struct map_session_data *sd, int damage, int type, int s
int battle_addmastery(struct map_session_data *sd,struct block_list *target,int dmg,int type)
{
int damage,skill;
- struct status_data *status = status_get_status_data(target);
+ struct status_data *status = iStatus->get_status_data(target);
int weapon;
damage = dmg;
@@ -711,9 +711,9 @@ int battle_calc_masteryfix(struct block_list *src, struct block_list *target, ui
nullpo_ret(src);
nullpo_ret(target);
- sc = status_get_sc(src);
+ sc = iStatus->get_sc(src);
sd = BL_CAST(BL_PC, src);
- tstatus = status_get_status_data(target);
+ tstatus = iStatus->get_status_data(target);
if ( !sd )
return damage;
@@ -808,7 +808,7 @@ int battle_calc_masteryfix(struct block_list *src, struct block_list *target, ui
if ( sc && sc->data[SC_MIRACLE] )
i = 2; //Star anger
else
- ARR_FIND(0, MAX_PC_FEELHATE, i, status_get_class(target) == sd->hate_mob[i]);
+ ARR_FIND(0, MAX_PC_FEELHATE, i, iStatus->get_class(target) == sd->hate_mob[i]);
if ( i < MAX_PC_FEELHATE && (skill=pc->checkskill(sd,sg_info[i].anger_id)) && weapon ){
int ratio = sd->status.base_level + status_get_dex(src) + status_get_luk(src);
if ( i == 2 ) ratio += status_get_str(src); //Star Anger
@@ -835,9 +835,9 @@ int battle_calc_elefix(struct block_list *src, struct block_list *target, uint16
nullpo_ret(src);
nullpo_ret(target);
- sstatus = status_get_status_data(src);
- tstatus = status_get_status_data(target);
- sc = status_get_sc(src);
+ sstatus = iStatus->get_status_data(src);
+ tstatus = iStatus->get_status_data(target);
+ sc = iStatus->get_sc(src);
if( (nk&NK_NO_ELEFIX) && n_ele )
return damage;
@@ -887,11 +887,11 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
- t_class = status_get_class(target);
- s_class = status_get_class(src);
- sstatus = status_get_status_data(src);
- tstatus = status_get_status_data(target);
- s_race2 = status_get_race2(src);
+ t_class = iStatus->get_class(target);
+ s_class = iStatus->get_class(src);
+ sstatus = iStatus->get_status_data(src);
+ tstatus = iStatus->get_status_data(target);
+ s_race2 = iStatus->get_race2(src);
switch(attack_type){
case BF_MAGIC:
@@ -957,7 +957,7 @@ int battle_calc_cardfix(int attack_type, struct block_list *src, struct block_li
}
break;
case BF_WEAPON:
- t_race2 = status_get_race2(target);
+ t_race2 = iStatus->get_race2(target);
if( cflag&2 ){
if( sd && !(nk&NK_NO_CARDFIX_ATK) ){
short cardfix_ = 1000;
@@ -1190,10 +1190,10 @@ int battle_calc_defense(int attack_type, struct block_list *src, struct block_li
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
- sstatus = status_get_status_data(src);
- tstatus = status_get_status_data(target);
- sc = status_get_sc(src);
- tsc = status_get_sc(target);
+ sstatus = iStatus->get_status_data(src);
+ tstatus = iStatus->get_status_data(target);
+ sc = iStatus->get_sc(src);
+ tsc = iStatus->get_sc(target);
switch(attack_type){
case BF_WEAPON:
@@ -1202,14 +1202,14 @@ int battle_calc_defense(int attack_type, struct block_list *src, struct block_li
* def1 = equip def
* def2 = status def
**/
- defType def1 = status_get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
+ defType def1 = iStatus->get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
short def2 = tstatus->def2, vit_def;
#ifdef RENEWAL
- def1 = status_calc_def2(target, tsc, def1, false); // equip def(RE)
- def2 = status_calc_def(target, tsc, def2, false); // status def(RE)
+ def1 = iStatus->calc_def2(target, tsc, def1, false); // equip def(RE)
+ def2 = iStatus->calc_def(target, tsc, def2, false); // status def(RE)
#else
- def1 = status_calc_def(target, tsc, def1, false); // equip def(RE)
- def2 = status_calc_def2(target, tsc, def2, false); // status def(RE)
+ def1 = iStatus->calc_def(target, tsc, def1, false); // equip def(RE)
+ def2 = iStatus->calc_def2(target, tsc, def2, false); // status def(RE)
#endif
if( sd ){
@@ -1315,11 +1315,11 @@ int battle_calc_defense(int attack_type, struct block_list *src, struct block_li
defType mdef = tstatus->mdef;
short mdef2= tstatus->mdef2;
#ifdef RENEWAL
- mdef2 = status_calc_mdef(target, tsc, mdef2, false); // status mdef(RE)
- mdef = status_calc_mdef2(target, tsc, mdef, false); // equip mde(RE)
+ mdef2 = iStatus->calc_mdef(target, tsc, mdef2, false); // status mdef(RE)
+ mdef = iStatus->calc_mdef2(target, tsc, mdef, false); // equip mde(RE)
#else
- mdef2 = status_calc_mdef2(target, tsc, mdef2, false); // status mdef(RE)
- mdef = status_calc_mdef(target, tsc, mdef, false); // equip mde(RE)
+ mdef2 = iStatus->calc_mdef2(target, tsc, mdef2, false); // status mdef(RE)
+ mdef = iStatus->calc_mdef(target, tsc, mdef, false); // equip mde(RE)
#endif
if( flag&1 )
mdef = 0;
@@ -1366,10 +1366,10 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
- sc = status_get_sc(src);
- tsc = status_get_sc(target);
- status = status_get_status_data(src);
- tstatus = status_get_status_data(target);
+ sc = iStatus->get_sc(src);
+ tsc = iStatus->get_sc(target);
+ status = iStatus->get_status_data(src);
+ tstatus = iStatus->get_status_data(target);
addedratio = skillratio - 100;
@@ -1440,7 +1440,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
skillratio += (tstatus->size!=SZ_BIG?5*skill_lv:-99); //Full damage is dealt on small/medium targets
break;
case SL_SMA:
- skillratio += -60 + status_get_lv(src); //Base damage is 40% + lv%
+ skillratio += -60 + iStatus->get_lv(src); //Base damage is 40% + lv%
break;
case NJ_KOUENKA:
skillratio -= 10;
@@ -1589,7 +1589,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
case WL_SUMMON_ATK_WATER:
case WL_SUMMON_ATK_WIND:
case WL_SUMMON_ATK_GROUND:
- skillratio = skill_lv * (status_get_lv(src) + ( sd ? sd->status.job_level : 50 ));// This is close to official, but lacking a little info to finalize. [Rytech]
+ skillratio = skill_lv * (iStatus->get_lv(src) + ( sd ? sd->status.job_level : 50 ));// This is close to official, but lacking a little info to finalize. [Rytech]
RE_LVL_DMOD(100);
break;
case LG_RAYOFGENESIS:
@@ -1603,7 +1603,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
break;
case LG_SHIELDSPELL:// [(Casters Base Level x 4) + (Shield MDEF x 100) + (Casters INT x 2)] %
if( sd ) {
- skillratio = status_get_lv(src) * 4 + sd->bonus.shieldmdef * 100 + status_get_int(src) * 2;
+ skillratio = iStatus->get_lv(src) * 4 + sd->bonus.shieldmdef * 100 + status_get_int(src) * 2;
} else
skillratio += 1900; //2000%
break;
@@ -1976,10 +1976,10 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
case TK_JUMPKICK:
skillratio += -70 + 10*skill_lv;
if (sc && sc->data[SC_COMBOATTACK] && sc->data[SC_COMBOATTACK]->val1 == skill_id)
- skillratio += 10 * status_get_lv(src) / 3; //Tumble bonus
+ skillratio += 10 * iStatus->get_lv(src) / 3; //Tumble bonus
if (flag)
{
- skillratio += 10 * status_get_lv(src) / 3; //Running bonus (TODO: What is the real bonus?)
+ skillratio += 10 * iStatus->get_lv(src) / 3; //Running bonus (TODO: What is the real bonus?)
if( sc && sc->data[SC_STRUP] ) // Spurt bonus
skillratio *= 2;
}
@@ -2064,7 +2064,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
break;
case RK_SONICWAVE:
skillratio += -100 + 100 * (skill_lv + 5);
- skillratio = skillratio * (100 + (status_get_lv(src)-100) / 2) / 100;
+ skillratio = skillratio * (100 + (iStatus->get_lv(src)-100) / 2) / 100;
break;
case RK_HUNDREDSPEAR:
skillratio += 500 + (80 * skill_lv);
@@ -2073,7 +2073,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
if( index >= 0 && sd->inventory_data[index]
&& sd->inventory_data[index]->type == IT_WEAPON )
skillratio += (10000 - min(10000, sd->inventory_data[index]->weight)) / 10;
- skillratio = skillratio * (100 + (status_get_lv(src)-100) / 2) / 100 + 50 * pc->checkskill(sd,LK_SPIRALPIERCE);
+ skillratio = skillratio * (100 + (iStatus->get_lv(src)-100) / 2) / 100 + 50 * pc->checkskill(sd,LK_SPIRALPIERCE);
}
break;
case RK_WINDCUTTER:
@@ -2088,7 +2088,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
skillratio += 250 * skill_lv;
else
skillratio += 200 * skill_lv;
- skillratio = (skillratio - 100) * (100 + (status_get_lv(src)-100)) / 100;
+ skillratio = (skillratio - 100) * (100 + (iStatus->get_lv(src)-100)) / 100;
if( status->rhw.ele == ELE_FIRE )
skillratio += 100 * skill_lv;
break;
@@ -2250,7 +2250,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
case LG_SHIELDSPELL:// [(Casters Base Level x 4) + (Shield DEF x 10) + (Casters VIT x 2)] %
if( sd ) {
struct item_data *shield_data = sd->inventory_data[sd->equip_index[EQI_HAND_L]];
- skillratio += -100 + status_get_lv(src) * 4 + status_get_vit(src) * 2;
+ skillratio += -100 + iStatus->get_lv(src) * 4 + status_get_vit(src) * 2;
if( shield_data )
skillratio += shield_data->def * 10;
} else
@@ -2331,7 +2331,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
break;
case SR_KNUCKLEARROW:
if( flag&4 ){ // ATK [(Skill Level x 150) + (1000 x Target current weight / Maximum weight) + (Target Base Level x 5) x (Caster Base Level / 150)] %
- skillratio += -100 + 150 * skill_lv + status_get_lv(target) * 5 * (status_get_lv(src) / 100) ;
+ skillratio += -100 + 150 * skill_lv + iStatus->get_lv(target) * 5 * (iStatus->get_lv(src) / 100) ;
if( tsd && tsd->weight )
skillratio += 100 * (tsd->weight / tsd->max_weight);
}else // ATK [(Skill Level x 100 + 500) x Caster Base Level / 100] %
@@ -2339,7 +2339,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
RE_LVL_DMOD(100);
break;
case SR_WINDMILL: // ATK [(Caster Base Level + Caster DEX) x Caster Base Level / 100] %
- skillratio += -100 + status_get_lv(src) + status_get_dex(src);
+ skillratio += -100 + iStatus->get_lv(src) + status_get_dex(src);
RE_LVL_DMOD(100);
break;
case SR_GATEOFHELL:
@@ -2458,7 +2458,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
skillratio += -100 + 150 * skill_lv;
RE_LVL_DMOD(120);
if( tsc && tsc->data[SC_KO_JYUMONJIKIRI] )
- skillratio += status_get_lv(src) * skill_lv;
+ skillratio += iStatus->get_lv(src) * skill_lv;
case KO_HUUMARANKA:
skillratio += -100 + 150 * skill_lv + status_get_agi(src) + status_get_dex(src) + 100 * (sd ? pc->checkskill(sd, NJ_HUUMA) : 0);
break;
@@ -2532,7 +2532,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if(!damage) return 0;
}
- sc = status_get_sc(bl);
+ sc = iStatus->get_sc(bl);
if( sc && sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
return 1;
@@ -2553,7 +2553,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
skill_id == MG_SOULSTRIKE ||
skill_id == WL_SOULEXPANSION ||
(skill_id && skill->get_ele(skill_id, skill_lv) == ELE_GHOST) ||
- (!skill_id && (status_get_status_data(src))->rhw.ele == ELE_GHOST)
+ (!skill_id && (iStatus->get_status_data(src))->rhw.ele == ELE_GHOST)
){
if( skill_id == WL_SOULEXPANSION )
damage <<= 1; // If used against a player in White Imprison, the skill deals double damage.
@@ -2694,7 +2694,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
&& flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK)) {
skill->additional_effect (src, bl, skill_id, skill_lv, flag, ATK_BLOCK, iTimer->gettick() );
- if( !status_isdead(src) )
+ if( !iStatus->isdead(src) )
skill->counter_additional_effect( src, bl, skill_id, skill_lv, flag, iTimer->gettick() );
if (sce) {
clif->specialeffect(bl, 462, AREA);
@@ -2816,11 +2816,11 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if(sc->data[SC_ENERGYCOAT] && (flag&BF_WEAPON && skill_id != WS_CARTTERMINATION))
#endif
{
- struct status_data *status = status_get_status_data(bl);
+ struct status_data *status = iStatus->get_status_data(bl);
int per = 100*status->sp / status->max_sp -1; //100% should be counted as the 80~99% interval
per /=20; //Uses 20% SP intervals.
//SP Cost: 1% + 0.5% per every 20% SP
- if (!status_charge(bl, 0, (10+5*per)*status->max_sp/1000))
+ if (!iStatus->charge(bl, 0, (10+5*per)*status->max_sp/1000))
status_change_end(bl, SC_ENERGYCOAT, INVALID_TIMER);
//Reduction: 6% + 6% every 20%
damage -= damage * (6 * (1+per)) / 100;
@@ -2903,7 +2903,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
//(since battle_drain is strictly for players currently)
if ((sce=sc->data[SC_HAMI_BLOODLUST]) && flag&BF_WEAPON && damage > 0 &&
rnd()%100 < sce->val3)
- status_heal(src, damage*sce->val4/100, 0, 3);
+ iStatus->heal(src, damage*sce->val4/100, 0, 3);
if( sd && (sce = sc->data[SC_FORCEOFVANGUARD]) && flag&BF_WEAPON && rnd()%100 < sce->val2 )
pc->addspiritball(sd,skill->get_time(LG_FORCEOFVANGUARD,sce->val1),sce->val3);
@@ -2913,13 +2913,13 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
}
if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
- status_change_spread(bl, src); // Deadly infect attacked side
+ iStatus->change_spread(bl, src); // Deadly infect attacked side
if( sc && sc->data[SC__SHADOWFORM] ) {
struct block_list *s_bl = iMap->id2bl(sc->data[SC__SHADOWFORM]->val2);
if( !s_bl || s_bl->m != bl->m ) { // If the shadow form target is not present remove the sc.
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
- } else if( status_isdead(s_bl) || !battle->check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both.
+ } else if( iStatus->isdead(s_bl) || !battle->check_target(src,s_bl,BCT_ENEMY)) { // If the shadow form target is dead or not your enemy remove the sc in both.
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
if( s_bl->type == BL_PC )
((TBL_PC*)s_bl)->shadowform_id = 0;
@@ -2929,7 +2929,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( s_bl->type == BL_PC )
((TBL_PC*)s_bl)->shadowform_id = 0;
} else {
- status_damage(bl, s_bl, damage, 0, clif->damage(s_bl, s_bl, iTimer->gettick(), 500, 500, damage, -1, 0, 0), 0);
+ iStatus->damage(bl, s_bl, damage, 0, clif->damage(s_bl, s_bl, iTimer->gettick(), 500, 500, damage, -1, 0, 0), 0);
return ATK_NONE;
}
}
@@ -2938,7 +2938,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
}
//SC effects from caster side.
- sc = status_get_sc(src);
+ sc = iStatus->get_sc(src);
if (sc && sc->count) {
if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
@@ -2967,7 +2967,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
if( sc->data[SC_POISONINGWEAPON] && skill_id != GC_VENOMPRESSURE && (flag&BF_WEAPON) && damage > 0 && rnd()%100 < sc->data[SC_POISONINGWEAPON]->val3 )
sc_start(bl,sc->data[SC_POISONINGWEAPON]->val2,100,sc->data[SC_POISONINGWEAPON]->val1,skill->get_time2(GC_POISONINGWEAPON, 1));
if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
- status_change_spread(src, bl);
+ iStatus->change_spread(src, bl);
if (sc->data[SC_STYLE_CHANGE] && rnd()%2) {
TBL_HOM *hd = BL_CAST(BL_HOM,bl);
if (hd) homun->addspiritball(hd, 10);
@@ -3009,7 +3009,7 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
damage = div_;
}
- if( bl->type == BL_MOB && !status_isdead(bl) && src != bl) {
+ if( bl->type == BL_MOB && !iStatus->isdead(bl) && src != bl) {
if (damage > 0 )
mobskill_event((TBL_MOB*)bl,src,iTimer->gettick(),flag);
if (skill_id)
@@ -3022,12 +3022,12 @@ int battle_calc_damage(struct block_list *src,struct block_list *bl,struct Damag
struct status_data *sstatus = NULL;
if( src->type == BL_PC && ((TBL_PC*)src)->bonus.arrow_ele )
element = ((TBL_PC*)src)->bonus.arrow_ele;
- else if( (sstatus = status_get_status_data(src)) ) {
+ else if( (sstatus = iStatus->get_status_data(src)) ) {
element = sstatus->rhw.ele;
}
}
else if( element == -2 ) //Use enchantment's element
- element = status_get_attack_sc_element(src,status_get_sc(src));
+ element = status_get_attack_sc_element(src,iStatus->get_sc(src));
else if( element == -3 ) //Use random element
element = rnd()%ELE_MAX;
if( element == ELE_FIRE || element == ELE_WATER )
@@ -3062,7 +3062,7 @@ int battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int dam
int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int damage,int div_,uint16 skill_id,uint16 skill_lv,int flag)
{
struct mob_data* md = BL_CAST(BL_MOB, bl);
- int class_ = status_get_class(bl);
+ int class_ = iStatus->get_class(bl);
if (!damage) //No reductions to make.
return 0;
@@ -3081,7 +3081,7 @@ int battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int dama
}
}
if(src->type != BL_MOB) {
- struct guild *g = src->type == BL_PC ? ((TBL_PC *)src)->guild : guild->search(status_get_guild_id(src));
+ struct guild *g = src->type == BL_PC ? ((TBL_PC *)src)->guild : guild->search(iStatus->get_guild_id(src));
if (class_ == MOBID_EMPERIUM && (!g || guild->checkskill(g,GD_APPROVAL) <= 0 ))
return 0;
@@ -3198,8 +3198,8 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
// TBL_PC *tsd;
struct status_change *sc, *tsc;
struct Damage ad;
- struct status_data *sstatus = status_get_status_data(src);
- struct status_data *tstatus = status_get_status_data(target);
+ struct status_data *sstatus = iStatus->get_status_data(src);
+ struct status_data *tstatus = iStatus->get_status_data(target);
struct {
unsigned imdef : 1;
unsigned infdef : 1;
@@ -3226,8 +3226,8 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
sd = BL_CAST(BL_PC, src);
// tsd = BL_CAST(BL_PC, target);
- sc = status_get_sc(src);
- tsc = status_get_sc(target);
+ sc = iStatus->get_sc(src);
+ tsc = iStatus->get_sc(target);
//Initialize variables that will be used afterwards
s_ele = skill->get_ele(skill_id, skill_lv);
@@ -3239,7 +3239,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
if( i < 5 ) s_ele = i;
}
}else if (s_ele == -2) //Use status element
- s_ele = status_get_attack_sc_element(src,status_get_sc(src));
+ s_ele = status_get_attack_sc_element(src,iStatus->get_sc(src));
else if( s_ele == -3 ) //Use random element
s_ele = rnd()%ELE_MAX;
@@ -3326,16 +3326,16 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
case ALL_RESURRECTION:
case PR_TURNUNDEAD:
//Undead check is on skill_castend_damageid code.
- i = 20*skill_lv + sstatus->luk + sstatus->int_ + status_get_lv(src)
+ i = 20*skill_lv + sstatus->luk + sstatus->int_ + iStatus->get_lv(src)
+ 200 - 200*tstatus->hp/tstatus->max_hp; // there is no changed in success chance in renewal. [malufett]
if(i > 700) i = 700;
if(rnd()%1000 < i && !(tstatus->mode&MD_BOSS))
ad.damage = tstatus->hp;
else {
#ifdef RENEWAL
- MATK_ADD(status_get_matk(src, 2));
+ MATK_ADD(iStatus->get_matk(src, 2));
#else
- ad.damage = status_get_lv(src) + sstatus->int_ + skill_lv * 10;
+ ad.damage = iStatus->get_lv(src) + sstatus->int_ + skill_lv * 10;
#endif
}
break;
@@ -3347,10 +3347,10 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
**/
case AB_RENOVATIO:
//Damage calculation from iRO wiki. [Jobbie]
- ad.damage = (int)((15 * status_get_lv(src)) + (1.5 * sstatus->int_));
+ ad.damage = (int)((15 * iStatus->get_lv(src)) + (1.5 * sstatus->int_));
break;
default: {
- MATK_ADD( status_get_matk(src, 2) );
+ MATK_ADD( iStatus->get_matk(src, 2) );
if (nk&NK_SPLASHSPLIT) { // Divide MATK in case of multiple targets skill
if(mflag>0)
@@ -3510,11 +3510,11 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
struct map_session_data *sd, *tsd;
struct Damage md; //DO NOT CONFUSE with md of mob_data!
- struct status_data *sstatus = status_get_status_data(src);
- struct status_data *tstatus = status_get_status_data(target);
- struct status_change *tsc = status_get_sc(target);
+ struct status_data *sstatus = iStatus->get_status_data(src);
+ struct status_data *tstatus = iStatus->get_status_data(target);
+ struct status_change *tsc = iStatus->get_sc(target);
#ifdef RENEWAL
- struct status_change *sc = status_get_sc(src);
+ struct status_change *sc = iStatus->get_sc(src);
#endif
memset(&md,0,sizeof(md));
@@ -3558,7 +3558,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case MA_LANDMINE:
case HT_BLASTMINE:
case HT_CLAYMORETRAP:
- md.damage = skill_lv * sstatus->dex * (3+status_get_lv(src)/100) * (1+sstatus->int_/35);
+ md.damage = skill_lv * sstatus->dex * (3+iStatus->get_lv(src)/100) * (1+sstatus->int_/35);
md.damage += md.damage * (rnd()%20-10) / 100;
md.damage += 40 * (sd?pc->checkskill(sd,RA_RESEARCHTRAP):0);
break;
@@ -3620,8 +3620,8 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
#ifdef RENEWAL
{// [malufett]
int matk=0, atk;
- short tdef = status_get_total_def(target);
- short tmdef = status_get_total_mdef(target);
+ short tdef = iStatus->get_total_def(target);
+ short tmdef = iStatus->get_total_mdef(target);
int targetVit = min(120, status_get_vit(target));
short totaldef = (tmdef + tdef - ((uint64)(tmdef + tdef) >> 32)) >> 1;
@@ -3679,7 +3679,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
md.damage=md.damage / 2;
break;
case GS_FLING:
- md.damage = sd?sd->status.job_level:status_get_lv(src);
+ md.damage = sd?sd->status.job_level:iStatus->get_lv(src);
break;
case HVAN_EXPLOSION: //[orn]
md.damage = sstatus->max_hp * (50 + 50 * skill_lv) / 100;
@@ -3692,7 +3692,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
#else
int ratio = 300 + 50 * skill_lv;
int matk = battle->calc_magic_attack(src, target, skill_id, skill_lv, mflag).damage;
- short totaldef = status_get_total_def(target) + status_get_total_mdef(target);
+ short totaldef = iStatus->get_total_def(target) + iStatus->get_total_mdef(target);
int atk = battle->calc_base_damage(src, target, skill_id, skill_lv, nk, false, s_ele, ELE_NEUTRAL, EQI_HAND_R, (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0), md.flag);
if( sc && sc->data[SC_EDP] )
@@ -3741,9 +3741,9 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case NC_SELFDESTRUCTION:
{
#ifdef RENEWAL
- short totaldef = status_get_total_def(target);
+ short totaldef = iStatus->get_total_def(target);
#else
- short totaldef = tstatus->def2 + (short)status_get_def(target);
+ short totaldef = tstatus->def2 + (short)iStatus->get_def(target);
#endif
md.damage = ( (sd?pc->checkskill(sd,NC_MAINFRAME):10) + 8 ) * ( skill_lv + 1 ) * ( status_get_sp(src) + sstatus->vit );
RE_LVL_MDMOD(100);
@@ -3758,15 +3758,15 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
break;
case GN_HELLS_PLANT_ATK:
//[{( Hell Plant Skill Level x Casters Base Level ) x 10 } + {( Casters INT x 7 ) / 2 } x { 18 + ( Casters Job Level / 4 )] x ( 5 / ( 10 - Summon Flora Skill Level ))
- md.damage = ( skill_lv * status_get_lv(src) * 10 ) + ( sstatus->int_ * 7 / 2 ) * ( 18 + (sd?sd->status.job_level:0) / 4 ) * ( 5 / (10 - (sd?pc->checkskill(sd,AM_CANNIBALIZE):0)) );
+ md.damage = ( skill_lv * iStatus->get_lv(src) * 10 ) + ( sstatus->int_ * 7 / 2 ) * ( 18 + (sd?sd->status.job_level:0) / 4 ) * ( 5 / (10 - (sd?pc->checkskill(sd,AM_CANNIBALIZE):0)) );
break;
case KO_HAPPOKUNAI:
{
struct Damage wd = battle->calc_weapon_attack(src,target,skill_id,skill_lv,mflag);
#ifdef RENEWAL
- short totaldef = status_get_total_def(target);
+ short totaldef = iStatus->get_total_def(target);
#else
- short totaldef = tstatus->def2 + (short)status_get_def(target);
+ short totaldef = tstatus->def2 + (short)iStatus->get_def(target);
#endif
md.damage = 3 * wd.damage * (5 + skill_lv) / 5;
md.damage -= totaldef;
@@ -3921,10 +3921,10 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
struct map_session_data *sd, *tsd;
struct Damage wd;
- struct status_change *sc = status_get_sc(src);
- struct status_change *tsc = status_get_sc(target);
- struct status_data *sstatus = status_get_status_data(src);
- struct status_data *tstatus = status_get_status_data(target);
+ struct status_change *sc = iStatus->get_sc(src);
+ struct status_change *tsc = iStatus->get_sc(target);
+ struct status_data *sstatus = iStatus->get_status_data(src);
+ struct status_data *tstatus = iStatus->get_status_data(target);
struct {
unsigned hit : 1; //the attack Hit? (not a miss)
unsigned cri : 1; //Critical hit
@@ -4081,7 +4081,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
return wd;
}
- t_class = status_get_class(target);
+ t_class = iStatus->get_class(target);
s_ele = s_ele_ = skill->get_ele(skill_id, skill_lv);
if( !skill_id || s_ele == -1 )
{ //Take weapon's element
@@ -4198,7 +4198,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
//Therefore, we use the old value 3 on cases when an sd gets attacked by a mob
cri -= tstatus->luk*(!sd&&tsd?3:2);
#else
- cri -= status_get_lv(target) / 15 + 2 * status_get_luk(target);
+ cri -= iStatus->get_lv(target) / 15 + 2 * status_get_luk(target);
#endif
if( tsc && tsc->data[SC_SLEEP] ) {
@@ -4388,7 +4388,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.damage2 = 0;
#else
{
- short totaldef = status_get_total_def(target);
+ short totaldef = iStatus->get_total_def(target);
i = 0;
GET_NORMAL_ATTACK( (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0) );
if( sc && sc->data[SC_NJ_BUNSINJYUTSU] && (i=sc->data[SC_NJ_BUNSINJYUTSU]->val2) > 0 )
@@ -4405,12 +4405,12 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
break;
case NJ_SYURIKEN: // [malufett]
GET_NORMAL_ATTACK( (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|(sc && sc->data[SC_WEAPONPERFECT]?8:0) );
- wd.damage += battle->calc_masteryfix(src, target, skill_id, skill_lv, 4 * skill_lv + (sd ? sd->bonus.arrow_atk : 0), wd.div_, 0, flag.weapon) - status_get_total_def(target);
+ wd.damage += battle->calc_masteryfix(src, target, skill_id, skill_lv, 4 * skill_lv + (sd ? sd->bonus.arrow_atk : 0), wd.div_, 0, flag.weapon) - iStatus->get_total_def(target);
RE_SKILL_REDUCTION();
break;
case MO_EXTREMITYFIST: // [malufett]
{
- short totaldef = status_get_total_def(target);
+ short totaldef = iStatus->get_total_def(target);
GET_NORMAL_ATTACK( (sc && sc->data[SC_MAXIMIZEPOWER]?1:0)|8 );
if( wd.damage ){
wd.damage = (250 + 150 * skill_lv) + (10 * (status_get_sp(src)+1) * wd.damage / 100) + (8 * wd.damage);
@@ -4614,7 +4614,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
break;
case GS_MAGICALBULLET:
#ifndef RENEWAL
- ATK_ADD( status_get_matk(src, 2) );
+ ATK_ADD( iStatus->get_matk(src, 2) );
#else
ATK_ADD( battle->calc_magic_attack(src, target, skill_id, skill_lv, wflag).damage );
flag.tdef = 1;
@@ -4628,17 +4628,17 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
ATK_ADD( status_get_agi(src) * 2 + (sd?sd->status.job_level:0) * 4 );
break;
case SR_TIGERCANNON: // (Tiger Cannon skill level x 240) + (Target Base Level x 40)
- ATK_ADD( skill_lv * 240 + status_get_lv(target) * 40 );
+ ATK_ADD( skill_lv * 240 + iStatus->get_lv(target) * 40 );
if( sc && sc->data[SC_COMBOATTACK]
&& sc->data[SC_COMBOATTACK]->val1 == SR_FALLENEMPIRE ) // (Tiger Cannon skill level x 500) + (Target Base Level x 40)
- ATK_ADD( skill_lv * 500 + status_get_lv(target) * 40 );
+ ATK_ADD( skill_lv * 500 + iStatus->get_lv(target) * 40 );
break;
case SR_FALLENEMPIRE:// [(Target Size value + Skill Level - 1) x Caster STR] + [(Target current weight x Caster DEX / 120)]
ATK_ADD( ((tstatus->size+1)*2 + skill_lv - 1) * sstatus->str);
if( tsd && tsd->weight ){
ATK_ADD( (tsd->weight/10) * sstatus->dex / 120 );
}else{
- ATK_ADD( status_get_lv(target) * 50 ); //mobs
+ ATK_ADD( iStatus->get_lv(target) * 50 ); //mobs
}
break;
case KO_SETSUDAN:
@@ -4710,12 +4710,11 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( (i = battle->adjust_skill_damage(src->m,skill_id)) )
ATK_RATE(i);
-#ifdef RENEWAL
+ #ifdef RENEWAL
if( skill_id && (wd.damage+wd.damage2) ){
RE_SKILL_REDUCTION();
}
-#endif
-
+ #endif
if( sd ) {
if (skill_id && (i = pc->skillatk_bonus(sd, skill_id)))
ATK_ADDRATE(i);
@@ -4892,7 +4891,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
}
#endif
if( flag.infdef ) { //Plants receive 1 damage when hit
- short class_ = status_get_class(target);
+ short class_ = iStatus->get_class(target);
if( flag.hit || wd.damage > 0 )
wd.damage = wd.div_; // In some cases, right hand no need to have a weapon to increase damage
if( flag.lh && (flag.hit || wd.damage2 > 0) )
@@ -4974,7 +4973,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( !skill_id ) {
if( sc->data[SC_ENCHANTBLADE] ) { // it also works with bear hands..intended in official
//[( ( Skill Lv x 20 ) + 100 ) x ( casterBaseLevel / 150 )] + casterInt
- ATK_ADD(( sc->data[SC_ENCHANTBLADE]->val1 * 20 + 100 ) * status_get_lv(src) / 150 + status_get_int(src));
+ ATK_ADD(( sc->data[SC_ENCHANTBLADE]->val1 * 20 + 100 ) * iStatus->get_lv(src) / 150 + status_get_int(src));
}
}
status_change_end(src,SC_CAMOUFLAGE, INVALID_TIMER);
@@ -4990,9 +4989,9 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
case SR_GATEOFHELL:
ATK_ADD (sstatus->max_hp - status_get_hp(src));
if(sc && sc->data[SC_COMBOATTACK] && sc->data[SC_COMBOATTACK]->val1 == SR_FALLENEMPIRE){
- ATK_ADD ( (sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status_get_lv(src) );
+ ATK_ADD ( (sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * iStatus->get_lv(src) );
}else{
- ATK_ADD ( (sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * status_get_lv(src) );
+ ATK_ADD ( (sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * iStatus->get_lv(src) );
}
break;
}
@@ -5151,21 +5150,21 @@ int battle_calc_return_damage(struct block_list* bl, struct block_list *src, int
int max_reflect_damage;
sd = BL_CAST(BL_PC, bl);
- sc = status_get_sc(bl);
- max_reflect_damage = max(status_get_max_hp(bl), status_get_max_hp(bl) * status_get_lv(bl) / 100);
+ sc = iStatus->get_sc(bl);
+ max_reflect_damage = max(status_get_max_hp(bl), status_get_max_hp(bl) * iStatus->get_lv(bl) / 100);
#define NORMALIZE_RDAMAGE(d){ trdamage += rdamage = max(1, min(max_reflect_damage, d)); }
if( sc && sc->data[SC_CRESCENTELBOW] && !is_boss(src) && rnd()%100 < sc->data[SC_CRESCENTELBOW]->val2 ){
//ATK [{(Target HP / 100) x Skill Level} x Caster Base Level / 125] % + [Received damage x {1 + (Skill Level x 0.2)}]
- int ratio = (status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * status_get_lv(bl) / 125;
+ int ratio = (status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * iStatus->get_lv(bl) / 125;
if (ratio > 5000) ratio = 5000; // Maximum of 5000% ATK
rdamage = rdamage * ratio / 100 + (*dmg) * (10 + sc->data[SC_CRESCENTELBOW]->val1 * 20 / 10) / 10;
skill->blown(bl, src, skill->get_blewcount(SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1), unit_getdir(src), 0);
clif->skill_damage(bl, src, iTimer->gettick(), status_get_amotion(src), 0, rdamage,
1, SR_CRESCENTELBOW_AUTOSPELL, sc->data[SC_CRESCENTELBOW]->val1, 6); // This is how official does
clif->damage(src, bl, iTimer->gettick(), status_get_amotion(src)+1000, 0, rdamage/10, 1, 0, 0);
- status_damage(src, bl, status_damage(bl, src, rdamage, 0, 0, 1)/10, 0, 0, 1);
+ iStatus->damage(src, bl, iStatus->damage(bl, src, rdamage, 0, 0, 1)/10, 0, 0, 1);
status_change_end(bl, SC_CRESCENTELBOW, INVALID_TIMER);
return 0; // Just put here to minimize redundancy
}
@@ -5265,7 +5264,7 @@ void battle_drain(TBL_PC *sd, struct block_list *tbl, int rdamage, int ldamage,
if (!thp && !tsp) return;
- status_heal(&sd->bl, thp, tsp, battle_config.show_hp_sp_drain?3:1);
+ iStatus->heal(&sd->bl, thp, tsp, battle_config.show_hp_sp_drain?3:1);
if (rhp || rsp)
status_zap(tbl, rhp, rsp);
@@ -5321,11 +5320,11 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
- sstatus = status_get_status_data(src);
- tstatus = status_get_status_data(target);
+ sstatus = iStatus->get_status_data(src);
+ tstatus = iStatus->get_status_data(target);
- sc = status_get_sc(src);
- tsc = status_get_sc(target);
+ sc = iStatus->get_sc(src);
+ tsc = iStatus->get_sc(target);
if (sc && !sc->count) //Avoid sc checks when there's none to check for. [Skotlex]
sc = NULL;
@@ -5375,7 +5374,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
else if (sc->data[SC_CLOAKINGEXCEED] && !(sc->data[SC_CLOAKINGEXCEED]->val4 & 2))
status_change_end(src, SC_CLOAKINGEXCEED, INVALID_TIMER);
}
- if( tsc && tsc->data[SC_AUTOCOUNTER] && status_check_skilluse(target, src, KN_AUTOCOUNTER, 1) )
+ if( tsc && tsc->data[SC_AUTOCOUNTER] && iStatus->check_skilluse(target, src, KN_AUTOCOUNTER, 1) )
{
uint8 dir = iMap->calc_dir(target,src->x,src->y);
int t_dir = unit_getdir(target);
@@ -5464,7 +5463,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
if(tsc && tsc->data[SC_KAAHI] && tsc->data[SC_KAAHI]->val4 == INVALID_TIMER && tstatus->hp < tstatus->max_hp)
- tsc->data[SC_KAAHI]->val4 = iTimer->add_timer(tick + skill->get_time2(SL_KAAHI,tsc->data[SC_KAAHI]->val1), kaahi_heal_timer, target->id, SC_KAAHI); //Activate heal.
+ tsc->data[SC_KAAHI]->val4 = iTimer->add_timer(tick + skill->get_time2(SL_KAAHI,tsc->data[SC_KAAHI]->val1), iStatus->kaahi_heal_timer, target->id, SC_KAAHI); //Activate heal.
wd = battle->calc_attack(BF_WEAPON, src, target, 0, 0, flag);
@@ -5539,9 +5538,9 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
}
} else if( tsc->data[SC_WATER_SCREEN_OPTION] && tsc->data[SC_WATER_SCREEN_OPTION]->val1 ) {
struct block_list *e_bl = iMap->id2bl(tsc->data[SC_WATER_SCREEN_OPTION]->val1);
- if( e_bl && !status_isdead(e_bl) ) {
+ if( e_bl && !iStatus->isdead(e_bl) ) {
clif->damage(e_bl,e_bl,tick,wd.amotion,wd.dmotion,damage,wd.div_,wd.type,wd.damage2);
- status_damage(target,e_bl,damage,0,0,0);
+ iStatus->damage(target,e_bl,damage,0,0,0);
// Just show damage in target.
clif->damage(src, target, tick, wd.amotion, wd.dmotion, damage, wd.div_, wd.type, wd.damage2 );
iMap->freeblock_unlock();
@@ -5561,7 +5560,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
if (skill_lv < 1) skill_lv = 1;
sp = skill->get_sp(skill_id,skill_lv) * 2 / 3;
- if (status_charge(src, 0, sp)) {
+ if (iStatus->charge(src, 0, sp)) {
switch (skill->get_casttype(skill_id)) {
case CAST_GROUND:
skill->castend_pos2(src, target->x, target->y, skill_id, skill_lv, tick, flag);
@@ -5647,7 +5646,7 @@ enum damage_lv battle_weapon_attack(struct block_list* src, struct block_list* t
(rnd()%100 < tsc->data[SC_POISONREACT]->val3
|| sstatus->def_ele == ELE_POISON) &&
// check_distance_bl(src, target, tstatus->rhw.range+1) && Doesn't checks range! o.O;
- status_check_skilluse(target, src, TF_POISON, 0)
+ iStatus->check_skilluse(target, src, TF_POISON, 0)
) { //Poison React
struct status_change_entry *sce = tsc->data[SC_POISONREACT];
if (sstatus->def_ele == ELE_POISON) {
@@ -5765,7 +5764,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
switch( target->type ) { // Checks on actual target
case BL_PC: {
- struct status_change* sc = status_get_sc(src);
+ struct status_change* sc = iStatus->get_sc(src);
if (((TBL_PC*)target)->invincible_timer != INVALID_TIMER || pc_isinvisible((TBL_PC*)target))
return -1; //Cannot be targeted yet.
if( sc && sc->count ) {
@@ -5996,16 +5995,16 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
}
if( flag&(BCT_PARTY|BCT_ENEMY) )
{
- int s_party = status_get_party_id(s_bl);
- if( s_party && s_party == status_get_party_id(t_bl) && !(map[m].flag.pvp && map[m].flag.pvp_noparty) && !(map_flag_gvg(m) && map[m].flag.gvg_noparty) && (!map[m].flag.battleground || sbg_id == tbg_id) )
+ int s_party = iStatus->get_party_id(s_bl);
+ if( s_party && s_party == iStatus->get_party_id(t_bl) && !(map[m].flag.pvp && map[m].flag.pvp_noparty) && !(map_flag_gvg(m) && map[m].flag.gvg_noparty) && (!map[m].flag.battleground || sbg_id == tbg_id) )
state |= BCT_PARTY;
else
state |= BCT_ENEMY;
}
if( flag&(BCT_GUILD|BCT_ENEMY) )
{
- int s_guild = status_get_guild_id(s_bl);
- int t_guild = status_get_guild_id(t_bl);
+ int s_guild = iStatus->get_guild_id(s_bl);
+ int t_guild = iStatus->get_guild_id(t_bl);
if( !(map[m].flag.pvp && map[m].flag.pvp_noguild) && s_guild && t_guild && (s_guild == t_guild || (!(flag&BCT_SAMEGUILD) && guild->isallied(s_guild, t_guild))) && (!map[m].flag.battleground || sbg_id == tbg_id) )
state |= BCT_GUILD;
else
@@ -6031,14 +6030,14 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
{ //Non pvp/gvg, check party/guild settings.
if( flag&BCT_PARTY || state&BCT_ENEMY )
{
- int s_party = status_get_party_id(s_bl);
- if(s_party && s_party == status_get_party_id(t_bl))
+ int s_party = iStatus->get_party_id(s_bl);
+ if(s_party && s_party == iStatus->get_party_id(t_bl))
state |= BCT_PARTY;
}
if( flag&BCT_GUILD || state&BCT_ENEMY )
{
- int s_guild = status_get_guild_id(s_bl);
- int t_guild = status_get_guild_id(t_bl);
+ int s_guild = iStatus->get_guild_id(s_bl);
+ int t_guild = iStatus->get_guild_id(t_bl);
if(s_guild && t_guild && (s_guild == t_guild || (!(flag&BCT_SAMEGUILD) && guild->isallied(s_guild, t_guild))))
state |= BCT_GUILD;
}