Violet Hold: Add crystal mechanic support to Portal's and Ichoron's adds
--HG-- branch : trunk
This commit is contained in:
@@ -292,15 +292,23 @@ struct boss_ichoronAI : public ScriptedAI
|
||||
|
||||
void JustSummoned(Creature* pSummoned)
|
||||
{
|
||||
pSummoned->SetSpeed(MOVE_RUN, 0.3f);
|
||||
pSummoned->GetMotionMaster()->MoveFollow(me, 0, 0);
|
||||
m_waterElements.push_back(pSummoned->GetGUID());
|
||||
if (pSummoned)
|
||||
{
|
||||
pSummoned->SetSpeed(MOVE_RUN, 0.3f);
|
||||
pSummoned->GetMotionMaster()->MoveFollow(me, 0, 0);
|
||||
m_waterElements.push_back(pSummoned->GetGUID());
|
||||
pInstance->SetData64(DATA_ADD_TRASH_MOB,pSummoned->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SummonedCreatureDespawn(Creature *pSummoned)
|
||||
{
|
||||
m_waterElements.remove(pSummoned->GetGUID());
|
||||
if (pSummoned)
|
||||
{
|
||||
m_waterElements.remove(pSummoned->GetGUID());
|
||||
pInstance->SetData64(DATA_DEL_TRASH_MOB,pSummoned->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * victim)
|
||||
|
||||
@@ -539,7 +539,10 @@ struct npc_teleportation_portalAI : public ScriptedAI
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (pInstance && pInstance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
if (!pInstance) //Massive usage of pInstance, global check
|
||||
return;
|
||||
|
||||
if (pInstance->GetData(DATA_REMOVE_NPC) == 1)
|
||||
{
|
||||
me->ForcedDespawn();
|
||||
pInstance->SetData(DATA_REMOVE_NPC, 0);
|
||||
@@ -618,11 +621,15 @@ struct npc_teleportation_portalAI : public ScriptedAI
|
||||
void JustSummoned(Creature *pSummoned)
|
||||
{
|
||||
listOfMobs.Summon(pSummoned);
|
||||
if (pSummoned)
|
||||
pInstance->SetData64(DATA_ADD_TRASH_MOB,pSummoned->GetGUID());
|
||||
}
|
||||
|
||||
void SummonedMobDied(Creature *pSummoned)
|
||||
{
|
||||
listOfMobs.Despawn(pSummoned);
|
||||
if (pSummoned)
|
||||
pInstance->SetData64(DATA_DEL_TRASH_MOB,pSummoned->GetGUID());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user