|
@@ -716,7 +716,7 @@ int skill_calc_heal(struct block_list *src, struct block_list *target, uint16 sk
|
|
|
break;
|
|
|
default:
|
|
|
{
|
|
|
- struct status_data *status = status_get_status_data(src);
|
|
|
+ status_data* status = status_get_status_data(*src);
|
|
|
int min, max;
|
|
|
|
|
|
min = status_base_matk_min(src, status, status_get_lv(src));
|
|
@@ -1233,8 +1233,8 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl, uint
|
|
|
|
|
|
status_change* sc = status_get_sc( src );
|
|
|
status_change* tsc = status_get_sc( bl );
|
|
|
- status_data* sstatus = status_get_status_data( src );
|
|
|
- status_data* tstatus = status_get_status_data( bl );
|
|
|
+ status_data* sstatus = status_get_status_data(*src);
|
|
|
+ status_data* tstatus = status_get_status_data(*bl);
|
|
|
|
|
|
// Taekwon combos activate on traps, so we need to check them even for targets that don't have status
|
|
|
if (sd && skill_id == 0 && !(attack_type&BF_SKILL) && sc) {
|
|
@@ -2283,7 +2283,7 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl, uint
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if( sd && sd->ed && sc && !status_isdead(bl) && !skill_id ) {
|
|
|
+ if( sd && sd->ed && sc && !status_isdead(*bl) && !skill_id ) {
|
|
|
struct unit_data *ud = unit_bl2ud(src);
|
|
|
int skill;
|
|
|
|
|
@@ -2313,7 +2313,7 @@ int skill_additional_effect( struct block_list* src, struct block_list *bl, uint
|
|
|
}
|
|
|
|
|
|
// Autospell when attacking
|
|
|
- if( sd && !status_isdead(bl) && !sd->autospell.empty() )
|
|
|
+ if( sd && !status_isdead(*bl) && !sd->autospell.empty() )
|
|
|
{
|
|
|
for (const auto &it : sd->autospell) {
|
|
|
if (!(((it.battle_flag)&attack_type)&BF_WEAPONMASK &&
|
|
@@ -2587,7 +2587,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|
|
|
|
|
if (it.flag&ATF_TARGET && src != bl)
|
|
|
status_change_start(src, src, it.sc, rate, 7, 0, 0, 0, it.duration, SCSTART_NONE, 100);
|
|
|
- if (it.flag&ATF_SELF && !status_isdead(bl))
|
|
|
+ if (it.flag&ATF_SELF && !status_isdead(*bl))
|
|
|
status_change_start(src, bl, it.sc, rate, 7, 0, 0, 0, it.duration, SCSTART_NONE, 100);
|
|
|
}
|
|
|
}
|
|
@@ -2641,7 +2641,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|
|
sc_start(src, src, SC_MIRACLE, 100, 1, battle_config.sg_miracle_skill_duration);
|
|
|
}
|
|
|
|
|
|
- if(sd && skill_id && attack_type&BF_MAGIC && status_isdead(bl) &&
|
|
|
+ if(sd && skill_id && attack_type&BF_MAGIC && status_isdead(*bl) &&
|
|
|
!(skill_get_inf(skill_id)&(INF_GROUND_SKILL|INF_SELF_SKILL)) &&
|
|
|
(rate=pc_checkskill(sd,HW_SOULDRAIN))>0
|
|
|
){ //Soul Drain should only work on targetted spells [Skotlex]
|
|
@@ -2650,7 +2650,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|
|
status_heal(src, 0, status_get_lv(bl)*(95+15*rate)/100, 2);
|
|
|
}
|
|
|
|
|
|
- if( sd && status_isdead(bl) ) {
|
|
|
+ if( sd && status_isdead(*bl) ) {
|
|
|
int sp = 0, hp = 0;
|
|
|
if( (attack_type&(BF_WEAPON|BF_SHORT)) == (BF_WEAPON|BF_SHORT) ) {
|
|
|
sp += sd->bonus.sp_gain_value;
|
|
@@ -2679,7 +2679,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (dstsd && !status_isdead(bl) && !(skill_id && skill_get_nk(skill_id, NK_NODAMAGE))) {
|
|
|
+ if (dstsd && !status_isdead(*bl) && !(skill_id && skill_get_nk(skill_id, NK_NODAMAGE))) {
|
|
|
status_change *sc = status_get_sc(bl);
|
|
|
|
|
|
if (sc && sc->getSCE(SC_DORAM_SVSP) && attack_type&(BF_MAGIC|BF_LONG))
|
|
@@ -2687,7 +2687,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|
|
}
|
|
|
|
|
|
// Trigger counter-spells to retaliate against damage causing skills.
|
|
|
- if(dstsd && !status_isdead(bl) && !dstsd->autospell2.empty() &&
|
|
|
+ if(dstsd && !status_isdead(*bl) && !dstsd->autospell2.empty() &&
|
|
|
!(skill_id && skill_get_nk(skill_id, NK_NODAMAGE)))
|
|
|
{
|
|
|
for (const auto &it : dstsd->autospell2) {
|
|
@@ -2757,7 +2757,7 @@ int skill_counter_additional_effect (struct block_list* src, struct block_list *
|
|
|
}
|
|
|
|
|
|
// Check for player and pet autobonuses when attacked
|
|
|
- if (dstsd != nullptr && !status_isdead(bl) && !(skill_id && skill_get_nk(skill_id, NK_NODAMAGE))) {
|
|
|
+ if (dstsd != nullptr && !status_isdead(*bl) && !(skill_id && skill_get_nk(skill_id, NK_NODAMAGE))) {
|
|
|
// Player
|
|
|
if (!dstsd->autobonus2.empty()) {
|
|
|
for (auto &it : dstsd->autobonus2) {
|
|
@@ -2946,7 +2946,8 @@ bool skill_strip_equip(struct block_list *src, struct block_list *target, uint16
|
|
|
const int pos[6] = { EQP_WEAPON, EQP_SHIELD, EQP_ARMOR, EQP_HELM, EQP_ACC, EQP_SHADOW_GEAR };
|
|
|
const enum sc_type sc_atk[6] = { SC_STRIPWEAPON, SC_STRIPSHIELD, SC_STRIPARMOR, SC_STRIPHELM, SC__STRIPACCESSORY, SC_SHADOW_STRIP };
|
|
|
const enum sc_type sc_def[6] = { SC_CP_WEAPON, SC_CP_SHIELD, SC_CP_ARMOR, SC_CP_HELM, SC_NONE, SC_PROTECTSHADOWEQUIP };
|
|
|
- struct status_data *sstatus = status_get_status_data(src), *tstatus = status_get_status_data(target);
|
|
|
+ status_data* sstatus = status_get_status_data(*src);
|
|
|
+ status_data* tstatus = status_get_status_data(*target);
|
|
|
int rate, time, location, mod = 100;
|
|
|
|
|
|
switch (skill_id) { // Rate
|
|
@@ -3455,7 +3456,7 @@ void skill_attack_blow(struct block_list *src, struct block_list *dsrc, struct b
|
|
|
int8 dir = -1; // Default direction
|
|
|
//Only knockback if it's still alive, otherwise a "ghost" is left behind. [Skotlex]
|
|
|
//Reflected spells do not bounce back (src == dsrc since it only happens for direct skills)
|
|
|
- if (!blewcount || target == dsrc || status_isdead(target))
|
|
|
+ if (!blewcount || target == dsrc || status_isdead(*target))
|
|
|
return;
|
|
|
|
|
|
// Skill specific direction
|
|
@@ -3536,7 +3537,6 @@ void skill_attack_blow(struct block_list *src, struct block_list *dsrc, struct b
|
|
|
int64 skill_attack (int attack_type, struct block_list* src, struct block_list *dsrc, struct block_list *bl, uint16 skill_id, uint16 skill_lv, t_tick tick, int flag)
|
|
|
{
|
|
|
struct Damage dmg;
|
|
|
- struct status_data *sstatus, *tstatus;
|
|
|
status_change *sc, *tsc;
|
|
|
map_session_data *sd, *tsd;
|
|
|
int64 damage;
|
|
@@ -3569,8 +3569,8 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
|
|
|
sd = BL_CAST(BL_PC, src);
|
|
|
tsd = BL_CAST(BL_PC, bl);
|
|
|
|
|
|
- sstatus = status_get_status_data(src);
|
|
|
- tstatus = status_get_status_data(bl);
|
|
|
+ status_data* sstatus = status_get_status_data(*src);
|
|
|
+ status_data* tstatus = status_get_status_data(*bl);
|
|
|
sc= status_get_sc(src);
|
|
|
tsc= status_get_sc(bl);
|
|
|
if (tsc && !tsc->count)
|
|
@@ -3669,7 +3669,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
|
|
|
dmg.damage = battle_attr_fix(bl, bl, dmg.damage, s_ele, status_get_element(bl), status_get_element_level(bl));
|
|
|
|
|
|
if( tsc && tsc->getSCE(SC_ENERGYCOAT) ) {
|
|
|
- struct status_data *status = status_get_status_data(bl);
|
|
|
+ status_data* status = status_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
|
|
@@ -3990,7 +3990,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
|
|
|
#endif
|
|
|
|| skill_id == NPC_EVILLAND) && !shadow_flag )
|
|
|
battle_damage(src, bl, damage, dmg.dmotion, skill_lv, skill_id, dmg.dmg_lv, dmg.flag, false, tick, false);
|
|
|
- if( !status_isdead(bl) && additional_effects )
|
|
|
+ if( !status_isdead(*bl) && additional_effects )
|
|
|
skill_additional_effect(src,bl,skill_id,skill_lv,dmg.flag,dmg.dmg_lv,tick);
|
|
|
if( damage > 0 ) //Counter status effects [Skotlex]
|
|
|
skill_counter_additional_effect(src,bl,skill_id,skill_lv,dmg.flag,tick);
|
|
@@ -4003,7 +4003,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
|
|
|
// Delayed damage must be dealt after the knockback (it needs to know actual position of target)
|
|
|
if( dmg.amotion ) {
|
|
|
if( shadow_flag ) {
|
|
|
- if( !status_isdead(bl) && additional_effects )
|
|
|
+ if( !status_isdead(*bl) && additional_effects )
|
|
|
skill_additional_effect(src, bl, skill_id, skill_lv, dmg.flag, dmg.dmg_lv, tick);
|
|
|
if( dmg.flag > ATK_BLOCK )
|
|
|
skill_counter_additional_effect(src, bl, skill_id, skill_lv, dmg.flag, tick);
|
|
@@ -4011,7 +4011,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
|
|
|
battle_delay_damage(tick, dmg.amotion,src,bl,dmg.flag,skill_id,skill_lv,damage,dmg.dmg_lv,dmg.dmotion, additional_effects, false);
|
|
|
} else {
|
|
|
// Trigger monster skill condition for damage skills with no amotion.
|
|
|
- if (bl->type == BL_MOB && src != bl && !status_isdead(bl)) {
|
|
|
+ if (bl->type == BL_MOB && src != bl && !status_isdead(*bl)) {
|
|
|
if (damage > 0)
|
|
|
mobskill_event(BL_CAST(BL_MOB, bl), src, tick, dmg.flag);
|
|
|
if (skill_id > 0)
|
|
@@ -4020,7 +4020,7 @@ int64 skill_attack (int attack_type, struct block_list* src, struct block_list *
|
|
|
}
|
|
|
|
|
|
// Trigger monster skill condition for damage skills.
|
|
|
- if (bl->type == BL_MOB && src != bl && !status_isdead(bl)) {
|
|
|
+ if (bl->type == BL_MOB && src != bl && !status_isdead(*bl)) {
|
|
|
if (damage > 0)
|
|
|
mobskill_event(BL_CAST(BL_MOB, bl), src, tick, dmg.flag, damage);
|
|
|
if (skill_id > 0)
|
|
@@ -4289,7 +4289,7 @@ static int skill_check_unit_range2_sub (struct block_list *bl, va_list ap)
|
|
|
|
|
|
skill_id = va_arg(ap,int);
|
|
|
|
|
|
- if( status_isdead(bl) && skill_id != AL_WARP )
|
|
|
+ if( status_isdead(*bl) && skill_id != AL_WARP )
|
|
|
return 0;
|
|
|
|
|
|
#ifndef RENEWAL
|
|
@@ -4396,7 +4396,6 @@ void skill_consume_hpspap(block_list* bl, uint16 skill_id, int hp, int sp, int a
|
|
|
*------------------------------------------*/
|
|
|
static int skill_check_condition_mercenary(struct block_list *bl, uint16 skill_id, uint16 skill_lv, int type)
|
|
|
{
|
|
|
- struct status_data *status;
|
|
|
map_session_data *sd = nullptr;
|
|
|
int i, hp, sp, hp_rate, sp_rate, state, mhp;
|
|
|
t_itemid itemid[MAX_SKILL_ITEM_REQUIRE];
|
|
@@ -4414,7 +4413,7 @@ static int skill_check_condition_mercenary(struct block_list *bl, uint16 skill_i
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- status = status_get_status_data(bl);
|
|
|
+ status_data* status = status_get_status_data(*bl);
|
|
|
skill_lv = cap_value(skill_lv, 1, MAX_SKILL_LEVEL);
|
|
|
|
|
|
std::shared_ptr<s_skill_db> skill = skill_db.find(skill_id);
|
|
@@ -4557,7 +4556,7 @@ static TIMER_FUNC(skill_timerskill){
|
|
|
if(src->m != target->m)
|
|
|
break; // Different Maps
|
|
|
|
|
|
- if(status_isdead(src)) {
|
|
|
+ if(status_isdead(*src)) {
|
|
|
switch(skl->skill_id) {
|
|
|
case WL_CHAINLIGHTNING_ATK:
|
|
|
case WL_TETRAVORTEX_FIRE:
|
|
@@ -4576,7 +4575,7 @@ static TIMER_FUNC(skill_timerskill){
|
|
|
continue; // Caster is Dead
|
|
|
}
|
|
|
}
|
|
|
- if(status_isdead(target) && skl->skill_id != RG_INTIMIDATE && skl->skill_id != WZ_WATERBALL)
|
|
|
+ if(status_isdead(*target) && skl->skill_id != RG_INTIMIDATE && skl->skill_id != WZ_WATERBALL)
|
|
|
break;
|
|
|
|
|
|
switch(skl->skill_id) {
|
|
@@ -4587,7 +4586,7 @@ static TIMER_FUNC(skill_timerskill){
|
|
|
if (unit_warp(src,-1,-1,-1,CLR_TELEPORT) == 0) {
|
|
|
short x,y;
|
|
|
map_search_freecell(src, 0, &x, &y, 1, 1, 0);
|
|
|
- if (target != src && !status_isdead(target))
|
|
|
+ if (target != src && !status_isdead(*target))
|
|
|
unit_warp(target, -1, x, y, CLR_TELEPORT);
|
|
|
}
|
|
|
break;
|
|
@@ -4631,12 +4630,12 @@ static TIMER_FUNC(skill_timerskill){
|
|
|
[[fallthrough]];
|
|
|
case WZ_JUPITEL:
|
|
|
// Official behaviour is to hit as long as there is a line of sight, regardless of distance
|
|
|
- if (skl->type > 0 && !status_isdead(target) && path_search_long(nullptr,src->m,src->x,src->y,target->x,target->y,CELL_CHKWALL)) {
|
|
|
+ if (skl->type > 0 && !status_isdead(*target) && path_search_long(nullptr,src->m,src->x,src->y,target->x,target->y,CELL_CHKWALL)) {
|
|
|
// Apply canact delay here to prevent hacks (unlimited casting)
|
|
|
ud->canact_tick = i64max(tick + status_get_amotion(src), ud->canact_tick);
|
|
|
skill_attack(BF_MAGIC, src, src, target, skl->skill_id, skl->skill_lv, tick, skl->flag);
|
|
|
}
|
|
|
- if (unit && !status_isdead(target) && !status_isdead(src)) {
|
|
|
+ if (unit && !status_isdead(*target) && !status_isdead(*src)) {
|
|
|
skill_delunit(unit); // Consume unit for next waterball
|
|
|
//Timer will continue and walkdelay set until target is dead, even if there is currently no line of sight
|
|
|
unit_set_walkdelay(src, tick, TIMERSKILL_INTERVAL, 1);
|
|
@@ -4685,7 +4684,7 @@ static TIMER_FUNC(skill_timerskill){
|
|
|
clif_skill_nodamage(src,target,skl->skill_id,skl->skill_lv,1);
|
|
|
skill_attack(BF_MAGIC,src,src,target,skl->skill_id,skl->skill_lv,tick,skl->flag|SD_LEVEL|SD_ANIMATION);
|
|
|
if (skl->type >= 3) { // Final Hit
|
|
|
- if (!status_isdead(target)) { // Final Status Effect
|
|
|
+ if (!status_isdead(*target)) { // Final Status Effect
|
|
|
int effects[4] = { SC_BURNING, SC_FREEZING, SC_BLEEDING, SC_STUN },
|
|
|
applyeffects[4] = { 0, 0, 0, 0 },
|
|
|
i, j = 0, k = 0;
|
|
@@ -5010,7 +5009,7 @@ static int skill_tarotcard(struct block_list* src, struct block_list *target, ui
|
|
|
{
|
|
|
battle_fix_damage(src, target, 1000, 0, skill_id);
|
|
|
clif_damage(src, target, tick, 0, 0, 1000, 0, DMG_NORMAL, 0, false);
|
|
|
- if (!status_isdead(target))
|
|
|
+ if (!status_isdead(*target))
|
|
|
{
|
|
|
unsigned short where[] = { EQP_ARMOR, EQP_SHIELD, EQP_HELM };
|
|
|
skill_break_equip(src, target, where[rnd() % 3], 10000, BCT_ENEMY);
|
|
@@ -5105,7 +5104,6 @@ static int skill_tarotcard(struct block_list* src, struct block_list *target, ui
|
|
|
int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint16 skill_id, uint16 skill_lv, t_tick tick, int flag)
|
|
|
{
|
|
|
map_session_data *sd = nullptr;
|
|
|
- struct status_data *tstatus;
|
|
|
status_change *sc, *tsc;
|
|
|
|
|
|
if (skill_id > 0 && !skill_lv) return 0;
|
|
@@ -5121,7 +5119,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
|
|
|
|
|
|
sd = BL_CAST(BL_PC, src);
|
|
|
|
|
|
- if (status_isdead(bl))
|
|
|
+ if (status_isdead(*bl))
|
|
|
return 1;
|
|
|
|
|
|
if (skill_id && skill_id != AG_DEADLY_PROJECTION && skill_get_type(skill_id) == BF_MAGIC && status_isimmune(bl) == 100)
|
|
@@ -5140,7 +5138,7 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
|
|
|
if (tsc && !tsc->count)
|
|
|
tsc = nullptr;
|
|
|
|
|
|
- tstatus = status_get_status_data(bl);
|
|
|
+ status_data* tstatus = status_get_status_data(*bl);
|
|
|
|
|
|
map_freeblock_lock();
|
|
|
|
|
@@ -7276,7 +7274,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
struct mob_data *md, *dstmd;
|
|
|
struct homun_data *hd;
|
|
|
s_mercenary_data *mer;
|
|
|
- struct status_data *sstatus, *tstatus;
|
|
|
status_change *tsc;
|
|
|
struct status_change_entry *tsce;
|
|
|
|
|
@@ -7301,10 +7298,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
|
|
|
if(bl->prev == nullptr)
|
|
|
return 1;
|
|
|
- if(status_isdead(src))
|
|
|
+ if(status_isdead(*src))
|
|
|
return 1;
|
|
|
|
|
|
- if( src != bl && status_isdead(bl) ) {
|
|
|
+ if( src != bl && status_isdead(*bl) ) {
|
|
|
switch( skill_id ) { // Skills that may be cast on dead targets
|
|
|
case NPC_WIDESOULDRAIN:
|
|
|
case PR_REDEMPTIO:
|
|
@@ -7317,8 +7314,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- tstatus = status_get_status_data(bl);
|
|
|
- sstatus = status_get_status_data(src);
|
|
|
+ status_data* tstatus = status_get_status_data(*bl);
|
|
|
+ status_data* sstatus = status_get_status_data(*src);
|
|
|
|
|
|
//Check for undead skills that convert a no-damage skill into a damage one. [Skotlex]
|
|
|
switch (skill_id) {
|
|
@@ -7450,7 +7447,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
#endif
|
|
|
status_set_hp(src, 1, 0);
|
|
|
break;
|
|
|
- } else if (!(status_isdead(bl) && flag&1)) {
|
|
|
+ } else if (!(status_isdead(*bl) && flag&1)) {
|
|
|
//Invalid target, skip resurrection.
|
|
|
break;
|
|
|
}
|
|
@@ -7465,7 +7462,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
clif_skill_fail( *sd, skill_id );
|
|
|
break;
|
|
|
}
|
|
|
- if (!status_isdead(bl))
|
|
|
+ if (!status_isdead(*bl))
|
|
|
break;
|
|
|
{
|
|
|
int per = 0, sper = 0;
|
|
@@ -10075,10 +10072,10 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
}
|
|
|
|
|
|
// Partner must be on the same map and in same party
|
|
|
- if (p_sd && !status_isdead(&p_sd->bl) && p_sd->bl.m == sd->bl.m && p_sd->status.party_id == sd->status.party_id)
|
|
|
+ if (p_sd && !status_isdead(p_sd->bl) && p_sd->bl.m == sd->bl.m && p_sd->status.party_id == sd->status.party_id)
|
|
|
pc_setpos(p_sd, map_id2index(sd->bl.m), sd->bl.x, sd->bl.y, CLR_TELEPORT);
|
|
|
// Child must be on the same map and in same party as the parent casting
|
|
|
- if (c_sd && !status_isdead(&c_sd->bl) && c_sd->bl.m == sd->bl.m && c_sd->status.party_id == sd->status.party_id)
|
|
|
+ if (c_sd && !status_isdead(c_sd->bl) && c_sd->bl.m == sd->bl.m && c_sd->status.party_id == sd->status.party_id)
|
|
|
pc_setpos(c_sd, map_id2index(sd->bl.m), sd->bl.x, sd->bl.y, CLR_TELEPORT);
|
|
|
}
|
|
|
break;
|
|
@@ -10097,7 +10094,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
clif_skill_fail( *sd, skill_id );
|
|
|
break;
|
|
|
}
|
|
|
- if (status_isdead(bl)) {
|
|
|
+ if (status_isdead(*bl)) {
|
|
|
int per = 30, sper = 0;
|
|
|
|
|
|
if (battle_check_undead(tstatus->race, tstatus->def_ele))
|
|
@@ -11702,7 +11699,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|
|
|
|
|
case WM_DEADHILLHERE:
|
|
|
if( bl->type == BL_PC ) {
|
|
|
- if( !status_isdead(bl) )
|
|
|
+ if( !status_isdead(*bl) )
|
|
|
break;
|
|
|
|
|
|
tstatus->hp = max(tstatus->sp, 1);
|
|
@@ -13043,7 +13040,7 @@ static int8 skill_castend_id_check(struct block_list *src, struct block_list *ta
|
|
|
break;
|
|
|
case PR_TURNUNDEAD:
|
|
|
{
|
|
|
- struct status_data *tstatus = status_get_status_data(target);
|
|
|
+ status_data* tstatus = status_get_status_data(*target);
|
|
|
if (!battle_check_undead(tstatus->race, tstatus->def_ele))
|
|
|
return USESKILL_FAIL_MAX;
|
|
|
}
|
|
@@ -13216,7 +13213,7 @@ TIMER_FUNC(skill_castend_id){
|
|
|
if (!target || target->prev == nullptr)
|
|
|
break;
|
|
|
|
|
|
- if (src->m != target->m || status_isdead(src))
|
|
|
+ if (src->m != target->m || status_isdead(*src))
|
|
|
break;
|
|
|
|
|
|
//These should become skill_castend_pos
|
|
@@ -13567,7 +13564,7 @@ TIMER_FUNC(skill_castend_pos){
|
|
|
ud->skilltimer = INVALID_TIMER;
|
|
|
|
|
|
do {
|
|
|
- if( status_isdead(src) )
|
|
|
+ if( status_isdead(*src) )
|
|
|
break;
|
|
|
|
|
|
if (!skill_pos_maxcount_check(src, ud->skillx, ud->skilly, ud->skill_id, ud->skill_lv, src->type, true))
|
|
@@ -13705,7 +13702,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
|
|
|
|
|
|
nullpo_ret(src);
|
|
|
|
|
|
- if(status_isdead(src))
|
|
|
+ if(status_isdead(*src))
|
|
|
return 0;
|
|
|
|
|
|
sd = BL_CAST(BL_PC, src);
|
|
@@ -14112,7 +14109,7 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
|
|
|
// Final heal increased by HPlus.
|
|
|
// Is this the right place for this??? [Rytech]
|
|
|
// Can HPlus also affect SP recovery???
|
|
|
- status_data *sstatus = status_get_status_data(src);
|
|
|
+ status_data* sstatus = status_get_status_data(*src);
|
|
|
|
|
|
if (sstatus && sstatus->hplus > 0) {
|
|
|
potion_hp += potion_hp * sstatus->hplus / 100;
|
|
@@ -14477,10 +14474,9 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
|
|
|
}
|
|
|
break;
|
|
|
case KO_MUCHANAGE: {
|
|
|
- struct status_data *sstatus;
|
|
|
int rate = 0;
|
|
|
|
|
|
- sstatus = status_get_status_data(src);
|
|
|
+ status_data* sstatus = status_get_status_data(*src);
|
|
|
i = skill_get_splash(skill_id,skill_lv);
|
|
|
rate = (100 - (1000 / (sstatus->dex + sstatus->luk) * 5)) * (skill_lv / 2 + 5) / 10;
|
|
|
if( rate < 0 )
|
|
@@ -14997,7 +14993,6 @@ std::shared_ptr<s_skill_unit_group> skill_unitsetting(struct block_list *src, ui
|
|
|
t_itemid req_item = 0;
|
|
|
struct s_skill_unit_layout *layout;
|
|
|
map_session_data *sd;
|
|
|
- struct status_data *status;
|
|
|
status_change *sc;
|
|
|
int active_flag = 1;
|
|
|
int subunt = 0;
|
|
@@ -15016,7 +15011,7 @@ std::shared_ptr<s_skill_unit_group> skill_unitsetting(struct block_list *src, ui
|
|
|
layout = skill_get_unit_layout(skill_id,skill_lv,src,x,y);
|
|
|
|
|
|
sd = BL_CAST(BL_PC, src);
|
|
|
- status = status_get_status_data(src);
|
|
|
+ status_data* status = status_get_status_data(*src);
|
|
|
sc = status_get_sc(src); // for traps, firewall and fogwall - celest
|
|
|
hidden = (skill->unit_flag[UF_HIDDENTRAP] && (battle_config.traps_setting == 2 || (battle_config.traps_setting == 1 && map_flag_vs(src->m))));
|
|
|
|
|
@@ -15596,14 +15591,13 @@ static int skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, t_
|
|
|
struct block_list *ss; // Actual source that cast the skill unit
|
|
|
status_change *sc;
|
|
|
struct status_change_entry *sce;
|
|
|
- struct status_data *tstatus;
|
|
|
enum sc_type type;
|
|
|
uint16 skill_id;
|
|
|
|
|
|
nullpo_ret(unit);
|
|
|
nullpo_ret(bl);
|
|
|
|
|
|
- if(bl->prev == nullptr || !unit->alive || status_isdead(bl))
|
|
|
+ if(bl->prev == nullptr || !unit->alive || status_isdead(*bl))
|
|
|
return 0;
|
|
|
|
|
|
std::shared_ptr<s_skill_unit_group> sg = unit->group;
|
|
@@ -15613,7 +15607,7 @@ static int skill_unit_onplace(struct skill_unit *unit, struct block_list *bl, t_
|
|
|
|
|
|
nullpo_ret(ss = map_id2bl(sg->src_id));
|
|
|
|
|
|
- tstatus = status_get_status_data(bl);
|
|
|
+ status_data* tstatus = status_get_status_data(*bl);
|
|
|
|
|
|
if( (skill_get_type(sg->skill_id) == BF_MAGIC && ((battle_config.land_protector_behavior) ? map_getcell(bl->m, bl->x, bl->y, CELL_CHKLANDPROTECTOR) : map_getcell(unit->bl.m, unit->bl.x, unit->bl.y, CELL_CHKLANDPROTECTOR)) && sg->skill_id != SA_LANDPROTECTOR) ||
|
|
|
map_getcell(bl->m, bl->x, bl->y, CELL_CHKMAELSTROM) )
|
|
@@ -15941,7 +15935,6 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
|
|
|
{
|
|
|
struct block_list *ss;
|
|
|
TBL_PC* tsd;
|
|
|
- struct status_data *tstatus;
|
|
|
status_change *sc, *tsc;
|
|
|
struct skill_unit_group_tickset *ts;
|
|
|
enum sc_type type;
|
|
@@ -15951,7 +15944,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
|
|
|
nullpo_ret(unit);
|
|
|
nullpo_ret(bl);
|
|
|
|
|
|
- if (bl->prev == nullptr || !unit->alive || status_isdead(bl))
|
|
|
+ if (bl->prev == nullptr || !unit->alive || status_isdead(*bl))
|
|
|
return 0;
|
|
|
|
|
|
std::shared_ptr<s_skill_unit_group> sg = unit->group;
|
|
@@ -15964,7 +15957,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
|
|
|
tsd = BL_CAST(BL_PC, bl);
|
|
|
tsc = status_get_sc(bl);
|
|
|
sc = status_get_sc(ss);
|
|
|
- tstatus = status_get_status_data(bl);
|
|
|
+ status_data* tstatus = status_get_status_data(*bl);
|
|
|
type = skill_get_sc(sg->skill_id);
|
|
|
skill_id = sg->skill_id;
|
|
|
|
|
@@ -16061,7 +16054,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
|
|
|
break;
|
|
|
}
|
|
|
} while(sg->interval > 0 && x == bl->x && y == bl->y &&
|
|
|
- ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status_isdead(bl) );
|
|
|
+ ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status_isdead(*bl) );
|
|
|
}
|
|
|
break;
|
|
|
#ifndef RENEWAL // The storm gust counter was dropped in renewal
|
|
@@ -16114,7 +16107,7 @@ int skill_unit_onplace_timer(struct skill_unit *unit, struct block_list *bl, t_t
|
|
|
do
|
|
|
skill_attack(BF_MAGIC,ss,&unit->bl,bl,sg->skill_id,sg->skill_lv,tick+(t_tick)count*sg->interval,0);
|
|
|
while(sg->interval > 0 && --unit->val2 && x == bl->x && y == bl->y &&
|
|
|
- ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status_isdead(bl));
|
|
|
+ ++count < SKILLUNITTIMER_INTERVAL/sg->interval && !status_isdead(*bl));
|
|
|
|
|
|
if (unit->val2 <= 0)
|
|
|
skill_delunit(unit);
|
|
@@ -16761,7 +16754,7 @@ int skill_unit_onout(struct skill_unit *src, struct block_list *bl, t_tick tick)
|
|
|
type = skill_get_sc(sg->skill_id);
|
|
|
sce = (sc && type != SC_NONE)?sc->getSCE(type):nullptr;
|
|
|
|
|
|
- if (bl->prev == nullptr || (status_isdead(bl) && sg->unit_id != UNT_ANKLESNARE)) //Need to delete the trap if the source died.
|
|
|
+ if (bl->prev == nullptr || (status_isdead(*bl) && sg->unit_id != UNT_ANKLESNARE)) //Need to delete the trap if the source died.
|
|
|
return 0;
|
|
|
|
|
|
switch(sg->unit_id){
|
|
@@ -19935,7 +19928,7 @@ int skill_frostjoke_scream(struct block_list *bl, va_list ap)
|
|
|
return 0;
|
|
|
tick = va_arg(ap,t_tick);
|
|
|
|
|
|
- if (src == bl || status_isdead(bl))
|
|
|
+ if (src == bl || status_isdead(*bl))
|
|
|
return 0;
|
|
|
if (bl->type == BL_PC) {
|
|
|
map_session_data *sd = (map_session_data *)bl;
|
|
@@ -19981,7 +19974,7 @@ int skill_attack_area(struct block_list *bl, va_list ap)
|
|
|
int atk_type,skill_id,skill_lv,flag,type;
|
|
|
t_tick tick;
|
|
|
|
|
|
- if(status_isdead(bl))
|
|
|
+ if(status_isdead(*bl))
|
|
|
return 0;
|
|
|
|
|
|
atk_type = va_arg(ap,int);
|
|
@@ -20454,7 +20447,7 @@ static int skill_trap_splash(struct block_list *bl, va_list ap)
|
|
|
case UNT_MAIZETRAP:
|
|
|
case UNT_VERDURETRAP:
|
|
|
if( bl->type == BL_MOB && status_get_class_(bl) != CLASS_BOSS ) {
|
|
|
- struct status_data *status = status_get_status_data(bl);
|
|
|
+ status_data* status = status_get_status_data(*bl);
|
|
|
|
|
|
status->def_ele = skill_get_ele(sg->skill_id, sg->skill_lv);
|
|
|
status->ele_lv = (unsigned char)sg->skill_lv;
|
|
@@ -20611,7 +20604,7 @@ bool skill_check_shadowform(struct block_list *bl, int64 damage, int hit)
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- if( src && (status_isdead(src) || !battle_check_target(bl,src,BCT_ENEMY)) ) {
|
|
|
+ if( src && (status_isdead(*src) || !battle_check_target(bl,src,BCT_ENEMY)) ) {
|
|
|
if( src->type == BL_PC )
|
|
|
((TBL_PC*)src)->shadowform_id = 0;
|
|
|
status_change_end(bl, SC__SHADOWFORM);
|
|
@@ -20992,7 +20985,7 @@ int skill_delunitgroup_(std::shared_ptr<s_skill_unit_group> group, const char* f
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- if( !status_isdead(src) && ((TBL_PC*)src)->state.warping && !((TBL_PC*)src)->state.changemap ) {
|
|
|
+ if( !status_isdead(*src) && ((TBL_PC*)src)->state.warping && !((TBL_PC*)src)->state.changemap ) {
|
|
|
switch( group->skill_id ) {
|
|
|
case BA_DISSONANCE:
|
|
|
case BA_POEMBRAGI:
|
|
@@ -21877,11 +21870,10 @@ bool skill_produce_mix(map_session_data *sd, uint16 skill_id, t_itemid nameid, i
|
|
|
int slot[3];
|
|
|
int i, sc, ele, idx, equip, wlv, make_per = 0, flag = 0, skill_lv = 0;
|
|
|
int num = -1; // exclude the recipe
|
|
|
- struct status_data *status;
|
|
|
|
|
|
nullpo_ret(sd);
|
|
|
|
|
|
- status = status_get_status_data(&sd->bl);
|
|
|
+ status_data* status = status_get_status_data(sd->bl);
|
|
|
|
|
|
if( sd->skill_id_old == skill_id )
|
|
|
skill_lv = sd->skill_lv_old;
|