mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 08:28:57 +01:00
*Do not trigger spells with triggers with scripts. This fixes the bug that shadow fissure of Kel'thuzad deals damage without delay.
--HG-- branch : trunk
This commit is contained in:
@@ -629,7 +629,7 @@ CreatureAI* GetAI_npc_dkc1_gothik(Creature *_Creature)
|
||||
return new npc_dkc1_gothikAI(_Creature);
|
||||
}
|
||||
|
||||
// npc 28912 quest 17217 boss 29001 go 191092
|
||||
// npc 28912 quest 17217 boss 29001 mob 29007 go 191092
|
||||
|
||||
void AddSC_the_scarlet_enclave()
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace AIRegistry
|
||||
void Initialize()
|
||||
{
|
||||
(new CreatureAIFactory<NullCreatureAI>("NullCreatureAI"))->RegisterSelf();
|
||||
(new CreatureAIFactory<TriggerAI>("TriggerAI"))->RegisterSelf();
|
||||
(new CreatureAIFactory<AggressorAI>("AggressorAI"))->RegisterSelf();
|
||||
(new CreatureAIFactory<ReactorAI>("ReactorAI"))->RegisterSelf();
|
||||
(new CreatureAIFactory<PassiveAI>("PassiveAI"))->RegisterSelf();
|
||||
|
||||
@@ -60,12 +60,17 @@ namespace FactorySelector
|
||||
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
|
||||
else if(creature->isGuard())
|
||||
ai_factory = ai_registry.GetRegistryItem("GuardAI");
|
||||
else if(creature->HasSummonMask(SUMMON_MASK_GUARDIAN))
|
||||
else if(creature->isGuardian())
|
||||
ai_factory = ai_registry.GetRegistryItem("PetAI");
|
||||
else if(creature->isTotem())
|
||||
ai_factory = ai_registry.GetRegistryItem("TotemAI");
|
||||
else if(creature->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_TRIGGER)
|
||||
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
|
||||
else if(creature->isTrigger())
|
||||
{
|
||||
if(creature->m_spells[0])
|
||||
ai_factory = ai_registry.GetRegistryItem("TriggerAI");
|
||||
else
|
||||
ai_factory = ai_registry.GetRegistryItem("NullCreatureAI");
|
||||
}
|
||||
else if(creature->GetCreatureType() == CREATURE_TYPE_CRITTER)
|
||||
ai_factory = ai_registry.GetRegistryItem("CritterAI");
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "NullCreatureAI.h"
|
||||
#include "Creature.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
void PassiveAI::UpdateAI(const uint32)
|
||||
{
|
||||
@@ -68,3 +69,13 @@ void CritterAI::EnterEvadeMode()
|
||||
me->SetControlled(false, UNIT_STAT_FLEEING);
|
||||
CreatureAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void TriggerAI::UpdateAI(const uint32 diff)
|
||||
{
|
||||
if(!casted)
|
||||
{
|
||||
casted = true;
|
||||
if(me->m_spells[0] && me->isSummon())
|
||||
me->CastSpell(me, me->m_spells[0], false, 0, 0, ((TempSummon*)me)->GetSummonerGUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,5 +75,14 @@ class TRINITY_DLL_DECL CritterAI : public PassiveAI
|
||||
void EnterEvadeMode();
|
||||
};
|
||||
|
||||
class TRINITY_DLL_DECL TriggerAI : public NullCreatureAI
|
||||
{
|
||||
public:
|
||||
explicit TriggerAI(Creature *c) : NullCreatureAI(c), casted(false) {}
|
||||
void UpdateAI(const uint32);
|
||||
private:
|
||||
bool casted;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -209,7 +209,6 @@ void TempSummon::InitSummon()
|
||||
{
|
||||
setFaction(owner->getFaction());
|
||||
SetLevel(owner->getLevel());
|
||||
CastSpell(this, m_spells[0], false, 0, 0, m_summonerGUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user