void UnsummonAdds()
            {
                if (summoned)
                {
                    Creature *Nazan = Unit::GetCreature(*me, NazanGUID);
                    if (!Nazan)
                        Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000);
                    if (Nazan)
                    {
                        Nazan->DisappearAndDie();
                        NazanGUID = 0;
                    }

                    Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID);
                    if (!Vazruden)
                        Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000);
                    if (Vazruden)
                    {
                        Vazruden->DisappearAndDie();
                        VazrudenGUID = 0;
                    }
                    summoned = false;
                    me->ClearUnitState(UNIT_STAT_ROOT);
                    me->SetVisible(true);
                }
            }
Exemple #2
0
	void EnterEvadeMode()
	{
		if(Trigger1)
		{
			Trigger1->DisappearAndDie();
		}
		if(Trigger2)
		{
			Trigger2->DisappearAndDie();
		}
		ScriptedAI::EnterEvadeMode();
	}
Exemple #3
0
	void JustDied(Unit*)
	{
		if(!pInstance)
			return;
		if(Trigger1)
		{
			Trigger1->DisappearAndDie();
		}
		if(Trigger2)
		{
			Trigger2->DisappearAndDie();
		}
		DoScriptText(SAY_DEATH, me);
		pInstance->SetData(DATA_ZARITHRIAN_EVENT, DONE);
	}
Exemple #4
0
    void EnterEvadeMode()
    {
        m_creature->DisappearAndDie();

        if (pMarzon && pMarzon->isAlive())
            pMarzon->DisappearAndDie();
    }
    bool OnGossipHello(Player* player, GameObject* go)
    {
        Creature* pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true);
        if (!pPrisoner)
        {
            pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true);
            if (!pPrisoner)
            {
                pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true);
                if (!pPrisoner)
                    pPrisoner = go->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true);
            }
        }
        if (!pPrisoner || !pPrisoner->isAlive())
            return false;

        pPrisoner->DisappearAndDie();
        player->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
        switch (pPrisoner->GetEntry())
        {
            case NPC_EBON_BLADE_PRISONER_HUMAN:
                player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_H, true);
                break;
            case NPC_EBON_BLADE_PRISONER_NE:
                player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_NE, true);
                break;
            case NPC_EBON_BLADE_PRISONER_TROLL:
                player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_TROLL, true);
                break;
            case NPC_EBON_BLADE_PRISONER_ORC:
                player->CastSpell(player, SPELL_SUMMON_BLADE_KNIGHT_ORC, true);
                break;
        }
        return true;
    }
void TowerDefenseInstanceScript::TowerDefenseMapInstanceScript::SellGuard(uint64 guid)
{
    if(!guid)
        return;
    Player* player = GetPlayer();
    if(!player)
        return;
    Creature* creature = player->GetMap()->GetCreature(guid);
    if(!creature)
        return;
    uint32 entry = GUID_ENPART(guid);
    if (Guards.find(guid) != Guards.end())
    {
        GuardInfo* guard = Guards[guid];
        if(QueryResult queryResult = CharacterDatabase.PQuery("SELECT creatureName, creatureEntry, creatureCost FROM custom_td_base_stats WHERE creatureEntry = '%u'", entry))
        {   
            creature->CastSpell(creature, GetSpellIdByUniqueId(5),true);
            uint32 SellPrice = guard->GetSellPrice(guard->GetLevel());
            switch(GetEventMode())
            {
            case TD_EVENT_MODE_HARD:
                SellPrice = SellPrice - (SellPrice/4);
                break;
            case TD_EVENT_MODE_EXTREME:
                SellPrice = SellPrice - (SellPrice/2);
                break;
            }
            UpdateResources(TD_EVENT_INC,SellPrice);
            SendMessageToPlayer(TD_SYSTEM_MSG_SOLD_TOWER_FOR, creature->GetName(),SellPrice);
            creature->DisappearAndDie();
            Guards.erase(guid);
        }
    } 
}
        void UpdateAI(const uint32 diff)
        {
            if (currentPhase != PHASE_GORTOK_PALEHOOF)
                return;

            //Return since we have no target
            if (!UpdateVictim())
                return;

            Creature* temp = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_MOB_ORB) : 0);
            if (temp && temp->isAlive())
                temp->DisappearAndDie();

            if (uiArcingSmashTimer <= diff)
            {
                DoCast(me, SPELL_ARCING_SMASH);
                uiArcingSmashTimer = urand(13000, 17000);
            } else uiArcingSmashTimer -= diff;

            if (uiImpaleTimer <= diff)
            {
              if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                  DoCast(target, SPELL_IMPALE);
              uiImpaleTimer = urand(8000, 12000);
            } else uiImpaleTimer -= diff;

            if (uiWhiteringRoarTimer <= diff)
            {
                DoCast(me, SPELL_WITHERING_ROAR);
                uiWhiteringRoarTimer = urand(8000, 12000);
            } else uiWhiteringRoarTimer -= diff;

            DoMeleeAttackIfReady();
        }
