Пример #1
0
void hyjalAI::Retreat()
{
    if (instance)
    {
        instance->SetData(TYPE_RETREAT, SPECIAL);

        if (Faction == 0)
        {
            instance->SetData(DATA_ALLIANCE_RETREAT, 1);
            AddWaypoint(0, JainaWPs[0][0], JainaWPs[0][1], JainaWPs[0][2]);
            AddWaypoint(1, JainaWPs[1][0], JainaWPs[1][1], JainaWPs[1][2]);
            Start(false, false);
            SetDespawnAtEnd(false);//move to center of alliance base
        }
        if (Faction == 1)
        {
            instance->SetData(DATA_HORDE_RETREAT, 1);
            Creature* JainaDummy = me->SummonCreature(JAINA, JainaDummySpawn[0][0], JainaDummySpawn[0][1], JainaDummySpawn[0][2], JainaDummySpawn[0][3], TEMPSUMMON_TIMED_DESPAWN, 60000);
            if (JainaDummy)
            {
                JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true;
                DummyGuid = JainaDummy->GetGUID();
            }
            AddWaypoint(0, JainaDummySpawn[1][0], JainaDummySpawn[1][1], JainaDummySpawn[1][2]);
            Start(false, false);
            SetDespawnAtEnd(false);//move to center of alliance base
        }
    }
    SpawnVeins();
    Overrun = true;
    me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started
}
Пример #2
0
 npc_stinkbeardAI(Creature* pCreature) : npc_escortAI(pCreature)
 {
     me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE);
     me->SetReactState(REACT_PASSIVE);
     Start(true,true, 0, NULL);
     SetDespawnAtEnd(false);
 }
Пример #3
0
 npc_argent_soldierAI(Creature* pCreature) : npc_escortAI(pCreature)
 {
     pInstance = pCreature->GetInstanceData();
    // me->SetReactState(REACT_DEFENSIVE);
     SetDespawnAtEnd(false);
     uiWaypoint = 0;
 }
Пример #4
0
 npc_amani_eagleAI(Creature *c) : npc_escortAI(c)
 {
     pInstance = c->GetInstanceData();
     me->setActive(true);
     SetDespawnAtEnd(false);
     Reset();
 }
Пример #5
0
        void UpdateAI(uint32 diff) override
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!go)
                {
                    go = true;
                    AddWaypoint(0, 5492.91f,    -2404.61f,    1462.63f);
                    AddWaypoint(1, 5531.76f,    -2460.87f,    1469.55f);
                    AddWaypoint(2, 5554.58f,    -2514.66f,    1476.12f);
                    AddWaypoint(3, 5554.16f,    -2567.23f,    1479.90f);
                    AddWaypoint(4, 5540.67f,    -2625.99f,    1480.89f);
                    AddWaypoint(5, 5508.16f,    -2659.2f,    1480.15f);
                    AddWaypoint(6, 5489.62f,    -2704.05f,    1482.18f);
                    AddWaypoint(7, 5457.04f,    -2726.26f,    1485.10f);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }

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

            if (RainTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true), SPELL_RAIN_OF_FIRE);
                RainTimer = 20000+rand()%15000;
            } else RainTimer -= diff;

            if (DoomTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true), SPELL_DOOM);//never on tank
                DoomTimer = 45000+rand()%5000;
            } else DoomTimer -= diff;

            if (HowlTimer <= diff)
            {
                DoCast(me, SPELL_HOWL_OF_AZGALOR);
                HowlTimer = 30000;
            } else HowlTimer -= diff;

            if (CleaveTimer <= diff)
            {
                DoCastVictim(SPELL_CLEAVE);
                CleaveTimer = 10000+rand()%5000;
            } else CleaveTimer -= diff;

            if (EnrageTimer < diff && !enraged)
            {
                me->InterruptNonMeleeSpells(false);
                DoCast(me, SPELL_BERSERK, true);
                enraged = true;
                EnrageTimer = 600000;
            } else EnrageTimer -= diff;

            DoMeleeAttackIfReady();
        }
Пример #6
0
 npc_argent_soldierAI(Creature* creature) : npc_escortAI(creature)
 {
     pInstance = creature->GetInstanceScript();
     me->SetReactState(REACT_DEFENSIVE);
     SetDespawnAtEnd(false);
     uiWaypoint = 0;
 }
Пример #7
0
    generic_vehicleAI_toc5AI(Creature* pCreature) : npc_escortAI(pCreature), pVehicle(pCreature->GetVehicleKit())
    {
        SetDespawnAtEnd(false);
        uiWaypointPath = 0;

        pInstance = pCreature->GetInstanceData();
    }
