void UpdateAI(const uint32 diff)
    {
        if (CheckTimer <= diff)
        {
            if (AnetheronGUID)
            {
                Creature* boss = Unit::GetCreature((*me),AnetheronGUID);
                if (!boss || (boss && boss->isDead()))
                {
                    me->setDeathState(JUST_DIED);
                    me->RemoveCorpse();
                    return;
                }
            }
            CheckTimer = 5000;
        } else CheckTimer -= diff;

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

        if (ImmolationTimer <= diff)
        {
            DoCast(me, SPELL_IMMOLATION);
            ImmolationTimer = 5000;
        } else ImmolationTimer -= diff;

        DoMeleeAttackIfReady();
    }
void instance_dire_maul::SortPylonGuards()
{
    if (!m_lGeneratorGuardGUIDs.empty())
    {
        for (uint8 i = 0; i < MAX_GENERATORS; ++i)
        {
            GameObject* pGenerator = instance->GetGameObject(m_aCrystalGeneratorGuid[i]);
            // Skip non-existing or finished generators
            if (!pGenerator || GetData(TYPE_PYLON_1 + i) == DONE)
                continue;

            // Sort all remaining (alive) NPCs to unfinished generators
            for (GuidList::iterator itr = m_lGeneratorGuardGUIDs.begin(); itr != m_lGeneratorGuardGUIDs.end();)
            {
                Creature* pGuard = instance->GetCreature(*itr);
                if (!pGuard || pGuard->isDead())    // Remove invalid guids and dead guards
                {
                    m_lGeneratorGuardGUIDs.erase(itr++);
                    continue;
                }

                if (pGuard->IsWithinDistInMap(pGenerator, 20.0f))
                {
                    m_sSortedGeneratorGuards[i].insert(pGuard->GetGUIDLow());
                    m_lGeneratorGuardGUIDs.erase(itr++);
                }
                else
                    ++itr;
            }
        }
    }
}
Beispiel #3
0
 void DoAction(int32 action)
 {
     switch (action)
     {
     case ACTION_ENTOURAGE_DIED:
         {
             //Delete the guid of the list if one dies.
             uint64 dead_entourage = 0;
             for (auto guid : entourage)
             {
                 Creature* c = me->GetMap()->GetCreature(guid);
                 if (!c)
                     continue;
                 if (c->isDead())
                 {
                     dead_entourage = guid;
                     break;
                 }
             }
             entourage.remove(dead_entourage);
             me->CastSpell(me, SPELL_RECKLESS_INSPIRATION, false);
             Talk(TALK_SPELL);
         }
         break;
     }
 }
Beispiel #4
0
        void UpdateAI(uint32 diff) override
        {
            if (CheckTimer <= diff)
            {
                if (!AnetheronGUID.IsEmpty())
                {
                    Creature* boss = ObjectAccessor::GetCreature(*me, AnetheronGUID);
                    if (!boss || boss->isDead())
                    {
                        me->setDeathState(JUST_DIED);
                        me->RemoveCorpse();
                        return;
                    }
                }
                CheckTimer = 5000;
            } else CheckTimer -= diff;

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

            if (ImmolationTimer <= diff)
            {
                DoCast(me, SPELL_IMMOLATION);
                ImmolationTimer = 5000;
            } else ImmolationTimer -= diff;

            DoMeleeAttackIfReady();
        }
Beispiel #5
0
        void MoveInLineOfSight(Unit * /*who*/)
        {
            if (!GridSearcherSucceeded)
            {
                FindChannelers();

                if (!Channelers.empty())
                {
                    for (std::list<uint64>::const_iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr)
                    {
                        Creature* Channeler = (Unit::GetCreature(*me, *itr));
                        if (Channeler)
                        {
                            if (Channeler->isDead())
                            {
                                Channeler->RemoveCorpse();
                                Channeler->Respawn();
                            }

                            Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
                            Channeler->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL_2, true);
                            Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
                            GridSearcherSucceeded = true;
                        }
                    }
                } else sLog->outError("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly");
            }
        }