Exemple #8
0
bool GOHello_go_jotunheim_cage(Player* pPlayer, GameObject* pGO)
{
    Creature* pPrisoner;
    pPrisoner = NULL;

    if ((pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_HUMAN, 5.0f, true)) ||
        (pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_TROLL, 5.0f, true)) ||
        (pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_ORC, 5.0f, true))   ||
        (pPrisoner = pGO->FindNearestCreature(NPC_EBON_BLADE_PRISONER_NE, 5.0f, true)))
    {
        if (pPrisoner && pPrisoner->isAlive())
        {
            pPrisoner->DisappearAndDie();
            pPlayer->KilledMonsterCredit(NPC_EBON_BLADE_PRISONER_HUMAN, 0);
            switch(pPrisoner->GetEntry())
            {
                case NPC_EBON_BLADE_PRISONER_HUMAN:
                    pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_H,true);
                    break;
                case NPC_EBON_BLADE_PRISONER_NE:
                    pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_NE,true);
                    break;
                case NPC_EBON_BLADE_PRISONER_TROLL:
                    pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_TROLL,true);
                    break;
                case NPC_EBON_BLADE_PRISONER_ORC:
                    pPlayer->CastSpell(pPlayer,SPELL_SUMMON_BLADE_KNIGHT_ORC,true);
                    break;
            }
        }
    }
    return true;
}
    bool OnGossipHello(Player* player, GameObject* go)
    {
        if (player->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE)
            return true;

        Creature* pPrisoner = go->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f);
        if (!pPrisoner)
        {
            pPrisoner = go->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f);
            if (!pPrisoner)
            {
                pPrisoner = go->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f);
                if (!pPrisoner)
                    pPrisoner = go->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f);
            }
        }

        if (!pPrisoner || !pPrisoner->isAlive())
            return true;

        Quest const* qInfo = sObjectMgr->GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL);
        if (qInfo)
        {
            //TODO: prisoner should help player for a short period of time
            player->KilledMonsterCredit(qInfo->RequiredNpcOrGo[0], 0);
            pPrisoner->DisappearAndDie();
        }
        return true;
    }
