aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsilinoron <none@none>2010-12-18 13:07:15 -0800
committersilinoron <none@none>2010-12-18 13:07:15 -0800
commitf339ced1bfb4f66a97dedb5397c0cc296cd4e9c5 (patch)
tree2b7e254f26daec37999d3aecd7e4ea4ae6d4a8db
parent41a9d3216ca2f3f32c133efa5697b215af668590 (diff)
parent24193966ddd536c1259cd697198349ebf575072a (diff)
merge
--HG-- branch : trunk
-rwxr-xr-xsrc/server/game/AI/CoreAI/UnitAI.h2
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp3
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.h2
-rwxr-xr-xsrc/server/game/Spells/Auras/SpellAuraEffects.cpp28
4 files changed, 13 insertions, 22 deletions
diff --git a/src/server/game/AI/CoreAI/UnitAI.h b/src/server/game/AI/CoreAI/UnitAI.h
index b43ec8f8252..8300c9429fd 100755
--- a/src/server/game/AI/CoreAI/UnitAI.h
+++ b/src/server/game/AI/CoreAI/UnitAI.h
@@ -219,7 +219,7 @@ class UnitAI
virtual void sQuestSelect(Player* /*player*/, Quest const* /*quest*/) {}
virtual void sQuestComplete(Player* /*player*/, Quest const* /*quest*/) {}
virtual void sQuestReward(Player* /*player*/, Quest const* /*quest*/, uint32 /*opt*/) {}
- virtual void sOnDummyEffect(Unit* /*caster*/, uint32 /*spellId*/, SpellEffIndex /*effIndex*/) {}
+ virtual bool sOnDummyEffect(Unit* /*caster*/, uint32 /*spellId*/, SpellEffIndex /*effIndex*/) { return false; }
};
class PlayerAI : public UnitAI
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index d7a7dcafd77..c9124e20d2a 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -746,9 +746,10 @@ void SmartAI::sQuestReward(Player* player, Quest const* quest, uint32 opt)
GetScript()->ProcessEventsFor(SMART_EVENT_REWARD_QUEST, player, quest->GetQuestId(), opt);
}
-void SmartAI::sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex)
+bool SmartAI::sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DUMMY_EFFECT,caster,spellId,(uint32)effIndex);
+ return true;
}
void SmartAI::SetCombatMove(bool on)
diff --git a/src/server/game/AI/SmartScripts/SmartAI.h b/src/server/game/AI/SmartScripts/SmartAI.h
index e64663a6154..1a318d1bfbe 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.h
+++ b/src/server/game/AI/SmartScripts/SmartAI.h
@@ -182,7 +182,7 @@ class SmartAI : public CreatureAI
//void sQuestSelect(Player* player, Quest const* quest);
//void sQuestComplete(Player* player, Quest const* quest);
void sQuestReward(Player* player, Quest const* quest, uint32 opt);
- void sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex);
+ bool sOnDummyEffect(Unit* caster, uint32 spellId, SpellEffIndex effIndex);
uint32 mEscortQuestID;
diff --git a/src/server/game/Spells/Auras/SpellAuraEffects.cpp b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
index 3530025ed44..b0edaf904b8 100755
--- a/src/server/game/Spells/Auras/SpellAuraEffects.cpp
+++ b/src/server/game/Spells/Auras/SpellAuraEffects.cpp
@@ -2150,11 +2150,11 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
// specific code for cases with no trigger spell provided in field
if (triggeredSpellInfo == NULL)
{
- switch(auraSpellInfo->SpellFamilyName)
+ switch (auraSpellInfo->SpellFamilyName)
{
case SPELLFAMILY_GENERIC:
{
- switch(auraId)
+ switch (auraId)
{
// Thaumaturgy Channel
case 9712:
@@ -2356,17 +2356,8 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
else
{
// Spell exist but require custom code
- switch(auraId)
+ switch (auraId)
{
- case 66869:
- switch(caster->GetMap()->GetDifficulty())
- {
- case RAID_DIFFICULTY_10MAN_NORMAL: triggerSpellId = 66870; break;
- case RAID_DIFFICULTY_10MAN_HEROIC: triggerSpellId = 67621; break;
- case RAID_DIFFICULTY_25MAN_NORMAL: triggerSpellId = 67622; break;
- case RAID_DIFFICULTY_25MAN_HEROIC: triggerSpellId = 67623; break;
- }
- break;
// Pursuing Spikes (Anub'arak)
case 65920:
case 65922:
@@ -2422,15 +2413,14 @@ void AuraEffect::TriggerSpell(Unit * target, Unit * caster) const
{
Unit * triggerCaster = GetTriggeredSpellCaster(triggeredSpellInfo, caster, triggerTarget);
triggerCaster->CastSpell(triggerTarget, triggeredSpellInfo, true, NULL, this);
- sLog.outDebug("AuraEffect::TriggerSpell: Spell %u Trigger %u",GetId(), triggeredSpellInfo->Id);
+ sLog.outDebug("AuraEffect::TriggerSpell: Spell %u Trigger %u", GetId(), triggeredSpellInfo->Id);
}
- else if (target->GetTypeId() != TYPEID_UNIT || !sScriptMgr.OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature()))
+ else
{
- if (Creature* c = triggerTarget->ToCreature())
- {
- c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()));
- }
- sLog.outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex());
+ Creature* c = triggerTarget->ToCreature();
+ if (!c || (c && !sScriptMgr.OnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()), triggerTarget->ToCreature())) ||
+ (c && !c->AI()->sOnDummyEffect(caster, GetId(), SpellEffIndex(GetEffIndex()))))
+ sLog.outError("AuraEffect::TriggerSpell: Spell %u has value 0 in EffectTriggered[%d] and is therefor not handled. Define as custom case?",GetId(),GetEffIndex());
}
}