Beispiel #6
0
        void UpdateAI(uint32 diff) override
        {
            if (CheckTimer <= diff)
            {
                if (AzgalorGUID)
                {
                    Creature* boss = ObjectAccessor::GetCreature(*me, AzgalorGUID);
                    if (!boss || boss->isDead())
                    {
                        me->DespawnOrUnsummon();
                        return;
                    }
                }
                CheckTimer = 5000;
            } else CheckTimer -= diff;

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

            if (WarstompTimer <= diff)
            {
                DoCast(me, SPELL_WARSTOMP);
                WarstompTimer = 10000 + rand32() % 5000;
            } else WarstompTimer -= diff;

            if (CrippleTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE);
                CrippleTimer = 25000 + rand32() % 5000;
            } else CrippleTimer -= diff;

            DoMeleeAttackIfReady();
        }
    void UpdateAI(const uint32 diff)
    {
        if (!UpdateVictim())
            return;

        if (Check_Timer <= diff)
        {
            Creature* Shaffar = me->FindNearestCreature(ENTRY_SHAFFAR, 100);
            if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat())
            {
                KillSelf();
                return;
            }
            Check_Timer = 1000;
        } else Check_Timer -= diff;

        if (ArcaneBolt_Timer <= diff)
        {
            DoCast(me->getVictim(),SPELL_ARCANE_BOLT);
            ArcaneBolt_Timer = 2000 + rand()%2500;
        } else ArcaneBolt_Timer -= diff;

        if (Apprentice_Timer <= diff)
        {
            if (me->IsNonMeleeSpellCasted(false))
                me->InterruptNonMeleeSpells(true);

            me->CastSpell(me,SPELL_ETHEREAL_APPRENTICE,true);
            if (me->isPet())
                ((Pet*)me)->SetDuration(0);
            KillSelf();
            return;
        } else Apprentice_Timer -= diff;
    }
Beispiel #8
0
    void UpdateAI(const uint32 diff)
    {
        if (CheckTimer <= diff)
        {
            if (AzgalorGUID)
            {
                Creature* boss = Unit::GetCreature((*me),AzgalorGUID);
                if (!boss || (boss && boss->isDead()))
                {
                    me->setDeathState(JUST_DIED);
                    me->RemoveCorpse();
                    return;
                }
            }
            CheckTimer = 5000;
        } else CheckTimer -= diff;

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

        if (WarstompTimer <= diff)
        {
            DoCast(me, SPELL_WARSTOMP);
            WarstompTimer = 10000+rand()%5000;
        } else WarstompTimer -= diff;

        if (CrippleTimer <= diff)
        {
            DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_CRIPPLE);
            CrippleTimer = 25000+rand()%5000;
        } else CrippleTimer -= diff;

        DoMeleeAttackIfReady();
    }
