From c2b0bcbd6c8155812857523681cd787059cd9bf9 Mon Sep 17 00:00:00 2001 From: Shauren Date: Thu, 3 Feb 2011 22:20:40 +0100 Subject: Core/Instances: Implemented DungeonEncounter.dbc for creating completed encounters mask to use in packets Core/Dungeon Finder: Implemented new way of giving random dungeon rewards, linked to DungeonEncounter.dbc --- src/server/game/Spells/Spell.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/server/game/Spells/Spell.cpp') diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp index 2cc6d08c0be..f0ecb5307b6 100755 --- a/src/server/game/Spells/Spell.cpp +++ b/src/server/game/Spells/Spell.cpp @@ -51,6 +51,7 @@ #include "ConditionMgr.h" #include "DisableMgr.h" #include "SpellScript.h" +#include "InstanceScript.h" #define SPELL_CHANNEL_UPDATE_INTERVAL (1 * IN_MILLISECONDS) @@ -3717,16 +3718,17 @@ void Spell::finish(bool ok) // triggered spell pointer can be not set in some cases // this is needed for proper apply of triggered spell mods m_caster->ToPlayer()->SetSpellModTakingSpell(this, true); - } - // Take mods after trigger spell (needed for 14177 to affect 48664) - // mods are taken only on succesfull cast and independantly from targets of the spell - if (m_caster->GetTypeId() == TYPEID_PLAYER) - { + // Take mods after trigger spell (needed for 14177 to affect 48664) + // mods are taken only on succesfull cast and independantly from targets of the spell m_caster->ToPlayer()->RemoveSpellMods(this); m_caster->ToPlayer()->SetSpellModTakingSpell(this, false); } + if (m_caster->GetTypeId() == TYPEID_UNIT) + if (InstanceScript* instance = m_caster->GetInstanceScript()) + instance->UpdateEncounterState(ENCOUNTER_CREDIT_CAST_SPELL, m_spellInfo->Id, m_caster); + // Stop Attack for some spells if (m_spellInfo->Attributes & SPELL_ATTR0_STOP_ATTACK_TARGET) m_caster->AttackStop(); -- cgit v1.2.3