Exemple #10
0
bool GOHello_go_dragonflayer_cage(Player *pPlayer, GameObject *pGO)
{
    if (pPlayer->GetQuestStatus(QUEST_PRISONERS_OF_WYRMSKULL) != QUEST_STATUS_INCOMPLETE)
        return true;

    Creature* pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PRIEST, 2.0f);
    if (!pPrisoner)
    {
        pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_MAGE, 2.0f);
        if (!pPrisoner)
        {
            pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_WARRIOR, 2.0f);
            if (!pPrisoner)
                pPrisoner = pGO->FindNearestCreature(NPC_PRISONER_PALADIN, 2.0f);
        }
    }

    if (!pPrisoner || !pPrisoner->isAlive())
        return true;

    Quest const* qInfo = objmgr.GetQuestTemplate(QUEST_PRISONERS_OF_WYRMSKULL);
    if (qInfo)
    {
        //TODO: prisoner should help player for a short period of time
        pPlayer->KilledMonsterCredit(qInfo->ReqCreatureOrGOId[0],0);
        pPrisoner->DisappearAndDie();
    }
    return true;
}
Exemple #11
0
 void JustDied(Unit* /*killer*/)
 {
     if (instance)
         instance->SetData(DATA_GORTOK_PALEHOOF_EVENT, DONE);
     Creature* temp = Unit::GetCreature((*me), instance ? instance->GetData64(DATA_MOB_ORB) : 0);
     if (temp && temp->isAlive())
         temp->DisappearAndDie();
 }
Exemple #12
0
 void FinishPointReached()
 {
     me->CastSpell(me, SABOTEUR_SHIELD_DISRUPTION, false);
     me->DisappearAndDie();
     Creature* pSaboPort = Unit::GetCreature((*me), instance->GetData64(DATA_SABOTEUR_PORTAL));
     if (pSaboPort)
         pSaboPort->DisappearAndDie();
     instance->SetData(DATA_START_BOSS_ENCOUNTER, 1);
 }
Exemple #13
0
 void JustDied(Unit* /*killer*/)
 {
     DoScriptText(SAY_DEATH, me);
     if (pInstance)
         pInstance->SetData(DATA_GORTOK_PALEHOOF_EVENT, DONE);
     Creature* pTemp = Unit::GetCreature((*me), pInstance ? pInstance->GetData64(DATA_MOB_ORB) : 0);
     if (pTemp && pTemp->isAlive())
         pTemp->DisappearAndDie();
 }
Exemple #14
0
        uint32 NextStep(uint32 Step)
        {
            Creature* Spark = Unit::GetCreature(*me, SparkGUID);

            switch(Step)
            {
            case 0:
                if (Spark)
                    Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f);
                me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f);
                return 9000; // NPCs are walking up to fire
            case 1:
                DespawnNagaFlag(true);
                DoScriptText(EMOTE_SPARK, Spark);
                return 1000;
            case 2:
                DoScriptText(GEEZLE_SAY_1, me, Spark);
                if (Spark)
                {
                    Spark->SetInFront(me);
                    me->SetInFront(Spark);
                }
                return 5000;
            case 3:
                DoScriptText(SPARK_SAY_2, Spark);
                return 7000;
            case 4:
                DoScriptText(SPARK_SAY_3, Spark);
                return 8000;
            case 5:
                DoScriptText(GEEZLE_SAY_4, me, Spark);
                return 8000;
            case 6:
                DoScriptText(SPARK_SAY_5, Spark);
                return 9000;
            case 7:
                DoScriptText(SPARK_SAY_6, Spark);
                return 8000;
            case 8:
                DoScriptText(GEEZLE_SAY_7, me, Spark);
                return 2000;
            case 9:
                me->GetMotionMaster()->MoveTargetedHome();
                if (Spark)
                    Spark->GetMotionMaster()->MovePoint(0, SparkPos[0], SparkPos[1], SparkPos[2]);
                CompleteQuest();
                return 9000;
            case 10:
                if (Spark)
                    Spark->DisappearAndDie();
                DespawnNagaFlag(false);
                me->DisappearAndDie();
            default:
                return 99999999;
            }
        }
Exemple #15
0
 void DeSpawnAdds() {
     for (uint8 i = 0; i < 4; ++i) {
         Creature* Temp = NULL;
         if (AddGUID[i]) {
             Temp = Creature::GetCreature((*me), AddGUID[i]);
             if (Temp && Temp->isAlive())
                 Temp->DisappearAndDie();
         }
     }
 }