Beispiel #9
0
    Creature *RespawnNearbyBugsAndGetOne()
    {
        std::list<Creature*> lUnitList;
        GetCreatureListWithEntryInGrid(lUnitList,m_creature,15316,150.0f);
        GetCreatureListWithEntryInGrid(lUnitList,m_creature,15317,150.0f);

        if (lUnitList.empty())
            return NULL;

        Creature *nearb = NULL;

        for(std::list<Creature*>::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter)
        {
            Creature *c = (Creature *)(*iter);
            if (c->isDead())
            {
                c->Respawn();
                c->setFaction(7);
                c->RemoveAllAuras();
            }
            if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
            {
                if (!nearb || !urand(0, 3))
                    nearb = c;
            }
        }
        return nearb;
    }
    Creature* RespawnNearbyBugsAndGetOne()
    {
        std::list<Creature*> lUnitList;
        me->GetCreatureListWithEntryInGrid(lUnitList, 15316, 150.0f);
        me->GetCreatureListWithEntryInGrid(lUnitList, 15317, 150.0f);

        if (lUnitList.empty())
            return NULL;

        Creature* nearb = NULL;

        for (std::list<Creature*>::const_iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter)
        {
            Creature* c = *iter;
            if (c)
            {
                if (c->isDead())
                {
                    c->Respawn();
                    c->setFaction(7);
                    c->RemoveAllAuras();
                }
                if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE))
                {
                    if (!nearb || (rand32() % 4) == 0)
                        nearb = c;
                }
            }
        }
        return nearb;
    }
        void UpdateAI(const uint32 diff)
        {
            if (!UpdateVictim())
                return;

            if (Check_Timer <= diff)
            {
                Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
                if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat())
                {
                    KillSelf();
                    return;
                }
                Check_Timer = 1000;
            } else Check_Timer -= diff;

            if (ArcaneBolt_Timer <= diff)
            {
                DoCast(me->getVictim(), SPELL_ARCANE_BOLT);
                ArcaneBolt_Timer = urand(2000, 4500);
            } else ArcaneBolt_Timer -= diff;

            if (Apprentice_Timer <= diff)
            {
                if (me->IsNonMeleeSpellCasted(false))
                    me->InterruptNonMeleeSpells(true);

                DoCast(me, SPELL_ETHEREAL_APPRENTICE, true);
                me->DespawnOrUnsummon();
                return;
            } else Apprentice_Timer -= diff;
        }
        Creature* RespawnNearbyBugsAndGetOne()
        {
            CellCoord p(Oregon::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
            Cell cell(p);
            cell.SetNoCreate();

            std::list<Creature*> unitList;

            AnyBugCheck u_check(me, 150);
            Oregon::CreatureListSearcher<AnyBugCheck> searcher(me, unitList, u_check);
            TypeContainerVisitor<Oregon::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
            cell.Visit(p, grid_creature_searcher, *(me->GetMap()), *me, me->GetGridActivationRange());

            Creature* nearb = NULL;

            for (std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter)
            {
                Creature* c = (Creature*)(*iter);
                if (c && c->isDead())
                {
                    c->Respawn();
                    c->SetFaction(7);
                    c->RemoveAllAuras();
                }
                if (c->IsWithinDistInMap(me, ABUSE_BUG_RANGE))
                {
                    if (!nearb || (rand() % 4) == 0)
                        nearb = c;
                }
            }
            return nearb;
        }
Beispiel #13
0
    Creature *RespawnNearbyBugsAndGetOne()
    {
        CellPair p(Neo::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY()));
        Cell cell(p);
        cell.data.Part.reserved = ALL_DISTRICT;
        cell.SetNoCreate();

        std::list<Creature*> unitList;

        AnyBugCheck u_check(m_creature, 150);
        Neo::CreatureListSearcher<AnyBugCheck> searcher(unitList, u_check);
        TypeContainerVisitor<Neo::CreatureListSearcher<AnyBugCheck>, GridTypeMapContainer >  grid_creature_searcher(searcher);
        CellLock<GridReadGuard> cell_lock(cell, p);
        cell_lock->Visit(cell_lock, grid_creature_searcher, *(m_creature->GetMap()));

        Creature *nearb = NULL;

        for(std::list<Creature*>::iterator iter = unitList.begin(); iter != unitList.end(); ++iter)
        {
            Creature *c = (Creature *)(*iter);
            if (c && c->isDead())
            {
                c->Respawn();
                c->setFaction(7);
                c->RemoveAllAuras();
            }
            if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE))
            {
                if (!nearb || (rand()%4)==0)
                    nearb = c;
            }
        }
        return nearb;
    }
