summaryrefslogtreecommitdiff
path: root/src/map/battle.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2013-09-27 00:55:25 +0200
committerHaru <haru@dotalux.com>2013-09-27 00:55:25 +0200
commit17bc1fab375f8ecc951fbba058a346b1460bf783 (patch)
tree7d51b5eda324985925b153b34441298f3e9bac21 /src/map/battle.c
parent3e5bca5a3df07320ff5c41edbb282df041c36f66 (diff)
downloadhercules-17bc1fab375f8ecc951fbba058a346b1460bf783.tar.gz
hercules-17bc1fab375f8ecc951fbba058a346b1460bf783.tar.bz2
hercules-17bc1fab375f8ecc951fbba058a346b1460bf783.tar.xz
hercules-17bc1fab375f8ecc951fbba058a346b1460bf783.zip
Renamed iStatus interface to status
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/battle.c')
-rw-r--r--src/map/battle.c287
1 files changed, 141 insertions, 146 deletions
diff --git a/src/map/battle.c b/src/map/battle.c
index 54716bd32..abbef8c77 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 (iStatus->isdead(bl))
+ if (status->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( iStatus->isdead(bl) )
+ if( status->isdead(bl) )
return 0;
if( battle->check_target(src, bl, BCT_ENEMY) > 0 ) {// Is Enemy!...
@@ -221,7 +221,7 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
struct block_list* src = NULL;
struct block_list* target = iMap->id2bl(dat->target_id);
- if( !target || iStatus->isdead(target) ) {/* nothing we can do */
+ if( !target || status->isdead(target) ) {/* nothing we can do */
if( dat->src_type == BL_PC && ( src = iMap->id2bl(dat->src_id) ) && --((TBL_PC*)src)->delayed_damage == 0 && ((TBL_PC*)src)->state.hold_recalc ) {
((TBL_PC*)src)->state.hold_recalc = 0;
status_calc_pc(((TBL_PC*)src),0);
@@ -238,7 +238,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 && !iStatus->isdead(target) && dat->additional_effects )
+ if( dat->attack_type && !status->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);
@@ -261,14 +261,13 @@ int battle_delay_damage_sub(int tid, unsigned int tick, int id, intptr_t data) {
return 0;
}
-int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects)
-{
+int battle_delay_damage (unsigned int tick, int amotion, struct block_list *src, struct block_list *target, int attack_type, uint16 skill_id, uint16 skill_lv, int64 damage, enum damage_lv dmg_lv, int ddelay, bool additional_effects) {
struct delay_damage *dat;
struct status_change *sc;
nullpo_ret(src);
nullpo_ret(target);
- sc = iStatus->get_sc(target);
+ sc = status->get_sc(target);
if( sc && sc->data[SC_DEVOTION] && damage > 0 && skill_id != PA_PRESSURE && skill_id != CR_REFLECTSHIELD )
damage = 0;
@@ -276,7 +275,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 && !iStatus->isdead(target) && additional_effects )
+ if( attack_type && !status->isdead(target) && additional_effects )
skill->additional_effect(src, target, skill_id, skill_lv, attack_type, dmg_lv, timer->gettick());
if( dmg_lv > ATK_BLOCK && attack_type )
skill->counter_additional_effect(src, target, skill_id, skill_lv, attack_type, timer->gettick());
@@ -328,8 +327,8 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
struct status_change *sc=NULL, *tsc=NULL;
int ratio;
- if (src) sc = iStatus->get_sc(src);
- if (target) tsc = iStatus->get_sc(target);
+ if (src) sc = status->get_sc(src);
+ if (target) tsc = status->get_sc(target);
if (atk_elem < 0 || atk_elem >= ELE_MAX)
atk_elem = rnd()%ELE_MAX;
@@ -356,7 +355,7 @@ int64 battle_attr_fix(struct block_list *src, struct block_list *target, int64 d
struct block_list *src;
if( !su || !su->alive || (sg = su->group) == NULL || !sg || sg->val3 == -1 ||
- (src = iMap->id2bl(sg->src_id)) == NULL || iStatus->isdead(src) )
+ (src = iMap->id2bl(sg->src_id)) == NULL || status->isdead(src) )
return 0;
if( sg->unit_id != UNT_FIREWALL ) {
@@ -435,10 +434,10 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u
if( !src || !bl )
return 0;
- sc = iStatus->get_sc(src);
+ sc = status->get_sc(src);
sd = BL_CAST(BL_PC, src);
- damage = iStatus->get_weapon_atk(src, watk, flag);
+ damage = status->get_weapon_atk(src, watk, flag);
if( sd ){
if( type == EQI_HAND_R )
@@ -503,9 +502,9 @@ int64 battle_calc_weapon_damage(struct block_list *src, struct block_list *bl, u
#ifdef RENEWAL
int64 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) {
int64 damage, batk;
- struct status_data *st = iStatus->get_status_data(src);
+ struct status_data *st = status->get_status_data(src);
- batk = battle->calc_elefix(src, bl, skill_id, skill_lv, iStatus->calc_batk(bl, iStatus->get_sc(src), st->batk, false), nk, n_ele, ELE_NEUTRAL, ELE_NEUTRAL, false, flag);
+ batk = battle->calc_elefix(src, bl, skill_id, skill_lv, status->calc_batk(bl, status->get_sc(src), st->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, &st->lhw, nk, n_ele, s_ele, s_ele_, status_get_size(bl), type, flag, flag2) / 4;
@@ -604,7 +603,7 @@ int64 battle_calc_sizefix(struct map_session_data *sd, int64 damage, int type, i
*------------------------------------------*/
int64 battle_addmastery(struct map_session_data *sd,struct block_list *target,int64 dmg,int type) {
int64 damage;
- struct status_data *st = iStatus->get_status_data(target);
+ struct status_data *st = status->get_status_data(target);
int weapon, skill_lv;
damage = dmg;
@@ -721,9 +720,9 @@ int64 battle_calc_masteryfix(struct block_list *src, struct block_list *target,
nullpo_ret(src);
nullpo_ret(target);
- sc = iStatus->get_sc(src);
+ sc = status->get_sc(src);
sd = BL_CAST(BL_PC, src);
- tstatus = iStatus->get_status_data(target);
+ tstatus = status->get_status_data(target);
if ( !sd )
return damage;
@@ -820,7 +819,7 @@ int64 battle_calc_masteryfix(struct block_list *src, struct block_list *target,
if ( sc && sc->data[SC_MIRACLE] )
i = 2; //Star anger
else
- ARR_FIND(0, MAX_PC_FEELHATE, i, iStatus->get_class(target) == sd->hate_mob[i]);
+ ARR_FIND(0, MAX_PC_FEELHATE, i, status->get_class(target) == sd->hate_mob[i]);
if ( i < MAX_PC_FEELHATE && (skill2_lv=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
@@ -846,7 +845,7 @@ int64 battle_calc_elefix(struct block_list *src, struct block_list *target, uint
nullpo_ret(src);
nullpo_ret(target);
- tstatus = iStatus->get_status_data(target);
+ tstatus = status->get_status_data(target);
if( (nk&NK_NO_ELEFIX) || n_ele )
return damage;
@@ -868,8 +867,8 @@ int64 battle_calc_elefix(struct block_list *src, struct block_list *target, uint
struct status_data *sstatus;
struct status_change *sc;
- sstatus = iStatus->get_status_data(src);
- sc = iStatus->get_sc(src);
+ sstatus = status->get_status_data(src);
+ sc = status->get_sc(src);
if( sc && sc->data[SC_SUB_WEAPONPROPERTY] ) { // Descriptions indicate this means adding a percent of a normal attack in another element. [Skotlex]
int64 temp = battle->calc_base_damage(sstatus, &sstatus->rhw, sc, tstatus->size, BL_CAST(BL_PC, src), (flag?2:0)) * sc->data[SC_SUB_WEAPONPROPERTY]->val2 / 100;
@@ -903,11 +902,11 @@ int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct block_
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
- 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);
+ 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);
switch(attack_type){
case BF_MAGIC:
@@ -973,7 +972,7 @@ int64 battle_calc_cardfix(int attack_type, struct block_list *src, struct block_
}
break;
case BF_WEAPON:
- t_race2 = iStatus->get_race2(target);
+ t_race2 = status->get_race2(target);
if( cflag&2 ){
if( sd && !(nk&NK_NO_CARDFIX_ATK) ){
short cardfix_ = 1000;
@@ -1206,10 +1205,10 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_
sd = BL_CAST(BL_PC, src);
tsd = BL_CAST(BL_PC, target);
- sstatus = iStatus->get_status_data(src);
- tstatus = iStatus->get_status_data(target);
- sc = iStatus->get_sc(src);
- tsc = iStatus->get_sc(target);
+ sstatus = status->get_status_data(src);
+ tstatus = status->get_status_data(target);
+ sc = status->get_sc(src);
+ tsc = status->get_sc(target);
switch(attack_type){
case BF_WEAPON:
@@ -1218,14 +1217,14 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_
* def1 = equip def
* def2 = status def
**/
- defType def1 = iStatus->get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
+ defType def1 = status->get_def(target); //Don't use tstatus->def1 due to skill timer reductions.
short def2 = tstatus->def2, vit_def;
#ifdef RENEWAL
- def1 = iStatus->calc_def2(target, tsc, def1, false); // equip def(RE)
- def2 = iStatus->calc_def(target, tsc, def2, false); // status def(RE)
+ def1 = status->calc_def2(target, tsc, def1, false); // equip def(RE)
+ def2 = status->calc_def(target, tsc, def2, false); // status def(RE)
#else
- def1 = iStatus->calc_def(target, tsc, def1, false); // equip def(RE)
- def2 = iStatus->calc_def2(target, tsc, def2, false); // status def(RE)
+ def1 = status->calc_def(target, tsc, def1, false); // equip def(RE)
+ def2 = status->calc_def2(target, tsc, def2, false); // status def(RE)
#endif
if( sd ){
@@ -1331,11 +1330,11 @@ int64 battle_calc_defense(int attack_type, struct block_list *src, struct block_
defType mdef = tstatus->mdef;
short mdef2= tstatus->mdef2;
#ifdef RENEWAL
- mdef2 = iStatus->calc_mdef(target, tsc, mdef2, false); // status mdef(RE)
- mdef = iStatus->calc_mdef2(target, tsc, mdef, false); // equip mde(RE)
+ mdef2 = status->calc_mdef(target, tsc, mdef2, false); // status mdef(RE)
+ mdef = status->calc_mdef2(target, tsc, mdef, false); // equip mde(RE)
#else
- mdef2 = iStatus->calc_mdef2(target, tsc, mdef2, false); // status mdef(RE)
- mdef = iStatus->calc_mdef(target, tsc, mdef, false); // equip mde(RE)
+ mdef2 = status->calc_mdef2(target, tsc, mdef2, false); // status mdef(RE)
+ mdef = status->calc_mdef(target, tsc, mdef, false); // equip mde(RE)
#endif
if( flag&1 )
mdef = 0;
@@ -1382,10 +1381,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 = iStatus->get_sc(src);
- tsc = iStatus->get_sc(target);
- st = iStatus->get_status_data(src);
- tst = iStatus->get_status_data(target);
+ sc = status->get_sc(src);
+ tsc = status->get_sc(target);
+ st = status->get_status_data(src);
+ tst = status->get_status_data(target);
switch(attack_type){
case BF_MAGIC:
@@ -1454,7 +1453,7 @@ int battle_calc_skillratio(int attack_type, struct block_list *src, struct block
skillratio += (tst->size!=SZ_BIG?5*skill_lv:-99); //Full damage is dealt on small/medium targets
break;
case SL_SMA:
- skillratio += -60 + iStatus->get_lv(src); //Base damage is 40% + lv%
+ skillratio += -60 + status->get_lv(src); //Base damage is 40% + lv%
break;
case NJ_KOUENKA:
skillratio -= 10;
@@ -1603,7 +1602,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 * (iStatus->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 * (status->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:
@@ -1617,7 +1616,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 = iStatus->get_lv(src) * 4 + sd->bonus.shieldmdef * 100 + status_get_int(src) * 2;
+ skillratio = status->get_lv(src) * 4 + sd->bonus.shieldmdef * 100 + status_get_int(src) * 2;
} else
skillratio += 1900; //2000%
break;
@@ -1994,10 +1993,9 @@ 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 * iStatus->get_lv(src) / 3; //Tumble bonus
- if (flag)
- {
- skillratio += 10 * iStatus->get_lv(src) / 3; //Running bonus (TODO: What is the real bonus?)
+ skillratio += 10 * status->get_lv(src) / 3; //Tumble bonus
+ if (flag) {
+ skillratio += 10 * status->get_lv(src) / 3; //Running bonus (TODO: What is the real bonus?)
if( sc && sc->data[SC_STRUP] ) // Spurt bonus
skillratio *= 2;
}
@@ -2082,7 +2080,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 + (iStatus->get_lv(src)-100) / 2) / 100;
+ skillratio = skillratio * (100 + (status->get_lv(src)-100) / 2) / 100;
break;
case RK_HUNDREDSPEAR:
skillratio += 500 + (80 * skill_lv);
@@ -2091,7 +2089,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 + (iStatus->get_lv(src)-100) / 2) / 100 + 50 * pc->checkskill(sd,LK_SPIRALPIERCE);
+ skillratio = skillratio * (100 + (status->get_lv(src)-100) / 2) / 100 + 50 * pc->checkskill(sd,LK_SPIRALPIERCE);
}
break;
case RK_WINDCUTTER:
@@ -2106,7 +2104,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 + (iStatus->get_lv(src)-100)) / 100;
+ skillratio = (skillratio - 100) * (100 + (status->get_lv(src)-100)) / 100;
if( st->rhw.ele == ELE_FIRE )
skillratio += 100 * skill_lv;
break;
@@ -2268,7 +2266,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 + iStatus->get_lv(src) * 4 + status_get_vit(src) * 2;
+ skillratio += -100 + status->get_lv(src) * 4 + status_get_vit(src) * 2;
if( shield_data )
skillratio += shield_data->def * 10;
} else
@@ -2349,7 +2347,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 + iStatus->get_lv(target) * 5 * (iStatus->get_lv(src) / 100) ;
+ skillratio += -100 + 150 * skill_lv + status->get_lv(target) * 5 * (status->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] %
@@ -2357,7 +2355,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 + iStatus->get_lv(src) + status_get_dex(src);
+ skillratio += -100 + status->get_lv(src) + status_get_dex(src);
RE_LVL_DMOD(100);
break;
case SR_GATEOFHELL:
@@ -2476,7 +2474,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 += iStatus->get_lv(src) * skill_lv;
+ skillratio += status->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;
@@ -2569,7 +2567,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if(!damage) return 0;
}
- sc = iStatus->get_sc(bl);
+ sc = status->get_sc(bl);
if( sc && sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
return 1;
@@ -2590,7 +2588,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
skill_id == MG_SOULSTRIKE ||
skill_id == WL_SOULEXPANSION ||
(skill_id && skill->get_ele(skill_id, skill_lv) == ELE_GHOST) ||
- (!skill_id && (iStatus->get_status_data(src))->rhw.ele == ELE_GHOST)
+ (!skill_id && (status->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.
@@ -2731,7 +2729,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
&& flag&BF_WEAPON && !(skill->get_nk(skill_id)&NK_NO_CARDFIX_ATK)) {
skill->additional_effect (src, bl, skill_id, skill_lv, flag, ATK_BLOCK, timer->gettick() );
- if( !iStatus->isdead(src) )
+ if( !status->isdead(src) )
skill->counter_additional_effect( src, bl, skill_id, skill_lv, flag, timer->gettick() );
if (sce) {
clif->specialeffect(bl, 462, AREA);
@@ -2853,11 +2851,11 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if(sc->data[SC_ENERGYCOAT] && (flag&BF_WEAPON && skill_id != WS_CARTTERMINATION))
#endif
{
- struct status_data *sstatus = iStatus->get_status_data(bl);
+ struct status_data *sstatus = status->get_status_data(bl);
int per = 100*sstatus->sp / sstatus->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 (!iStatus->charge(bl, 0, (10+5*per)*sstatus->max_sp/1000))
+ if (!status->charge(bl, 0, (10+5*per)*sstatus->max_sp/1000))
status_change_end(bl, SC_ENERGYCOAT, INVALID_TIMER);
//Reduction: 6% + 6% every 20%
damage -= damage * (6 * (1+per)) / 100;
@@ -2940,7 +2938,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
//(since battle_drain is strictly for players currently)
if ((sce=sc->data[SC_HAMI_BLOODLUST]) && flag&BF_WEAPON && damage > 0 &&
rnd()%100 < sce->val3)
- iStatus->heal(src, damage*sce->val4/100, 0, 3);
+ status->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);
@@ -2950,13 +2948,13 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
}
if( sc->data[SC__DEADLYINFECT] && damage > 0 && rnd()%100 < 65 + 5 * sc->data[SC__DEADLYINFECT]->val1 )
- iStatus->change_spread(bl, src); // Deadly infect attacked side
+ status->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( 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.
+ } 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.
status_change_end(bl, SC__SHADOWFORM, INVALID_TIMER);
if( s_bl->type == BL_PC )
((TBL_PC*)s_bl)->shadowform_id = 0;
@@ -2966,7 +2964,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
if( s_bl->type == BL_PC )
((TBL_PC*)s_bl)->shadowform_id = 0;
} else {
- iStatus->damage(bl, s_bl, damage, 0, clif->damage(s_bl, s_bl, timer->gettick(), 500, 500, damage, -1, 0, 0), 0);
+ status->damage(bl, s_bl, damage, 0, clif->damage(s_bl, s_bl, timer->gettick(), 500, 500, damage, -1, 0, 0), 0);
return ATK_NONE;
}
}
@@ -2975,7 +2973,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
}
//SC effects from caster side.
- sc = iStatus->get_sc(src);
+ sc = status->get_sc(src);
if (sc && sc->count) {
if( sc->data[SC_INVINCIBLE] && !sc->data[SC_INVINCIBLEOFF] )
@@ -3004,7 +3002,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
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 )
- iStatus->change_spread(src, bl);
+ status->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);
@@ -3046,7 +3044,7 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
damage = div_;
}
- if( bl->type == BL_MOB && !iStatus->isdead(bl) && src != bl) {
+ if( bl->type == BL_MOB && !status->isdead(bl) && src != bl) {
if (damage > 0 )
mob->skill_event((TBL_MOB*)bl,src,timer->gettick(),flag);
if (skill_id)
@@ -3059,12 +3057,12 @@ int64 battle_calc_damage(struct block_list *src,struct block_list *bl,struct Dam
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 = iStatus->get_status_data(src)) ) {
+ else if( (sstatus = status->get_status_data(src)) ) {
element = sstatus->rhw.ele;
}
}
else if( element == -2 ) //Use enchantment's element
- element = status_get_attack_sc_element(src,iStatus->get_sc(src));
+ element = status_get_attack_sc_element(src,status->get_sc(src));
else if( element == -3 ) //Use random element
element = rnd()%ELE_MAX;
if( element == ELE_FIRE || element == ELE_WATER )
@@ -3096,10 +3094,9 @@ int64 battle_calc_bg_damage(struct block_list *src, struct block_list *bl, int64
/*==========================================
* Calculates GVG related damage adjustments.
*------------------------------------------*/
-int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 damage,int div_,uint16 skill_id,uint16 skill_lv,int flag)
-{
+int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64 damage,int div_,uint16 skill_id,uint16 skill_lv,int flag) {
struct mob_data* md = BL_CAST(BL_MOB, bl);
- int class_ = iStatus->get_class(bl);
+ int class_ = status->get_class(bl);
if (!damage) //No reductions to make.
return 0;
@@ -3118,7 +3115,7 @@ int64 battle_calc_gvg_damage(struct block_list *src,struct block_list *bl,int64
}
}
if(src->type != BL_MOB) {
- struct guild *g = src->type == BL_PC ? ((TBL_PC *)src)->guild : guild->search(iStatus->get_guild_id(src));
+ struct guild *g = src->type == BL_PC ? ((TBL_PC *)src)->guild : guild->search(status->get_guild_id(src));
if (class_ == MOBID_EMPERIUM && (!g || guild->checkskill(g,GD_APPROVAL) <= 0 ))
return 0;
@@ -3233,8 +3230,8 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
TBL_PC *sd;
struct status_change *sc;
struct Damage ad;
- struct status_data *sstatus = iStatus->get_status_data(src);
- struct status_data *tstatus = iStatus->get_status_data(target);
+ struct status_data *sstatus = status->get_status_data(src);
+ struct status_data *tstatus = status->get_status_data(target);
struct {
unsigned imdef : 1;
unsigned infdef : 1;
@@ -3261,7 +3258,7 @@ struct Damage battle_calc_magic_attack(struct block_list *src,struct block_list
sd = BL_CAST(BL_PC, src);
- sc = iStatus->get_sc(src);
+ sc = status->get_sc(src);
//Initialize variables that will be used afterwards
s_ele = skill->get_ele(skill_id, skill_lv);
@@ -3273,7 +3270,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,iStatus->get_sc(src));
+ s_ele = status_get_attack_sc_element(src,status->get_sc(src));
else if( s_ele == -3 ) //Use random element
s_ele = rnd()%ELE_MAX;
@@ -3360,16 +3357,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_ + iStatus->get_lv(src)
+ i = 20*skill_lv + sstatus->luk + sstatus->int_ + status->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(iStatus->get_matk(src, 2));
+ MATK_ADD(status->get_matk(src, 2));
#else
- ad.damage = iStatus->get_lv(src) + sstatus->int_ + skill_lv * 10;
+ ad.damage = status->get_lv(src) + sstatus->int_ + skill_lv * 10;
#endif
}
break;
@@ -3381,10 +3378,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 * iStatus->get_lv(src)) + (1.5 * sstatus->int_));
+ ad.damage = (int)((15 * status->get_lv(src)) + (1.5 * sstatus->int_));
break;
default: {
- MATK_ADD( iStatus->get_matk(src, 2) );
+ MATK_ADD( status->get_matk(src, 2) );
if (nk&NK_SPLASHSPLIT) { // Divide MATK in case of multiple targets skill
if(mflag>0)
@@ -3543,11 +3540,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 = iStatus->get_status_data(src);
- struct status_data *tstatus = iStatus->get_status_data(target);
- struct status_change *tsc = iStatus->get_sc(target);
+ 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);
#ifdef RENEWAL
- struct status_change *sc = iStatus->get_sc(src);
+ struct status_change *sc = status->get_sc(src);
#endif
memset(&md,0,sizeof(md));
@@ -3591,7 +3588,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+iStatus->get_lv(src)/100) * (1+sstatus->int_/35);
+ md.damage = skill_lv * sstatus->dex * (3+status->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;
@@ -3653,8 +3650,8 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
#ifdef RENEWAL
{// [malufett]
int64 matk=0, atk;
- short tdef = iStatus->get_total_def(target);
- short tmdef = iStatus->get_total_mdef(target);
+ short tdef = status->get_total_def(target);
+ short tmdef = status->get_total_mdef(target);
int targetVit = min(120, status_get_vit(target));
short totaldef = (tmdef + tdef - ((uint64)(tmdef + tdef) >> 32)) >> 1;
@@ -3712,7 +3709,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:iStatus->get_lv(src);
+ md.damage = sd?sd->status.job_level:status->get_lv(src);
break;
case HVAN_EXPLOSION: //[orn]
md.damage = sstatus->max_hp * (50 + 50 * skill_lv) / 100;
@@ -3725,7 +3722,7 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
#else
int ratio = 300 + 50 * skill_lv;
int64 matk = battle->calc_magic_attack(src, target, skill_id, skill_lv, mflag).damage;
- short totaldef = iStatus->get_total_def(target) + iStatus->get_total_mdef(target);
+ short totaldef = status->get_total_def(target) + status->get_total_mdef(target);
int64 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] )
@@ -3774,9 +3771,9 @@ struct Damage battle_calc_misc_attack(struct block_list *src,struct block_list *
case NC_SELFDESTRUCTION:
{
#ifdef RENEWAL
- short totaldef = iStatus->get_total_def(target);
+ short totaldef = status->get_total_def(target);
#else
- short totaldef = tstatus->def2 + (short)iStatus->get_def(target);
+ short totaldef = tstatus->def2 + (short)status->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);
@@ -3791,15 +3788,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 * 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)) );
+ 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)) );
break;
case KO_HAPPOKUNAI:
{
struct Damage wd = battle->calc_weapon_attack(src,target,skill_id,skill_lv,mflag);
#ifdef RENEWAL
- short totaldef = iStatus->get_total_def(target);
+ short totaldef = status->get_total_def(target);
#else
- short totaldef = tstatus->def2 + (short)iStatus->get_def(target);
+ short totaldef = tstatus->def2 + (short)status->get_def(target);
#endif
md.damage = 3 * wd.damage * (5 + skill_lv) / 5;
md.damage -= totaldef;
@@ -3954,10 +3951,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 = 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 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 {
unsigned hit : 1; //the attack Hit? (not a miss)
unsigned cri : 1; //Critical hit
@@ -4230,7 +4227,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 -= iStatus->get_lv(target) / 15 + 2 * status_get_luk(target);
+ cri -= status->get_lv(target) / 15 + 2 * status_get_luk(target);
#endif
if( tsc && tsc->data[SC_SLEEP] ) {
@@ -4420,7 +4417,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
wd.damage2 = 0;
#else
{
- short totaldef = iStatus->get_total_def(target);
+ short totaldef = status->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 )
@@ -4437,12 +4434,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) - iStatus->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) - status->get_total_def(target);
RE_SKILL_REDUCTION();
break;
case MO_EXTREMITYFIST: // [malufett]
{
- short totaldef = iStatus->get_total_def(target);
+ short totaldef = status->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);
@@ -4631,7 +4628,7 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
break;
case GS_MAGICALBULLET:
#ifndef RENEWAL
- ATK_ADD( iStatus->get_matk(src, 2) );
+ ATK_ADD( status->get_matk(src, 2) );
#else
ATK_ADD( battle->calc_magic_attack(src, target, skill_id, skill_lv, wflag).damage );
flag.tdef = 1;
@@ -4645,17 +4642,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 + iStatus->get_lv(target) * 40 );
+ ATK_ADD( skill_lv * 240 + status->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 + iStatus->get_lv(target) * 40 );
+ ATK_ADD( skill_lv * 500 + status->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( iStatus->get_lv(target) * 50 ); //mobs
+ ATK_ADD( status->get_lv(target) * 50 ); //mobs
}
break;
case KO_SETSUDAN:
@@ -4821,8 +4818,8 @@ struct Damage battle_calc_weapon_attack(struct block_list *src,struct block_list
if( !skill_id ) {
if( sc->data[SC_ENCHANTBLADE] ) {
//[( ( Skill Lv x 20 ) + 100 ) x ( casterBaseLevel / 150 )] + casterInt
- i = ( sc->data[SC_ENCHANTBLADE]->val1 * 20 + 100 ) * iStatus->get_lv(src) / 150 + status_get_int(src);
- i = i - iStatus->get_total_mdef(target) + iStatus->get_matk(src, 2);
+ i = ( sc->data[SC_ENCHANTBLADE]->val1 * 20 + 100 ) * status->get_lv(src) / 150 + status_get_int(src);
+ i = i - status->get_total_mdef(target) + status->get_matk(src, 2);
if( i )
ATK_ADD(i);
}
@@ -4924,7 +4921,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_ = iStatus->get_class(target);
+ short class_ = status->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) )
@@ -5016,9 +5013,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 * iStatus->get_lv(src) );
+ ATK_ADD ( (sstatus->max_sp * (1 + skill_lv * 2 / 10)) + 40 * status->get_lv(src) );
}else{
- ATK_ADD ( (sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * iStatus->get_lv(src) );
+ ATK_ADD ( (sstatus->sp * (1 + skill_lv * 2 / 10)) + 10 * status->get_lv(src) );
}
break;
}
@@ -5173,10 +5170,10 @@ int64 battle_calc_return_damage(struct block_list* bl, struct block_list *src, i
#ifdef RENEWAL
int max_reflect_damage;
- max_reflect_damage = max(status_get_max_hp(bl), status_get_max_hp(bl) * iStatus->get_lv(bl) / 100);
+ max_reflect_damage = max(status_get_max_hp(bl), status_get_max_hp(bl) * status->get_lv(bl) / 100);
#endif
sd = BL_CAST(BL_PC, bl);
- sc = iStatus->get_sc(bl);
+ sc = status->get_sc(bl);
#ifdef RENEWAL
#define NORMALIZE_RDAMAGE(d){ trdamage += rdamage = max(1, min(max_reflect_damage, d)); }
@@ -5186,14 +5183,14 @@ int64 battle_calc_return_damage(struct block_list* bl, struct block_list *src, i
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 * iStatus->get_lv(bl) / 125;
+ int ratio = (status_get_hp(src) / 100) * sc->data[SC_CRESCENTELBOW]->val1 * status->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, timer->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, timer->gettick(), status_get_amotion(src)+1000, 0, rdamage/10, 1, 0, 0);
- iStatus->damage(src, bl, iStatus->damage(bl, src, rdamage, 0, 0, 1)/10, 0, 0, 1);
+ status->damage(src, bl, status->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
}
@@ -5294,7 +5291,7 @@ void battle_drain(TBL_PC *sd, struct block_list *tbl, int64 rdamage, int64 ldama
if (!thp && !tsp) return;
- iStatus->heal(&sd->bl, thp, tsp, battle_config.show_hp_sp_drain?3:1);
+ status->heal(&sd->bl, thp, tsp, battle_config.show_hp_sp_drain?3:1);
if (rhp || rsp)
status_zap(tbl, rhp, rsp);
@@ -5350,11 +5347,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 = iStatus->get_status_data(src);
- tstatus = iStatus->get_status_data(target);
+ sstatus = status->get_status_data(src);
+ tstatus = status->get_status_data(target);
- sc = iStatus->get_sc(src);
- tsc = iStatus->get_sc(target);
+ sc = status->get_sc(src);
+ tsc = status->get_sc(target);
if (sc && !sc->count) //Avoid sc checks when there's none to check for. [Skotlex]
sc = NULL;
@@ -5404,7 +5401,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] && iStatus->check_skilluse(target, src, KN_AUTOCOUNTER, 1) )
+ if( tsc && tsc->data[SC_AUTOCOUNTER] && status->check_skilluse(target, src, KN_AUTOCOUNTER, 1) )
{
uint8 dir = iMap->calc_dir(target,src->x,src->y);
int t_dir = unit->getdir(target);
@@ -5493,7 +5490,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 = timer->add(tick + skill->get_time2(SL_KAAHI,tsc->data[SC_KAAHI]->val1), iStatus->kaahi_heal_timer, target->id, SC_KAAHI); //Activate heal.
+ tsc->data[SC_KAAHI]->val4 = timer->add(tick + skill->get_time2(SL_KAAHI,tsc->data[SC_KAAHI]->val1), status->kaahi_heal_timer, target->id, SC_KAAHI); //Activate heal.
wd = battle->calc_attack(BF_WEAPON, src, target, 0, 0, flag);
@@ -5566,9 +5563,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 && !iStatus->isdead(e_bl) ) {
+ if( e_bl && !status->isdead(e_bl) ) {
clif->damage(e_bl,e_bl,tick,wd.amotion,wd.dmotion,damage,wd.div_,wd.type,wd.damage2);
- iStatus->damage(target,e_bl,damage,0,0,0);
+ status->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();
@@ -5588,7 +5585,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 (iStatus->charge(src, 0, sp)) {
+ if (status->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);
@@ -5674,7 +5671,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;
- iStatus->check_skilluse(target, src, TF_POISON, 0)
+ status->check_skilluse(target, src, TF_POISON, 0)
) { //Poison React
struct status_change_entry *sce = tsc->data[SC_POISONREACT];
if (sstatus->def_ele == ELE_POISON) {
@@ -5792,7 +5789,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 = iStatus->get_sc(src);
+ struct status_change* sc = status->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 ) {
@@ -6018,8 +6015,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
tbg_id = bg->team_get_id(t_bl);
}
if( flag&(BCT_PARTY|BCT_ENEMY) ) {
- int s_party = iStatus->get_party_id(s_bl);
- if( s_party && s_party == iStatus->get_party_id(t_bl)
+ int s_party = status->get_party_id(s_bl);
+ if( s_party && s_party == status->get_party_id(t_bl)
&& !(maplist[m].flag.pvp && maplist[m].flag.pvp_noparty)
&& !(map_flag_gvg(m) && maplist[m].flag.gvg_noparty)
&& (!maplist[m].flag.battleground || sbg_id == tbg_id) )
@@ -6028,8 +6025,8 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
state |= BCT_ENEMY;
}
if( flag&(BCT_GUILD|BCT_ENEMY) ) {
- int s_guild = iStatus->get_guild_id(s_bl);
- int t_guild = iStatus->get_guild_id(t_bl);
+ int s_guild = status->get_guild_id(s_bl);
+ int t_guild = status->get_guild_id(t_bl);
if( !(maplist[m].flag.pvp && maplist[m].flag.pvp_noguild)
&& s_guild && t_guild
&& (s_guild == t_guild || (!(flag&BCT_SAMEGUILD) && guild->isallied(s_guild, t_guild)))
@@ -6048,7 +6045,7 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
(sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
(int)sd->status.base_level < battle_config.pk_min_level ||
- (int)sd2->status.base_level < battle_config.pk_min_level ||
+ (int)sd2->status.base_level < battle_config.pk_min_level ||
(battle_config.pk_level_range && abs((int)sd->status.base_level - (int)sd2->status.base_level) > battle_config.pk_level_range)
)
state &= ~BCT_ENEMY;
@@ -6056,16 +6053,14 @@ int battle_check_target( struct block_list *src, struct block_list *target,int f
}//end map_flag_vs chk rivality
else
{ //Non pvp/gvg, check party/guild settings.
- if( flag&BCT_PARTY || state&BCT_ENEMY )
- {
- int s_party = iStatus->get_party_id(s_bl);
- if(s_party && s_party == iStatus->get_party_id(t_bl))
+ 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))
state |= BCT_PARTY;
}
- if( flag&BCT_GUILD || state&BCT_ENEMY )
- {
- int s_guild = iStatus->get_guild_id(s_bl);
- int t_guild = iStatus->get_guild_id(t_bl);
+ 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);
if(s_guild && t_guild && (s_guild == t_guild || (!(flag&BCT_SAMEGUILD) && guild->isallied(s_guild, t_guild))))
state |= BCT_GUILD;
}