Exemple #16
0
 void JustReachedHome()
 {
     // Data for visual
     if (timeRift)
         timeRift->DisappearAndDie();
     timeRift = me->SummonCreature(NPC_TIME_RIFT, me->GetPositionX() - 10.0f, me->GetPositionY(), me->GetPositionZ());
     // Visual Channeling
     if(timeRift)
        me->CastSpell(timeRift, SPELL_CHANNEL_VISUAL, true);
 }
 void UnsummonAdds()
 {
     if (summoned)
     {
         Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID);
         Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID);
         if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000)))
         {
             Nazan->DisappearAndDie();
             NazanGUID = 0;
         }
         if (Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000)))
         {
             Vazruden->DisappearAndDie();
             VazrudenGUID = 0;
         }
         summoned = false;
         m_creature->clearUnitState(UNIT_STAT_ROOT);
         m_creature->SetVisibility(VISIBILITY_ON);
     }
 }
Exemple #18
0
bool GOHello_go_sethekk_cage(Player *pPlayer, GameObject *pGO)
{
    Creature *pLakka;
    if (pPlayer->GetQuestStatus(QUEST_10097) == QUEST_STATUS_INCOMPLETE &&
        (pLakka = pGO->FindNearestCreature(NPC_LAKKA,10.0f)))
        {
			pGO->UseDoorOrButton();
			pPlayer->KilledMonsterCredit(pLakka->GetEntry(),pLakka->GetGUID());
			pLakka->DisappearAndDie();            
        }
    return true;
}
Exemple #19
0
bool GOHello_go_stillpine_cage(Player *pPlayer, GameObject *pGO)
{
    Creature *pPrisoner;
    if (pPlayer->GetQuestStatus(QUEST_PROPHECY_OF_AKIDA) == QUEST_STATUS_INCOMPLETE &&
        (pPrisoner = pGO->FindNearestCreature(NPC_STILLPINE_CAPTIVE,1.0f)))
    {
        pGO->UseDoorOrButton();
        pPrisoner->DisappearAndDie();
        pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0);
    }
    return true;
}
Exemple #20
0
 void DeSpawnAdds()
 {
     for (uint8 i = 0; i < 4; ++i)
     {
         if (AddGUID[i])
         {
             Creature* temp = Creature::GetCreature((*me), AddGUID[i]);
             if (temp && temp->IsAlive())
                 temp->DisappearAndDie();
         }
     }
 }