void WaypointMovementGenerator<Creature>::StartMove(Creature& creature)
{
    if (!i_path || i_path->empty())
        return;

    if (Stopped(creature))
        return;

    if (!creature.isAlive() || creature.hasUnitState(UNIT_STAT_NOT_MOVE))
        return;

    WaypointPath::const_iterator currPoint = i_path->find(i_currentNode);
    MANGOS_ASSERT(currPoint != i_path->end());

    if (WaypointBehavior* behavior = currPoint->second.behavior)
    {
        if (behavior->model2 != 0)
            creature.SetDisplayId(behavior->model2);
        creature.SetUInt32Value(UNIT_NPC_EMOTESTATE, 0);
    }

    if (m_isArrivalDone)
    {
        bool reachedLast = false;
        ++currPoint;
        if (currPoint == i_path->end())
        {
            reachedLast = true;
            currPoint = i_path->begin();
        }

        // Inform AI
        if (creature.AI() && m_PathOrigin == PATH_FROM_EXTERNAL &&  m_pathId > 0)
        {
            if (!reachedLast)
                creature.AI()->MovementInform(EXTERNAL_WAYPOINT_MOVE_START + m_pathId, currPoint->first);
            else
                creature.AI()->MovementInform(EXTERNAL_WAYPOINT_FINISHED_LAST + m_pathId, currPoint->first);

            if (creature.isDead() || !creature.IsInWorld()) // Might have happened with above calls
                return;
        }

        i_currentNode = currPoint->first;
    }

    m_isArrivalDone = false;

    creature.addUnitState(UNIT_STAT_ROAMING_MOVE);

    WaypointNode const& nextNode = currPoint->second;;
    Movement::MoveSplineInit init(creature);
    init.MoveTo(nextNode.x, nextNode.y, nextNode.z, true);

    if (nextNode.orientation != 100 && nextNode.delay != 0)
        init.SetFacing(nextNode.orientation);
    creature.SetWalk(!creature.hasUnitState(UNIT_STAT_RUNNING_STATE) && !creature.IsLevitating(), false);
    init.Launch();
}
Beispiel #15
0
            void UpdateAI(uint32 const diff)
            {
                if (!UpdateVictim())
                    return;

                if (me->GetDistance(me->GetHomePosition()) > 60.0f)
                {
                    // Not blizzlike, hack to avoid an exploit
                    EnterEvadeMode();
                    return;
                }

                if (me->HasAura(SPELL_RIFT_SHIELD))
                {
                    if (uiChaoticRiftGUID)
                    {
                        Creature* Rift = ObjectAccessor::GetCreature(*me, uiChaoticRiftGUID);
                        if (Rift && Rift->isDead())
                        {
                            me->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD);
                            uiChaoticRiftGUID = 0;
                        }
                        return;
                    }
                }
                else
                    uiChaoticRiftGUID = 0;

                if ((Phase == 0) && HealthBelowPct(50))
                {
                    Phase = 1;
                    Talk(SAY_SHIELD);
                    Talk(SAY_SHIELD_EMOTE);
                    DoCast(me, SPELL_RIFT_SHIELD);
                    if (Creature* Rift = me->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[urand(0, 5)], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000))
                    {
                        //DoCast(Rift, SPELL_CHARGE_RIFT);
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            Rift->AI()->AttackStart(target);
                        uiChaoticRiftGUID = Rift->GetGUID();
                        Talk(SAY_RIFT);
                        Talk(SAY_RIFT_EMOTE);
                    }
                }

                if (uiSparkTimer <= diff)
                {
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                        DoCast(target, SPELL_SPARK);
                    uiSparkTimer = 5000;
                }
                else
                    uiSparkTimer -= diff;

                DoMeleeAttackIfReady();
            }
 void EnterCombat(Unit* who)
 {
     // Send Shaffar to fight
     Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100);
     if (!Shaffar || Shaffar->isDead())
     {
         KillSelf();
         return;
     }
     if (!Shaffar->isInCombat())
         Shaffar->AI()->AttackStart(who);
 }
 void SummonChannelers()
 {
     for (uint8 i = 0; i < 5; ++i)
     {
         Creature* channeler = ObjectAccessor::GetCreature(*me, Channelers[i]);
         if (!channeler || channeler->isDead())
             channeler = me->SummonCreature(ENTRY_CHANNELER, ShadowmoonChannelers[i][0], ShadowmoonChannelers[i][1], ShadowmoonChannelers[i][2], ShadowmoonChannelers[i][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
         if (channeler)
             Channelers[i] = channeler->GetGUID();
         else
             Channelers[i].Clear();
     }
 }
 void JustDied(Unit* /*who*/)
 {
     for (int ni=0; ni<3; ++ni)
     {
         Creature* sent = Unit::GetCreature(*me, NearbyGUID[ni]);
         if (!sent)
             continue;
         if (sent->isDead())
             continue;
         sent->ModifyHealth(int32(sent->CountPctFromMaxHealth(50)));
         CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability);
     }
 }
 void SummonChannelers()
 {
     for(int i=0; i<5; ++i)
     {
         Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]);
         if(!channeler || channeler->isDead())
             channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000);
         if(channeler)
             Channelers[i] = channeler->GetGUID();
         else
             Channelers[i] = 0;
     }
 }
 void JustDied(Unit* /*killer*/) override
 {
     for (int ni = 0; ni < 3; ++ni)
     {
         Creature* sent = ObjectAccessor::GetCreature(*me, NearbyGUID[ni]);
         if (!sent)
             continue;
         if (sent->isDead())
             continue;
         sent->ModifyHealth(int32(sent->CountPctFromMaxHealth(50)));
         ENSURE_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability);
     }
 }