Пример #8
0
        generic_vehicleAI_toc5AI(Creature* creature) : npc_escortAI(creature)
        {
            SetDespawnAtEnd(false);
            uiWaypointPath = 0;

            instance = creature->GetInstanceScript();
        }
Пример #9
0
            void UpdateEscortAI(uint32 diff)
            {
                events.Update(diff);
                switch (events.ExecuteEvent())
                {
                    case EVENT_RESUME_PATH:
                        SetEscortPaused(false);
                        if (Creature* talker = headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
                            talker->AI()->Talk(SAY_CARAVAN_LEAVE);

                        headNorth = !headNorth;
                        break;
                    case EVENT_WAIT_FOR_ASSIST:
                        SetEscortPaused(false);
                        if (Creature* active = !headNorth ? me : ObjectAccessor::GetCreature(*me, summons[0]))
                            active->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
                        break;
                    case EVENT_RESTART_ESCORT:
                        CheckCaravan();
                        SetDespawnAtEnd(false);
                        Start(true, true, 0, 0, false, false, true);
                        break;
                }

                if (!UpdateVictim())
                    return;

                DoMeleeAttackIfReady();
            }
        void UpdateAI(uint32 diff)
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!go)
                {
                    go = true;
                    AddWaypoint(0, 4896.08f,    -1576.35f,    1333.65f);
                    AddWaypoint(1, 4898.68f,    -1615.02f,    1329.48f);
                    AddWaypoint(2, 4907.12f,    -1667.08f,    1321.00f);
                    AddWaypoint(3, 4963.18f,    -1699.35f,    1340.51f);
                    AddWaypoint(4, 4989.16f,    -1716.67f,    1335.74f);
                    AddWaypoint(5, 5026.27f,    -1736.89f,    1323.02f);
                    AddWaypoint(6, 5037.77f,    -1770.56f,    1324.36f);
                    AddWaypoint(7, 5067.23f,    -1789.95f,    1321.17f);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }

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

            if (SwarmTimer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    DoCast(target, SPELL_CARRION_SWARM);

                SwarmTimer = urand(45000, 60000);
                Talk(SAY_SWARM);
            } else SwarmTimer -= diff;

            if (SleepTimer <= diff)
            {
                for (uint8 i = 0; i < 3; ++i)
                {
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                        target->CastSpell(target, SPELL_SLEEP, true);
                }
                SleepTimer = 60000;
                Talk(SAY_SLEEP);
            } else SleepTimer -= diff;
            if (AuraTimer <= diff)
            {
                DoCast(me, SPELL_VAMPIRIC_AURA, true);
                AuraTimer = urand(10000, 20000);
            } else AuraTimer -= diff;
            if (InfernoTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
                InfernoTimer = 45000;
                Talk(SAY_INFERNO);
            } else InfernoTimer -= diff;

            DoMeleeAttackIfReady();
        }
Пример #11
0
 void Reset()
 {
     SetDespawnAtEnd(false);
     SetDespawnAtFar(false);
     onplace = false;
     wavetimer = 0;
     waves = 0;
 }
Пример #12
0
 npc_argent_soldierAI(Creature* creature) : npc_escortAI(creature)
 {
     instance = creature->GetInstanceScript();
     me->SetReactState(REACT_DEFENSIVE);
     me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
     me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE);
     SetDespawnAtEnd(false);
     uiWaypoint = 0;
 }