Exemple #21
0
bool GOHello_go_black_cage(Player *pPlayer, GameObject *pGO)
{
    Creature *pPrisoner;
    if (((pPlayer->GetTeamId() == TEAM_ALLIANCE && pPlayer->GetQuestStatus(QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE) ||
        (pPlayer->GetTeamId() == TEAM_HORDE && pPlayer->GetQuestStatus(QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE)) &&
        ((pPrisoner = pGO->FindNearestCreature(NPC_CAPTIVE_ASPIRANT,1.0f)) || (pPrisoner = pGO->FindNearestCreature(NPC_KUL,1.0f))))
    {
        pGO->UseDoorOrButton();
        pPrisoner->DisappearAndDie();
        pPlayer->KilledMonsterCredit(pPrisoner->GetEntry(),0);
    }
    return true;
}
Exemple #22
0
    uint32 NextStep(uint32 Step)
    {
        Creature* Spark = Unit::GetCreature((*me), SparkGUID);
        if (!Spark)
            return 99999999;

        switch (Step)
        {
        case 0:
            return 99999;
        case 1:
            DespawnNagaFlag(true);
            // @todo: this emote doesnt seem to include Spark's name
            DoScriptText(EMOTE_SPARK, Spark);
            return 1000;
        case 2:
            DoScriptText(GEEZLE_SAY_1, me, Spark);
            Spark->SetInFront(me);
            me->SetInFront(Spark);
            return 5000;
        case 3:
            DoScriptText(SPARK_SAY_2, Spark);
            return 7000;
        case 4:
            DoScriptText(SPARK_SAY_3, Spark);
            return 8000;
        case 5:
            DoScriptText(GEEZLE_SAY_4, me, Spark);
            return 8000;
        case 6:
            DoScriptText(SPARK_SAY_5, Spark);
            return 9000;
        case 7:
            DoScriptText(SPARK_SAY_6, Spark);
            return 8000;
        case 8:
            DoScriptText(GEEZLE_SAY_7, me, Spark);
            return 2000;
        case 9:
            me->GetMotionMaster()->MoveTargetedHome();
            Spark->GetMotionMaster()->MovePoint(0, -5030.95f, -11291.99f, 7.97f);
            CompleteQuest();
            return 9000;
        case 10:
            Spark->DisappearAndDie();
            DespawnNagaFlag(false);
            me->DisappearAndDie();
        default:
            return 99999999;
        }
    }
        uint32 NextStep(uint8 Step)
        {
            Creature* Spark = Unit::GetCreature(*me, SparkGUID);
            if (!Spark)
                return 99999999;

            switch (Step)
            {
                case 0:
                    Spark->GetMotionMaster()->MovePoint(0, -5080.70f, -11253.61f, 0.56f);
                    me->GetMotionMaster()->MovePoint(0, -5092.26f, -11252, 0.71f);
                    return 9000;
                case 1:
                    DespawnNagaFlag(true);
                    Spark->AI()->Talk(EMOTE_SPARK);
                    return 1000;
                case 2:
                    Talk(GEEZLE_SAY_1, SparkGUID);
                    Spark->SetInFront(me);
                    me->SetInFront(Spark);
                    return 5000;
                case 3:
                    Spark->AI()->Talk(SPARK_SAY_2);
                    return 7000;
                case 4:
                    Spark->AI()->Talk(SPARK_SAY_3);
                    return 8000;
                case 5:
                    Talk(GEEZLE_SAY_4, SparkGUID);
                    return 8000;
                case 6:
                    Spark->AI()->Talk(SPARK_SAY_5);
                    return 9000;
                case 7:
                    Spark->AI()->Talk(SPARK_SAY_6);
                    return 8000;
                case 8:
                    Talk(GEEZLE_SAY_7, SparkGUID);
                    return 2000;
                case 9:
                    me->GetMotionMaster()->MoveTargetedHome();
                     Spark->GetMotionMaster()->MovePoint(0, SparkPos);
                    CompleteQuest();
                    return 9000;
                case 10:
                    Spark->DisappearAndDie();
                    DespawnNagaFlag(false);
                    me->DisappearAndDie();
                default: return 99999999;
            }
        }
    void UnsummonAdds()
    {
        if (summoned)
        {
            Creature *Nazan = Unit::GetCreature(*me, NazanGUID);
            if (!Nazan)
                Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000);
            if (Nazan)
            {
                Nazan->DisappearAndDie();
                NazanGUID = 0;
            }

            Creature *Vazruden = Unit::GetCreature(*me, VazrudenGUID);
            if (!Vazruden)
                Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000);
            if (Vazruden)
            {
                Vazruden->DisappearAndDie();
                VazrudenGUID = 0;
            }
            summoned = false;
            me->clearUnitState(UNIT_STAT_ROOT);
            me->SetVisibility(VISIBILITY_ON);

            for (std::vector<uint64>::const_iterator itr = OrcGUID.begin(); itr != OrcGUID.end(); ++itr)
            {
                if (Creature* pOrc = Creature::GetCreature(*me, *itr))
                {
                    if (!pOrc->isAlive())
                    {
                        pOrc->ForcedDespawn();
                        pOrc->Respawn();
                    }
                }
            }
        }
    }
	bool OnGossipHello(Player *pPlayer, GameObject *pGO) {
		if (pPlayer->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES)
				== QUEST_STATUS_INCOMPLETE) {
			Creature *pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE,
					1.0f);
			if (pTadpole) {
				pGO->UseDoorOrButton();
				pTadpole->DisappearAndDie();
				pPlayer->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE, 0);
				//FIX: Summon minion tadpole
			}
		}
		return true;
	}