Beispiel #21
0
            void RespawnMinions()
            {
                // first respawn any aggroed wall minions
                for (std::vector<uint64>::const_iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i)
                {
                    Creature* target = instance->GetCreature(*i);
                    if (target && target->isDead())
                    {
                        target->Respawn();
                        target->GetMotionMaster()->MoveTargetedHome();
                        SetFrozenState(target);
                    }
                }

                // Vault Walkers
                for (std::vector<uint64>::const_iterator i = vaultWalkers.begin(); i != vaultWalkers.end(); ++i)
                {
                    Creature* target = instance->GetCreature(*i);
                    if (target && target->isDead())
                    {
                        target->Respawn();
                        target->GetMotionMaster()->MoveTargetedHome();
                        SetFrozenState(target);
                    }
                }

                // Earthen Guardians
                for (std::vector<uint64>::const_iterator i = earthenGuardians.begin(); i != earthenGuardians.end(); ++i)
                {
                    Creature* target = instance->GetCreature(*i);
                    if (target && target->isDead())
                    {
                        target->Respawn();
                        target->GetMotionMaster()->MoveTargetedHome();
                        SetFrozenState(target);
                    }
                }
            }
Beispiel #22
0
		void comprobarBosses(){
				Creature* boss = NULL;
				for(uint32 i = 0; i <= 5; i++ ){
					switch (i){
						case 0:
							boss = instance->GetCreature(uiMoragg);
							if(boss->isDead()){
								boss->Respawn();
								boss->RemoveLootMode(1);
							}
						 break;
						case 1:
							boss = instance->GetCreature(uiErekem);
							if(boss->isDead()){
								boss->Respawn();
								boss->RemoveLootMode(1);
								
								if(Creature* ayu1 = instance->GetCreature(uiErekemGuard[0])){
									ayu1->Respawn();
									ayu1->RemoveLootMode(1);
								}
								if(Creature* ayu2 = instance->GetCreature(uiErekemGuard[1])){
									ayu2->Respawn();
									ayu2->RemoveLootMode(1);
								}
							}
						 break;
						case 2:
							boss = instance->GetCreature(uiIchoron);
							if(boss->isDead()){
								boss->Respawn();
								boss->RemoveLootMode(1);
							}
							break;
						case 3:
							boss = instance->GetCreature(uiLavanthor);
							if(boss->isDead()){
								boss->Respawn();
								boss->RemoveLootMode(1);
							}
							break;
						case 4:
							boss = instance->GetCreature(uiXevozz);
							if(boss->isDead()){
								boss->Respawn();
								boss->RemoveLootMode(1);
							}
							break;
						case 5:
							boss = instance->GetCreature(uiZuramat);
							if(boss->isDead()){
								boss->Respawn();
								boss->RemoveLootMode(1);
							}
							break;
					}
				}
		}
        void UpdateAI(uint32 const diff)
        {
            if (!VorpilGUID)
            {
                me->Kill(me);
                return;
            }

            if (move <= diff)
            {
                Creature* Vorpil = Unit::GetCreature(*me, VorpilGUID);
                if (!Vorpil)
                {
                    VorpilGUID = 0;
                    return;
                }

                if (sacrificed)
                {
                    if (Vorpil->isAlive())
                    {
                        me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS, H_SPELL_EMPOWERING_SHADOWS), Vorpil);
                        Vorpil->ModifyHealth(int32(Vorpil->CountPctFromMaxHealth(4)));
                    }
                    DoCast(me, SPELL_SHADOW_NOVA, true);
                    me->Kill(me);
                    return;
                }

                me->GetMotionMaster()->MoveFollow(Vorpil, 0, 0);

                if (me->IsWithinDist(Vorpil, 3))
                {
                    DoCast(me, SPELL_SACRIFICE, false);
                    sacrificed = true;
                    move = 500;
                    return;
                }

                if (!Vorpil->isInCombat() || Vorpil->isDead())
                {
                    me->Kill(me);
                    return;
                }
                move = 1000;
            }
            else
                move -= diff;
        }
