Fixed SC_KEEPING and SC_BARRIER exploit after classchange (#4486)
* Fixed monsters affected by SC_KEEPING and SC_BARRIER not moving or attacking after classchange * Thanks to @aleos89
This commit is contained in:
parent
d56553775a
commit
28c70cde3d
@ -3243,6 +3243,7 @@ int mob_class_change (struct mob_data *md, int mob_id)
|
|||||||
memcpy(md->name,md->db->jname,NAME_LENGTH);
|
memcpy(md->name,md->db->jname,NAME_LENGTH);
|
||||||
|
|
||||||
status_change_end(&md->bl,SC_KEEPING,INVALID_TIMER); // End before calling status_calc_mob().
|
status_change_end(&md->bl,SC_KEEPING,INVALID_TIMER); // End before calling status_calc_mob().
|
||||||
|
status_change_end(&md->bl,SC_BARRIER,INVALID_TIMER);
|
||||||
mob_stop_attack(md);
|
mob_stop_attack(md);
|
||||||
mob_stop_walking(md, 0);
|
mob_stop_walking(md, 0);
|
||||||
unit_skillcastcancel(&md->bl, 0);
|
unit_skillcastcancel(&md->bl, 0);
|
||||||
|
@ -6752,6 +6752,8 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|||||||
case NPC_DEFENDER:
|
case NPC_DEFENDER:
|
||||||
case NPC_MAGICMIRROR:
|
case NPC_MAGICMIRROR:
|
||||||
case ST_PRESERVE:
|
case ST_PRESERVE:
|
||||||
|
case NPC_KEEPING:
|
||||||
|
case NPC_BARRIER:
|
||||||
case NPC_INVINCIBLE:
|
case NPC_INVINCIBLE:
|
||||||
case NPC_INVINCIBLEOFF:
|
case NPC_INVINCIBLEOFF:
|
||||||
case MER_INVINCIBLEOFF2:
|
case MER_INVINCIBLEOFF2:
|
||||||
@ -8222,21 +8224,6 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
|
|||||||
if (md) mob_unlocktarget(md, tick);
|
if (md) mob_unlocktarget(md, tick);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NPC_KEEPING:
|
|
||||||
case NPC_BARRIER:
|
|
||||||
{
|
|
||||||
int skill_time = skill_get_time(skill_id,skill_lv);
|
|
||||||
struct unit_data *ud = unit_bl2ud(bl);
|
|
||||||
if (clif_skill_nodamage(src,bl,skill_id,skill_lv,
|
|
||||||
sc_start(src,bl,type,100,skill_lv,skill_time))
|
|
||||||
&& ud) { //Disable attacking/acting/moving for skill's duration.
|
|
||||||
ud->attackabletime =
|
|
||||||
ud->canact_tick =
|
|
||||||
ud->canmove_tick = tick + skill_time;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case NPC_REBIRTH:
|
case NPC_REBIRTH:
|
||||||
if( md && md->state.rebirth )
|
if( md && md->state.rebirth )
|
||||||
break; // only works once
|
break; // only works once
|
||||||
|
@ -9553,6 +9553,14 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
|
|||||||
tick = INFINITE_TICK;
|
tick = INFINITE_TICK;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SC_KEEPING:
|
||||||
|
case SC_BARRIER: {
|
||||||
|
unit_data *ud = unit_bl2ud(bl);
|
||||||
|
|
||||||
|
if (ud)
|
||||||
|
ud->attackabletime = ud->canact_tick = ud->canmove_tick = gettick() + tick;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SC_DECREASEAGI:
|
case SC_DECREASEAGI:
|
||||||
case SC_INCREASEAGI:
|
case SC_INCREASEAGI:
|
||||||
case SC_ADORAMUS:
|
case SC_ADORAMUS:
|
||||||
@ -12178,6 +12186,14 @@ int status_change_end_(struct block_list* bl, enum sc_type type, int tid, const
|
|||||||
vd = status_get_viewdata(bl);
|
vd = status_get_viewdata(bl);
|
||||||
calc_flag = static_cast<scb_flag>(StatusChangeFlagTable[type]);
|
calc_flag = static_cast<scb_flag>(StatusChangeFlagTable[type]);
|
||||||
switch(type) {
|
switch(type) {
|
||||||
|
case SC_KEEPING:
|
||||||
|
case SC_BARRIER: {
|
||||||
|
unit_data *ud = unit_bl2ud(bl);
|
||||||
|
|
||||||
|
if (ud)
|
||||||
|
ud->attackabletime = ud->canact_tick = ud->canmove_tick = gettick();
|
||||||
|
}
|
||||||
|
break;
|
||||||
case SC_GRANITIC_ARMOR:
|
case SC_GRANITIC_ARMOR:
|
||||||
{
|
{
|
||||||
int damage = status->max_hp*sce->val3/100;
|
int damage = status->max_hp*sce->val3/100;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user