Exemple #26
0
bool GOHello_go_scourge_enclosure(Player* pPlayer, GameObject* pGO)
{
    if (pPlayer->GetQuestStatus(QUEST_OUR_ONLY_HOPE) == QUEST_STATUS_INCOMPLETE)
    {
        Creature* pGymerDummy = pGO->FindNearestCreature(NPC_GYMER_DUMMY,20.0f);
        if (pGymerDummy)
        {
            pGO->UseDoorOrButton();
            pPlayer->KilledMonsterCredit(pGymerDummy->GetEntry(),pGymerDummy->GetGUID());
            pGymerDummy->CastSpell(pGymerDummy, 55529, true);
            pGymerDummy->DisappearAndDie();
        }
    }
    return true;
}
Exemple #27
0
    bool OnGossipHello(Player* player, GameObject* go)
    {
        if ((player->GetTeamId() == TEAM_ALLIANCE && player->GetQuestStatus(QUEST_ALLIANCE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE) ||
            (player->GetTeamId() == TEAM_HORDE && player->GetQuestStatus(QUEST_HORDE_YOU_VE_REALLY_DONE_IT_THIS_TIME_KUL) == QUEST_STATUS_INCOMPLETE))
        {
            Creature* prisoner = go->FindNearestCreature(NPC_CAPTIVE_ASPIRANT, 1.0f);
            if (!prisoner)
                prisoner = go->FindNearestCreature(NPC_KUL, 1.0f);

            if (prisoner)
            {
                go->UseDoorOrButton();
                prisoner->DisappearAndDie();
                player->KilledMonsterCredit(prisoner->GetEntry(), 0);
            }
        }
        return true;
    }
void SummonList::DespawnAll()
{
    while(!empty())
    {
        Creature *summon = Unit::GetCreature(*m_creature, *begin());
        if (!summon)
            erase(begin());
        else
        {
            erase(begin());
            if (summon->isSummon())
            {
                summon->DestroyForNearbyPlayers();
                CAST_SUM(summon)->UnSummon();
            }
            else
                summon->DisappearAndDie();
        }
    }
}
Exemple #29
0
void SummonList::DespawnAll()
{
    while (!empty())
    {
        Creature* summon = Unit::GetCreature(*me, *begin());
        if (!summon)
            erase(begin());
        else
        {
            erase(begin());
            if (TempSummon* summ = summon->ToTempSummon())
            {
                summon->DestroyForNearbyPlayers();
                summ->UnSummon();
            }
            else
                summon->DisappearAndDie();
        }
    }
}
    void OnDestroyed(Player* /*pPlayer*/, GameObject* pGO, uint32 /*value*/)
    {
        InstanceScript* instance = pGO->GetInstanceScript();
        switch(pGO->GetEntry())
        {
            case GO_TOWER_OF_STORMS:
                //instance->ProcessEvent(pGO, EVENT_TOWER_OF_STORM_DESTROYED);
                break;
            case GO_TOWER_OF_FLAMES:
                //instance->ProcessEvent(pGO, EVENT_TOWER_OF_FLAMES_DESTROYED);
                break;
            case GO_TOWER_OF_FROST:
                //instance->ProcessEvent(pGO, EVENT_TOWER_OF_FROST_DESTROYED);
                break;
            case GO_TOWER_OF_LIFE:
                //instance->ProcessEvent(pGO, EVENT_TOWER_OF_LIFE_DESTROYED);
                break;
        }

        Creature* trigger = pGO->FindNearestCreature(NPC_ULDUAR_GAUNTLET_GENERATOR, 15.0f, true);
        if (trigger)
            trigger->DisappearAndDie();
    }