Beispiel #24
0
		void UpdateAI(const uint32 diff)
		{	
			if (pTarget == NULL || !isAtAnEgg || me->HasUnitState(UNIT_STAT_CASTING))
				return;

			events.Update(diff);

			while (uint32 eventId = events.ExecuteEvent())
			{
				switch (eventId)
				{
				case EVENT_CAST_SHIELD_OF_NIGHTMARE_DELAY:
					DoCast(me, SPELL_SHIELD_OF_NIGHTMARE, true);
					break;

				default:
					break;
				}
			}

			if(isCastingUmbraMending)
			{	// If the Egg is Death and Umbra Mending was casted go to the next Egg

				pTarget = GetNextEgg();

				if(pTarget != NULL) // Solves Crashes if the Faceless killed all eggs
					me->GetMotionMaster()->MovePoint(POINT_FACELESS_IS_AT_AN_EGG,pTarget->GetPositionX(),pTarget->GetPositionY(),pTarget->GetPositionZ());

				isAtAnEgg = false;
				isCastingUmbraMending = false;

				return;
			}

			if(pTarget->isDead())
			{
				if(Unit* pErudax = me->FindNearestCreature(BOSS_ERUDAX,1000.0f, true))
					DoCast(pErudax, SPELL_UMBRAL_MENDING,false);

				isCastingUmbraMending = true;

				return;
			}

			pTarget->AI()->DoZoneInCombat();

			DoCast(pTarget,SPELL_TWILIGHT_CORRUPTION_DOT,true);
			DoCast(pTarget,SPELL_TWILIGHT_CORRUPTION_VISUAL,true);
		}
Beispiel #25
0
 void JustDied(Unit* /*killer*/)
 {
     if(pInstance && pInstance->GetData(DATA_SINDRAGOSA_EVENT) != DONE)
     {
         Creature* dragon = Unit::GetCreature(*me, pInstance->GetData64(DATA_RIMEFANG));
         if(dragon && dragon->isDead())
         {
             Creature* DragonBoss = me->SummonCreature(CREATURE_SINDRAGOSA, SpawnLoc[1], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000);
             /*if(DragonBoss)
             {
                 DragonBoss->GetMotionMaster()->MovePoint(0, SpawnLoc[1]);
             }*/
         }
     }
 }
