Spell field defined that determines if must be sneaking to use this ability.

This is handled by client under normal conditions, however if you
force cast this effect in situations like 'procs' you can cause
zone crashes, therefore a failsafe check is added in 'SpellOnTarget'
This commit is contained in:
KayenEQ
2014-11-13 21:45:19 -05:00
parent b32f59a40d
commit 563a39c2d9
5 changed files with 10 additions and 3 deletions
+6 -1
View File
@@ -3262,6 +3262,11 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
if(spelltar->IsClient() && spelltar->CastToClient()->IsHoveringForRespawn())
return false;
if (spells[spell_id].sneak && IsClient() && !CastToClient()->sneaking){
Message_StringID(13, SNEAK_RESTRICT);
return false;//Fail Safe, this can cause a zone crash certain situations if you try to apply sneak effects when not sneaking.
}
if(IsDetrimentalSpell(spell_id) && !IsAttackAllowed(spelltar) && !IsResurrectionEffects(spell_id)) {
if(!IsClient() || !CastToClient()->GetGM()) {
Message_StringID(MT_SpellFailure, SPELL_NO_HOLD);
@@ -4711,7 +4716,7 @@ void NPC::Stun(int duration) {
void NPC::UnStun() {
Mob::UnStun();
SetRunAnimSpeed(this->GetRunspeed());
SetRunAnimSpeed(static_cast<int8>(GetRunspeed()));
SendPosition();
}