Пример #13
0
    void UpdateAI(uint32)
    {
        if (instance && instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS)
            me->CastStop();

        if (!bHasGotMovingPoints)
        {
            bHasGotMovingPoints = true;
                switch (portalLocationID)
            {
                case 0:
                    for (int i=0;i<6;i++)
                        AddWaypoint(i, FirstPortalWPs[i][0]+irand(-1, 1), FirstPortalWPs[i][1]+irand(-1, 1), FirstPortalWPs[i][2]+irand(-1, 1), 0);
                    me->SetHomePosition(FirstPortalWPs[5][0], FirstPortalWPs[5][1], FirstPortalWPs[5][2], 3.149439f);
                    break;
                case 1:
                    secondPortalRouteID = urand(0, 1);
                    switch (secondPortalRouteID)
                    {
                        case 0:
                            for (int i=0;i<9;i++)
                                AddWaypoint(i, SecondPortalFirstWPs[i][0]+irand(-1, 1), SecondPortalFirstWPs[i][1]+irand(-1, 1), SecondPortalFirstWPs[i][2], 0);
                            me->SetHomePosition(SecondPortalFirstWPs[8][0]+irand(-1, 1), SecondPortalFirstWPs[8][1]+irand(-1, 1), SecondPortalFirstWPs[8][2]+irand(-1, 1), 3.149439f);
                            break;
                        case 1:
                            for (int i=0;i<8;i++)
                                AddWaypoint(i, SecondPortalSecondWPs[i][0]+irand(-1, 1), SecondPortalSecondWPs[i][1]+irand(-1, 1), SecondPortalSecondWPs[i][2], 0);
                            me->SetHomePosition(SecondPortalSecondWPs[7][0], SecondPortalSecondWPs[7][1], SecondPortalSecondWPs[7][2], 3.149439f);
                            break;
                    }
                    break;
                case 2:
                    for (int i=0;i<8;i++)
                        AddWaypoint(i, ThirdPortalWPs[i][0]+irand(-1, 1), ThirdPortalWPs[i][1]+irand(-1, 1), ThirdPortalWPs[i][2], 0);
                        me->SetHomePosition(ThirdPortalWPs[7][0], ThirdPortalWPs[7][1], ThirdPortalWPs[7][2], 3.149439f);
                    break;
                case 3:
                    for (int i=0;i<9;i++)
                        AddWaypoint(i, FourthPortalWPs[i][0]+irand(-1, 1), FourthPortalWPs[i][1]+irand(-1, 1), FourthPortalWPs[i][2], 0);
                    me->SetHomePosition(FourthPortalWPs[8][0], FourthPortalWPs[8][1], FourthPortalWPs[8][2], 3.149439f);
                    break;
                case 4:
                    for (int i=0;i<6;i++)
                        AddWaypoint(i, FifthPortalWPs[i][0]+irand(-1, 1), FifthPortalWPs[i][1]+irand(-1, 1), FifthPortalWPs[i][2], 0);
                    me->SetHomePosition(FifthPortalWPs[5][0], FifthPortalWPs[5][1], FifthPortalWPs[5][2], 3.149439f);
                    break;
                case 5:
                    for (int i=0;i<4;i++)
                        AddWaypoint(i, SixthPoralWPs[i][0]+irand(-1, 1), SixthPoralWPs[i][1]+irand(-1, 1), SixthPoralWPs[i][2], 0);
                    me->SetHomePosition(SixthPoralWPs[3][0], SixthPoralWPs[3][1], SixthPoralWPs[3][2], 3.149439f);
                    break;
            }
            SetDespawnAtEnd(false);
            Start(true, true);
        }
    }
Пример #14
0
        void UpdateAI(const uint32 diff)
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!go)
                {
                    go = true;
                    if (instance)
                    {
                        AddWaypoint(0, 4896.08f,    -1576.35f,    1333.65f);
                        AddWaypoint(1, 4898.68f,    -1615.02f,    1329.48f);
                        AddWaypoint(2, 4907.12f,    -1667.08f,    1321.00f);
                        AddWaypoint(3, 4963.18f,    -1699.35f,    1340.51f);
                        AddWaypoint(4, 4989.16f,    -1716.67f,    1335.74f);
                        AddWaypoint(5, 5026.27f,    -1736.89f,    1323.02f);
                        AddWaypoint(6, 5037.77f,    -1770.56f,    1324.36f);
                        AddWaypoint(7, 5067.23f,    -1789.95f,    1321.17f);
                        Start(false, true);
                        SetDespawnAtEnd(false);
                    }
                }
            }

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

            if (FrostArmorTimer <= diff)
            {
                DoCast(me, SPELL_FROST_ARMOR);
                FrostArmorTimer = 40000+rand()%20000;
            } else FrostArmorTimer -= diff;
            if (DecayTimer <= diff)
            {
                DoCastVictim(SPELL_DEATH_AND_DECAY);
                DecayTimer = 60000+rand()%20000;
                Talk(SAY_DECAY);
            } else DecayTimer -= diff;
            if (NovaTimer <= diff)
            {
                DoCastVictim(SPELL_FROST_NOVA);
                NovaTimer = 30000+rand()%15000;
                Talk(SAY_NOVA);
            } else NovaTimer -= diff;
            if (IceboltTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 40, true), SPELL_ICEBOLT);
                IceboltTimer = 11000+rand()%20000;
            } else IceboltTimer -= diff;

            DoMeleeAttackIfReady();
        }