Beispiel #26
0
    void JustDied(Unit* Killer)
    {
        DoScriptText(SAY_BLAU_DEATH, m_creature);

        if (m_pInstance)
        {
            Creature* pZeliek = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_ZELIEK));
            Creature* pThane = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_THANE));
            Creature* pRivendare = m_creature->GetMap()->GetCreature(m_pInstance->GetData64(NPC_RIVENDARE));
            if (pZeliek && pThane && pRivendare && pZeliek->isDead() && pThane->isDead() && pRivendare->isDead())
            {
                m_pInstance->SetData(TYPE_FOUR_HORSEMEN, DONE);
                 

                Map* pMap = m_creature->GetMap();
                if (pMap && pMap->IsDungeon())
                {
                    Map::PlayerList const &players = pMap->GetPlayers();
                    for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
                        itr->getSource()->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_BE_SPELL_TARGET, ACHIEV_MILITARY);
                }
            }
        }
    }
Beispiel #27
0
		// used when Archaedas dies.  All active minions must be despawned.
		void DeActivateMinions() {
			// first despawn any aggroed wall minions
			for (std::vector<uint64>::const_iterator i =
					vArchaedasWallMinions.begin();
					i != vArchaedasWallMinions.end(); ++i) {
				Creature *pTarget = instance->GetCreature(*i);
				if (!pTarget || pTarget->isDead()
						|| pTarget->getFaction() != 14)
					continue;
				pTarget->setDeathState(JUST_DIED);
				pTarget->RemoveCorpse();
			}

			// Vault Walkers
			for (std::vector<uint64>::const_iterator i = vVaultWalker.begin();
					i != vVaultWalker.end(); ++i) {
				Creature *pTarget = instance->GetCreature(*i);
				if (!pTarget || pTarget->isDead()
						|| pTarget->getFaction() != 14)
					continue;
				pTarget->setDeathState(JUST_DIED);
				pTarget->RemoveCorpse();
			}

			// Earthen Guardians
			for (std::vector<uint64>::const_iterator i =
					vEarthenGuardian.begin(); i != vEarthenGuardian.end();
					++i) {
				Creature *pTarget = instance->GetCreature(*i);
				if (!pTarget || pTarget->isDead()
						|| pTarget->getFaction() != 14)
					continue;
				pTarget->setDeathState(JUST_DIED);
				pTarget->RemoveCorpse();
			}
		}
		void Reset()
		{
			if(Ignacious->isDead())
				Ignacious->Respawn();

			me->SetVisible(true);			
			me->SetReactState(REACT_AGGRESSIVE);
			me->GetMotionMaster()->MoveTargetedHome();
			me->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);

			phase = 1;

			instance->SetData(DATA_ASCENDANT_PHASE, 1);
			DespawnMinions();
		}
 void JustDied(Unit* /*who*/)
 {
     for (int ni=0; ni<3; ++ni)
     {
         Creature* sent = nearby[ni];
         if (!sent)
             continue;
         if (sent->isDead())
             continue;
         uint32 h = sent->GetHealth() + (sent->GetMaxHealth() / 2);
         if (h > sent->GetMaxHealth())
             h = sent->GetMaxHealth();
         sent->SetHealth(h);
         CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability);
     }
 }
            void SummonChannelers()
            {
                for (uint8 i = 0; i < 5; ++i)
                {
                    Creature* channeler = ObjectAccessor::GetCreature(*me, channelers[i]);
					if (channeler && channeler->isDead())
					{
						channeler->DespawnOrUnsummon(1);
						channeler = NULL;
					}
                    if (!channeler)
                        channeler = me->SummonCreature(NPC_CHANNELER, ShadowmoonChannelers[i][0], ShadowmoonChannelers[i][1], ShadowmoonChannelers[i][2], ShadowmoonChannelers[i][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);

					channelers[i] = channeler ? channeler->GetGUID() : 0;
                }
            }