Fix to SE_ApplyEffect - Will now trigger spell from this effect at correct time.

This commit is contained in:
KayenEQ 2014-09-22 19:42:59 -04:00
parent c160b8716f
commit 1f155690d8
4 changed files with 10 additions and 23 deletions

View File

@ -3083,26 +3083,6 @@ void Mob::TrySpellTrigger(Mob *target, uint32 spell_id)
}
}
void Mob::TryApplyEffect(Mob *target, uint32 spell_id)
{
if(target == nullptr || !IsValidSpell(spell_id))
{
return;
}
for(int i = 0; i < EFFECT_COUNT; i++)
{
if (spells[spell_id].effectid[i] == SE_ApplyEffect)
{
if(MakeRandomInt(0, 100) <= spells[spell_id].base[i])
{
if(target)
SpellFinished(spells[spell_id].base2[i], target, 10, 0, -1, spells[spell_id].ResistDiff);
}
}
}
}
void Mob::TryTriggerOnValueAmount(bool IsHP, bool IsMana, bool IsEndur, bool IsPet)
{
/*

View File

@ -580,7 +580,6 @@ public:
void TryTriggerOnCast(uint32 spell_id, bool aa_trigger);
void TriggerOnCast(uint32 focus_spell, uint32 spell_id, bool aa_trigger);
void TrySpellTrigger(Mob *target, uint32 spell_id);
void TryApplyEffect(Mob *target, uint32 spell_id);
void TryTriggerOnValueAmount(bool IsHP = false, bool IsMana = false, bool IsEndur = false, bool IsPet = false);
void TryTwincast(Mob *caster, Mob *target, uint32 spell_id);
void TrySympatheticProc(Mob *target, uint32 spell_id);

View File

@ -2729,6 +2729,16 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
Message(10, "The power of your next illusion spell will flow to your grouped target in your place.");
break;
}
case SE_ApplyEffect: {
if (caster && IsValidSpell(spells[spell_id].base2[i])){
if(MakeRandomInt(0, 100) <= spells[spell_id].base[i])
caster->SpellFinished(spells[spell_id].base2[i], this, 10, 0, -1, spells[spell_id].ResistDiff);
}
break;
}
// Handled Elsewhere
case SE_ImmuneFleeing:
@ -2840,7 +2850,6 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
case SE_SkillDamageTaken:
case SE_FcSpellVulnerability:
case SE_SpellTrigger:
case SE_ApplyEffect:
case SE_FcTwincast:
case SE_DelayDeath:
case SE_CastOnFadeEffect:

View File

@ -3648,7 +3648,6 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
}
TrySpellTrigger(spelltar, spell_id);
TryApplyEffect(spelltar, spell_id);
if (IsValidSpell(spells[spell_id].RecourseLink))
SpellFinished(spells[spell_id].RecourseLink, this, 10, 0, -1, spells[spells[spell_id].RecourseLink].ResistDiff);