Пример #15
0
    void UpdateAI(uint32 diff)
    {
        if (!bAddedWP)
        {
            bAddedWP = true;
            switch(PLoc)
            {
                case 0:
                    for(int i=0;i<6;i++)
                        AddWaypoint(i, FirstPortalTrashWPs[i][0]+irand(-1, 1), FirstPortalTrashWPs[i][1]+irand(-1, 1), FirstPortalTrashWPs[i][2]+irand(-1, 1), 0);
                    me->SetHomePosition(FirstPortalTrashWPs[5][0], FirstPortalTrashWPs[5][1], FirstPortalTrashWPs[5][2], 3.149439f);
                    break;
                case 1:
                    bAlt = (bool)urand(0, 1);
                    if (!bAlt)
                    {
                        for(int i=0;i<9;i++)
                            AddWaypoint(i, SecondPortalTrashWPs1[i][0]+irand(-1, 1), SecondPortalTrashWPs1[i][1]+irand(-1, 1), SecondPortalTrashWPs1[i][2], 0);
                        me->SetHomePosition(SecondPortalTrashWPs1[8][0]+irand(-1, 1), SecondPortalTrashWPs1[8][1]+irand(-1, 1), SecondPortalTrashWPs1[8][2]+irand(-1, 1), 3.149439f);
                    }
                    else
                    {
                        for(int i=0;i<8;i++)
                            AddWaypoint(i, SecondPortalTrashWPs2[i][0]+irand(-1, 1), SecondPortalTrashWPs2[i][1]+irand(-1, 1), SecondPortalTrashWPs2[i][2], 0);
                        me->SetHomePosition(SecondPortalTrashWPs2[7][0], SecondPortalTrashWPs2[7][1], SecondPortalTrashWPs2[7][2], 3.149439f);
                    }
                    break;
                case 2:
                    for(int i=0;i<8;i++)
                        AddWaypoint(i, ThirdPortalTrashWPs[i][0]+irand(-1, 1), ThirdPortalTrashWPs[i][1]+irand(-1, 1), ThirdPortalTrashWPs[i][2], 0);
                    me->SetHomePosition(ThirdPortalTrashWPs[7][0], ThirdPortalTrashWPs[7][1], ThirdPortalTrashWPs[7][2], 3.149439f);
                    break;
                case 3:
                    for(int i=0;i<9;i++)
                        AddWaypoint(i, FourthPortalTrashWPs[i][0]+irand(-1, 1), FourthPortalTrashWPs[i][1]+irand(-1, 1), FourthPortalTrashWPs[i][2], 0);
                    me->SetHomePosition(FourthPortalTrashWPs[8][0], FourthPortalTrashWPs[8][1], FourthPortalTrashWPs[8][2], 3.149439f);
                    break;
                case 4:
                    for(int i=0;i<6;i++)
                        AddWaypoint(i, FifthPortalTrashWPs[i][0]+irand(-1, 1), FifthPortalTrashWPs[i][1]+irand(-1, 1), FifthPortalTrashWPs[i][2], 0);
                    me->SetHomePosition(FifthPortalTrashWPs[5][0], FifthPortalTrashWPs[5][1], FifthPortalTrashWPs[5][2], 3.149439f);
                    break;
                case 5:
                    for(int i=0;i<4;i++)
                        AddWaypoint(i, SixthPoralTrashWPs[i][0]+irand(-1, 1), SixthPoralTrashWPs[i][1]+irand(-1, 1), SixthPoralTrashWPs[i][2], 0);
                    me->SetHomePosition(SixthPoralTrashWPs[3][0], SixthPoralTrashWPs[3][1], SixthPoralTrashWPs[3][2], 3.149439f);
                    break;
            }
            SetDespawnAtEnd(false);
            Start(true, true);
        }

        npc_escortAI::UpdateAI(diff);
    }
Пример #16
0
        void UpdateAI(const uint32 diff)
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!go)
                {
                    go = true;
                    if (instance)
                    {
                        AddWaypoint(0, 5492.91f,    -2404.61f,    1462.63f);
                        AddWaypoint(1, 5531.76f,    -2460.87f,    1469.55f);
                        AddWaypoint(2, 5554.58f,    -2514.66f,    1476.12f);
                        AddWaypoint(3, 5554.16f,    -2567.23f,    1479.90f);
                        AddWaypoint(4, 5540.67f,    -2625.99f,    1480.89f);
                        AddWaypoint(5, 5508.16f,    -2659.2f,    1480.15f);
                        AddWaypoint(6, 5489.62f,    -2704.05f,    1482.18f);
                        AddWaypoint(7, 5457.04f,    -2726.26f,    1485.10f);
                        Start(false, true);
                        SetDespawnAtEnd(false);
                    }
                }
            }

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

            if (CleaveTimer <= diff)
            {
                DoCast(me, SPELL_CLEAVE);
                CleaveTimer = 6000+rand()%15000;
            } else CleaveTimer -= diff;

            if (WarStompTimer <= diff)
            {
                DoCast(me, SPELL_WARSTOMP);
                WarStompTimer = 60000;
            } else WarStompTimer -= diff;

            if (MarkTimer <= diff)
            {
                DoCastAOE(SPELL_MARK);

                MarkTimerBase -= 5000;
                if (MarkTimerBase < 5500)
                    MarkTimerBase = 5500;
                MarkTimer = MarkTimerBase;
                Talk(SAY_MARK);
            } else MarkTimer -= diff;

            DoMeleeAttackIfReady();
        }
