Core/Quests: Remove CastedCreatureOrGO method
- Remove EAI's ACTION_T_CAST_EVENT and ACTION_T_CAST_EVENT_ALL - Remove SAI's SMART_ACTION_CALL_CASTEDCREATUREORGO - Split QUEST_TRINITY_FLAGS_KILL_OR_CAST into QUEST_TRINITY_FLAGS_KILL and QUEST_TRINITY_FLAGS_CAST - Assign QUEST_TRINITY_FLAGS_CAST to all the quests that were using RequiredSpellCastX - (unrelated) Fix a warning in Player.cpp - Replace CastedCreatureOrGO usage in scripts by KilledMonsterCredit TODO: Convert the two EAI scripts commented out in the .sql to proper SAI Closes #10667
This commit is contained in:
1 parent
aa5bc37e9c
commit
7776016106
16 files changed
+52
-186
No files matched your search
@@ -2569,17 +2569,9 @@ void Spell::DoAllEffectOnTarget(TargetInfo* target)
|
||||
{
|
||||
//AI functions
|
||||
if (spellHitTarget->GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
if (spellHitTarget->ToCreature()->IsAIEnabled)
|
||||
spellHitTarget->ToCreature()->AI()->SpellHit(m_caster, m_spellInfo);
|
||||
|
||||
// cast at creature (or GO) quest objectives update at successful cast finished (+channel finished)
|
||||
// ignore pets or autorepeat/melee casts for speed (not exist quest for spells (hm...)
|
||||
if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !spellHitTarget->ToCreature()->IsPet() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive())
|
||||
if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
p->CastedCreatureOrGO(spellHitTarget->GetEntry(), spellHitTarget->GetGUID(), m_spellInfo->Id);
|
||||
}
|
||||
|
||||
if (m_caster->GetTypeId() == TYPEID_UNIT && m_caster->ToCreature()->IsAIEnabled)
|
||||
m_caster->ToCreature()->AI()->SpellHitTarget(spellHitTarget, m_spellInfo);
|
||||
|
||||
@@ -2882,12 +2874,6 @@ void Spell::DoAllEffectOnTarget(GOTargetInfo* target)
|
||||
HandleEffects(NULL, NULL, go, effectNumber, SPELL_EFFECT_HANDLE_HIT_TARGET);
|
||||
|
||||
CallScriptOnHitHandlers();
|
||||
|
||||
// cast at creature (or GO) quest objectives update at successful cast finished (+channel finished)
|
||||
// ignore autorepeat/melee casts for speed (not exist quest for spells (hm...)
|
||||
if (m_originalCaster && m_originalCaster->IsControlledByPlayer() && !IsAutoRepeat() && !IsNextMeleeSwingSpell() && !IsChannelActive())
|
||||
if (Player* p = m_originalCaster->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
p->CastedCreatureOrGO(go->GetEntry(), go->GetGUID(), m_spellInfo->Id);
|
||||
CallScriptAfterHitHandlers();
|
||||
}
|
||||
|
||||
@@ -3641,40 +3627,6 @@ void Spell::update(uint32 difftime)
|
||||
if (m_timer == 0)
|
||||
{
|
||||
SendChannelUpdate(0);
|
||||
|
||||
// channeled spell processed independently for quest targeting
|
||||
// cast at creature (or GO) quest objectives update at successful cast channel finished
|
||||
// ignore autorepeat/melee casts for speed (not exist quest for spells (hm...)
|
||||
if (!IsAutoRepeat() && !IsNextMeleeSwingSpell())
|
||||
{
|
||||
if (Player* p = m_caster->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
{
|
||||
for (std::list<TargetInfo>::iterator ihit = m_UniqueTargetInfo.begin(); ihit != m_UniqueTargetInfo.end(); ++ihit)
|
||||
{
|
||||
TargetInfo* target = &*ihit;
|
||||
if (!IS_CRE_OR_VEH_GUID(target->targetGUID))
|
||||
continue;
|
||||
|
||||
Unit* unit = m_caster->GetGUID() == target->targetGUID ? m_caster : ObjectAccessor::GetUnit(*m_caster, target->targetGUID);
|
||||
if (unit == NULL)
|
||||
continue;
|
||||
|
||||
p->CastedCreatureOrGO(unit->GetEntry(), unit->GetGUID(), m_spellInfo->Id);
|
||||
}
|
||||
|
||||
for (std::list<GOTargetInfo>::iterator ihit = m_UniqueGOTargetInfo.begin(); ihit != m_UniqueGOTargetInfo.end(); ++ihit)
|
||||
{
|
||||
GOTargetInfo* target = &*ihit;
|
||||
|
||||
GameObject* go = m_caster->GetMap()->GetGameObject(target->targetGUID);
|
||||
if (!go)
|
||||
continue;
|
||||
|
||||
p->CastedCreatureOrGO(go->GetEntry(), go->GetGUID(), m_spellInfo->Id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
finish();
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in new issue
Block a user