Пример #17
0
 npc_argent_soldierAI(Creature* creature) : npc_escortAI(creature)
 {
     pInstance = creature->GetInstanceScript();
     me->SetReactState(REACT_PASSIVE);
     me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE);
     me->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_SELECTABLE);
     if (GameObject* pGO = GameObject::GetGameObject(*me, pInstance->GetData64(DATA_MAIN_GATE)))
         pInstance->HandleGameObject(pGO->GetGUID(),true);    					
     SetDespawnAtEnd(false);
     uiWaypoint = 0;
     bStarted = false;
 }
Пример #18
0
 npc_barnesAI(Creature* c) : npc_escortAI(c)
 {
     SetDespawnAtEnd(false);
     RaidWiped = false;
     m_uiEventId = 0;
     pInstance = (ScriptedInstance*)c->GetInstanceData();
     SpellEntry* TempSpell = GET_SPELL(29683);
     TempSpell->Effect[2] = 27;
     TempSpell->EffectBaseDice[2] = 1;
     TempSpell->EffectDieSides[2] = 1;
     TempSpell->EffectBasePoints[2] = 49;
     TempSpell->EffectImplicitTargetA[2] = 18;
     TempSpell->EffectImplicitTargetB[2] = 16;
     TempSpell->EffectRadiusIndex[2] = 7;
     TempSpell->EffectApplyAuraName[2] = 79;
     TempSpell->EffectMiscValue[2] = 127;
 }
Пример #19
0
        void UpdateAI(uint32 diff)
        {
            if (instance && instance->GetData(DATA_MAIN_EVENT_PHASE) != IN_PROGRESS)
                me->CastStop();

            npc_escortAI::UpdateAI(diff);

            if (!bHasGotMovingPoints)
            {
                bHasGotMovingPoints = true;
                switch (uiBoss)
                {
                    case 1:
                        for (int i=0;i<3;i++)
                            AddWaypoint(i, SaboteurFinalPos1[i][0], SaboteurFinalPos1[i][1], SaboteurFinalPos1[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos1[2][0], SaboteurFinalPos1[2][1], SaboteurFinalPos1[2][2], 4.762346f);
                        break;
                    case 2:
                        for (int i=0;i<3;i++)
                            AddWaypoint(i, SaboteurFinalPos2[i][0], SaboteurFinalPos2[i][1], SaboteurFinalPos2[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos2[2][0], SaboteurFinalPos2[2][1], SaboteurFinalPos2[2][2], 1.862674f);
                        break;
                    case 3:
                        for (int i=0;i<2;i++)
                            AddWaypoint(i, SaboteurFinalPos3[i][0], SaboteurFinalPos3[i][1], SaboteurFinalPos3[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos3[1][0], SaboteurFinalPos3[1][1], SaboteurFinalPos3[1][2], 5.500638f);
                        break;
                    case 4:
                        AddWaypoint(0, SaboteurFinalPos4[0], SaboteurFinalPos4[1], SaboteurFinalPos4[2], 0);
                        me->SetHomePosition(SaboteurFinalPos4[0], SaboteurFinalPos4[1], SaboteurFinalPos4[2], 3.991108f);
                        break;
                    case 5:
                        AddWaypoint(0, SaboteurFinalPos5[0], SaboteurFinalPos5[1], SaboteurFinalPos5[2], 0);
                        me->SetHomePosition(SaboteurFinalPos5[0], SaboteurFinalPos5[1], SaboteurFinalPos5[2], 1.100841f);
                        break;
                    case 6:
                        for (int i=0;i<5;i++)
                            AddWaypoint(i, SaboteurFinalPos6[i][0], SaboteurFinalPos6[i][1], SaboteurFinalPos6[i][2], 0);
                        me->SetHomePosition(SaboteurFinalPos6[4][0], SaboteurFinalPos6[4][1], SaboteurFinalPos6[4][2], 0.983031f);
                        break;
                }

                SetDespawnAtEnd(false);
                Start(true, true);
            }
        }
Пример #20
0
 void DoAction (uint32 action)
 {
     switch (action)
     {
     case BOSS_PULL:
         for (uint8 i=0;i<2;i++)
         {
             if (!i)
                 AddWaypoint(i,XevozzOutWP[i][0],XevozzOutWP[i][1],XevozzOutWP[i][2],3000);
             else
                 AddWaypoint(i,XevozzOutWP[i][0],XevozzOutWP[i][1],XevozzOutWP[i][2]);
         }
         SetDespawnAtEnd(false);
         BossStartTimer=5000;
         DoScriptText(SAY_SPAWN,m_creature);
         break;
     }
 }
Пример #21
0
 void DoAction(uint32 action)
 {
     switch (action)
     {
     case BOSS_PULL:
         //m_creature->MonsterSay("Prej me pullnuli",0,m_creature->GetGUID());
         for (uint8 i=0;i<2;i++)
         {
             if (!i)
                 AddWaypoint(i,MoraggOutWP[i][0],MoraggOutWP[i][1],MoraggOutWP[i][2],3000);
             else
                 AddWaypoint(i,MoraggOutWP[i][0],MoraggOutWP[i][1],MoraggOutWP[i][2]);
         }
         SetDespawnAtEnd(false);
         BossStartTimer=5000;
         break;
     }
 }
Пример #22
0
        bool GossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
        {
            uint32 const action = player->PlayerTalkClass->GetGossipOptionAction(gossipListId);
            ClearGossipMenuFor(player);
            if (action == GOSSIP_ACTION_INFO_DEF + 1)
            {
                CloseGossipMenuFor(player);
                if (instance)
                    instance->SetData(TYPE_NARALEX_EVENT, IN_PROGRESS);

                Talk(SAY_MAKE_PREPARATIONS);

                me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_ACTIVE);
                me->SetImmuneToPC(false);

                Start(false, false, player->GetGUID());
                SetDespawnAtFar(false);
                SetDespawnAtEnd(false);
            }
            return true;
        }
Пример #23
0
 void DoAction(uint32 action)
 {
     switch (action)
     {
     case BOSS_PULL:
         DoScriptText(SAY_SPAWN,m_creature);
         for (uint8 i=0;i<2;i++)
         {
             if (!i)
                 AddWaypoint(i,ErekemOutWP[i][0],ErekemOutWP[i][1],ErekemOutWP[i][2],3000);
             else
                 AddWaypoint(i,ErekemOutWP[i][0],ErekemOutWP[i][1],ErekemOutWP[i][2]);
         }
         SetDespawnAtEnd(false);
         BossStartTimer=5000;
         std::list<Creature*> lUnitList;
         GetCreatureListWithEntryInGrid(lUnitList, m_creature, NPC_EREKEM_GUARD, 100.0f);
         if (!lUnitList.empty())
             for(std::list<Creature*>::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter)
                 if ((*iter))
                     (*iter)->AI()->DoAction(BOSS_PULL);
         break;
     }
 }
Пример #24
0
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if (!pGo)
            {
                pGo = true;
                if (pInstance)
                {
                    AddWaypoint(0, 5492.91,    -2404.61,    1462.63);
                    AddWaypoint(1, 5531.76,    -2460.87,    1469.55);
                    AddWaypoint(2, 5554.58,    -2514.66,    1476.12);
                    AddWaypoint(3, 5554.16,    -2567.23,    1479.90);
                    AddWaypoint(4, 5540.67,    -2625.99,    1480.89);
                    AddWaypoint(5, 5508.16,    -2659.2,    1480.15);
                    AddWaypoint(6, 5489.62,    -2704.05,    1482.18);
                    AddWaypoint(7, 5457.04,    -2726.26,    1485.10);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

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

        if (CleaveTimer < diff)
        {
            DoCast(m_creature, SPELL_CLEAVE);
            CleaveTimer = 6000+rand()%15000;
        }else CleaveTimer -= diff;

        if (WarStompTimer < diff)
        {
            DoCast(m_creature, SPELL_WARSTOMP);
            WarStompTimer = 60000;
        }else WarStompTimer -= diff;

        if (m_creature->HasAura(SPELL_MARK))
            m_creature->RemoveAurasDueToSpell(SPELL_MARK);
        if (MarkTimer < diff)
        {
            //cast dummy, useful for bos addons
            m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID());

            std::list<HostilReference *> t_list = m_creature->getThreatManager().getThreatList();
            for(std::list<HostilReference *>::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
            {
                Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid());
                if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA)
                {
                    target->CastSpell(target, SPELL_MARK,true);//only cast on mana users
                }
            }
            MarkTimerBase -= 5000;
            if (MarkTimerBase < 5500)
                MarkTimerBase = 5500;
            MarkTimer = MarkTimerBase;
            switch(rand()%3)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_MARK1);
                    m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_MARK2);
                    m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }else MarkTimer -= diff;

        DoMeleeAttackIfReady();
    }
Пример #25
0
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if (!pGo)
            {
                pGo = true;
                if (pInstance)
                {
                    AddWaypoint(0, 4896.08,    -1576.35,    1333.65);
                    AddWaypoint(1, 4898.68,    -1615.02,    1329.48);
                    AddWaypoint(2, 4907.12,    -1667.08,    1321.00);
                    AddWaypoint(3, 4963.18,    -1699.35,    1340.51);
                    AddWaypoint(4, 4989.16,    -1716.67,    1335.74);
                    AddWaypoint(5, 5026.27,    -1736.89,    1323.02);
                    AddWaypoint(6, 5037.77,    -1770.56,    1324.36);
                    AddWaypoint(7, 5067.23,    -1789.95,    1321.17);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

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

        if (FrostArmorTimer < diff)
        {
            DoCast(m_creature, SPELL_FROST_ARMOR);
            FrostArmorTimer = 40000+rand()%20000;
        }else FrostArmorTimer -= diff;
        if (DecayTimer < diff)
        {
            DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY);
            DecayTimer = 60000+rand()%20000;
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_DECAY1);
                    m_creature->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_DECAY2);
                    m_creature->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }else DecayTimer -= diff;
        if (NovaTimer < diff)
        {
            DoCast(m_creature->getVictim(), SPELL_FROST_NOVA);
            NovaTimer = 30000+rand()%15000;
            switch(rand()%2)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_NOVA1);
                    m_creature->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_NOVA2);
                    m_creature->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }else NovaTimer -= diff;
        if (IceboltTimer < diff)
        {
            DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT);
            IceboltTimer = 11000+rand()%20000;
        }else IceboltTimer -= diff;

        DoMeleeAttackIfReady();
    }
Пример #26
0
        void UpdateAI(const uint32 diff)
        {
            if (IsEvent)
            {
                //Must update npc_escortAI
                npc_escortAI::UpdateAI(diff);
                if (!pGo)
                {
                    pGo = true;
                    if (pInstance)
                    {
                        AddWaypoint(0, 4896.08f,    -1576.35f,    1333.65f);
                        AddWaypoint(1, 4898.68f,    -1615.02f,    1329.48f);
                        AddWaypoint(2, 4907.12f,    -1667.08f,    1321.00f);
                        AddWaypoint(3, 4963.18f,    -1699.35f,    1340.51f);
                        AddWaypoint(4, 4989.16f,    -1716.67f,    1335.74f);
                        AddWaypoint(5, 5026.27f,    -1736.89f,    1323.02f);
                        AddWaypoint(6, 5037.77f,    -1770.56f,    1324.36f);
                        AddWaypoint(7, 5067.23f,    -1789.95f,    1321.17f);
                        Start(false, true);
                        SetDespawnAtEnd(false);
                    }
                }
            }

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

            if (SwarmTimer <= diff)
            {
                if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    DoCast(target, SPELL_CARRION_SWARM);

                SwarmTimer = urand(45000, 60000);
                switch (urand(0, 1))
                {
                case 0:
                    DoPlaySoundToSet(me, SOUND_SWARM1);
                    me->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_SWARM2);
                    me->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0);
                    break;
                }
            } else SwarmTimer -= diff;

            if (SleepTimer <= diff)
            {
                for (uint8 i = 0; i < 3; ++i)
                {
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                        target->CastSpell(target, SPELL_SLEEP, true);
                }
                SleepTimer = 60000;
                switch (urand(0, 1))
                {
                case 0:
                    DoPlaySoundToSet(me, SOUND_SLEEP1);
                    me->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_SLEEP2);
                    me->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0);
                    break;
                }
            } else SleepTimer -= diff;
            if (AuraTimer <= diff)
            {
                DoCast(me, SPELL_VAMPIRIC_AURA, true);
                AuraTimer = urand(10000, 20000);
            } else AuraTimer -= diff;
            if (InfernoTimer <= diff)
            {
                DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_INFERNO);
                InfernoTimer = 45000;
                switch (urand(0, 1))
                {
                case 0:
                    DoPlaySoundToSet(me, SOUND_INFERNO1);
                    me->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0);
                    break;
                case 1:
                    DoPlaySoundToSet(me, SOUND_INFERNO2);
                    me->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0);
                    break;
                }
            } else InfernoTimer -= diff;

            DoMeleeAttackIfReady();
        }
Пример #27
0
void violet_hold_invaderAI::UpdateEscortAI(const uint32 diff)
{
    if (!WaypointSet)
    {
        uint8 i=0;
        switch (PortalNumber)
        {
        case 1:
            for (i=0;i<7;i++)
            {
                AddWaypoint(i, portal1WP[i][0], portal1WP[i][1], portal1WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 2:
            for (i=0;i<5;i++)
            {
                AddWaypoint(i, portal2WP[i][0], portal2WP[i][1], portal2WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;   
            break;
        case 3:
            for (i=0;i<5;i++)
            {
                AddWaypoint(i, portal3WP[i][0], portal3WP[i][1], portal3WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 4:
            for (i=0;i<3;i++)
            {
                AddWaypoint(i, portal4WP[i][0], portal4WP[i][1], portal4WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 5:
            for (i=0;i<3;i++)
            {
                AddWaypoint(i, portal5WP[i][0], portal5WP[i][1], portal5WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 6:
            for (i=0;i<3;i++)
            {
                AddWaypoint(i, portal6WP[i][0], portal6WP[i][1], portal6WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 7:
            for (i=0;i<8;i++)
            {
                AddWaypoint(i, portal7WP[i][0], portal7WP[i][1], portal7WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        case 8:
            for (i=0;i<8;i++)
            {
                AddWaypoint(i, portal8WP[i][0], portal8WP[i][1], portal8WP[i][2]);
            }
            SetDespawnAtEnd(true);
            Start(true);
            WaypointSet=true;
            break;
        }
        float modx,mody;
        modx=urand(28,39);
        modx=modx/2;
        mody=sqrt(380-pow(modx,2));
        if (m_instance)
        {
            Creature* tDoor=m_creature->GetMap()->GetCreature(m_instance->GetData64(DOOR_GUID));
            if (rand()%2)                    
                AddWaypoint(i, tDoor->GetPositionX()+modx,tDoor->GetPositionY()+mody,44.019f);
            else
                AddWaypoint(i, tDoor->GetPositionX()+modx,tDoor->GetPositionY()-mody,44.019f);
            AddWaypoint(i+1, finishWP[0][0],finishWP[0][1],finishWP[0][2]);
            AddWaypoint(i+2, finishWP[1][0],finishWP[1][1],finishWP[1][2]);
        }
    }

    if (AttackingDoor)
    {
        if (AttackingDoorTimer<diff)
        {
            if (m_instance)
            {
                m_instance->SetData(DATA_TICKCOUNTER,m_instance->GetData(DATA_TICKCOUNTER)+1);
                AttackingDoorTimer=500;
            }
        }
        else AttackingDoorTimer-=diff;
    }
}
Пример #28
0
 npc_korrak_bloodragerAI(Creature* pCreature) : npc_escortAI(pCreature)
 {
     Start(true,true, 0, NULL);
     SetDespawnAtEnd(false);
 }
Пример #29
0
		void Reset()
		{
			Start(false,true,0,NULL);
			SetDespawnAtEnd(true);
		}
Пример #30
0
    void UpdateAI(const uint32 diff)
    {
        if (IsEvent)
        {
            //Must update npc_escortAI
            npc_escortAI::UpdateAI(diff);
            if(!go)
            {
                go = true;
                if(pInstance)
                {
                    AddWaypoint(0, 5492.91,    -2404.61,    1462.63);
                    AddWaypoint(1, 5531.76,    -2460.87,    1469.55);
                    AddWaypoint(2, 5554.58,    -2514.66,    1476.12);
                    AddWaypoint(3, 5554.16,    -2567.23,    1479.90);
                    AddWaypoint(4, 5540.67,    -2625.99,    1480.89);
                    AddWaypoint(5, 5508.16,    -2659.2,    1480.15);
                    AddWaypoint(6, 5489.62,    -2704.05,    1482.18);
                    AddWaypoint(7, 5457.04,    -2726.26,    1485.10);
                    Start(false, true);
                    SetDespawnAtEnd(false);
                }
            }
        }

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

        if(CheckTimer < diff)
        {
            DoZoneInCombat();
            m_creature->SetSpeed(MOVE_RUN, 3.0);
            CheckTimer = 3000;
        }
        else
            CheckTimer -= diff;

        if(CleaveTimer < diff)
        {
            DoCast(m_creature->getVictim(), SPELL_CLEAVE);
            CleaveTimer = urand(6000, 21000);
        }
        else
            CleaveTimer -= diff;

        if(WarStompTimer < diff)
        {
            DoCast(m_creature, SPELL_WARSTOMP);
            WarStompTimer = urand(15000, 25000);
        }
        else
            WarStompTimer -= diff;

        if(CrippleTimer < diff)
        {
            if(Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1, 20, true))
                DoCast(target, SPELL_CRIPPLE);

            CrippleTimer = urand(10000, 12000);
        }
        else
            CrippleTimer -= diff;

        if(MarkTimer < diff)
        {
            m_creature->CastSpell(m_creature, SPELL_MARK, false);

            MarkTimerBase -= 5000;

            if(MarkTimerBase <= 5500)
                MarkTimerBase = 10500;

            MarkTimer = MarkTimerBase;
            switch(rand()%3)
            {
                case 0:
                    DoPlaySoundToSet(m_creature, SOUND_MARK1);
                    DoYell(SAY_MARK1, LANG_UNIVERSAL, NULL);
                    break;
                case 1:
                    DoPlaySoundToSet(m_creature, SOUND_MARK2);
                    DoYell(SAY_MARK2, LANG_UNIVERSAL, NULL);
                    break;
            }
        }
        else
            MarkTimer -= diff;

        DoMeleeAttackIfReady();
    }