Example #1
0
    bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
    {
        player->PlayerTalkClass->ClearMenus();
        InstanceScript* instance = creature->GetInstanceScript();
        if (action == GOSSIP_ACTION_INFO_DEF+1)
        {
            player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
            player->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, creature->GetGUID());
        }
        if (action == GOSSIP_ACTION_INFO_DEF+2)
        {
            player->CLOSE_GOSSIP_MENU();

            if (instance && instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
            {
                instance->SetData(TYPE_THRALL_PART4, IN_PROGRESS);
                if (instance->GetData64(DATA_EPOCH) == 0)
                     creature->SummonCreature(ENTRY_EPOCH, 2639.13f, 698.55f, 65.43f, 4.59f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000);

                 if (uint64 ThrallGUID = instance->GetData64(DATA_THRALL))
                 {
                     Creature* Thrall = (Unit::GetCreature((*creature), ThrallGUID));
                     if (Thrall)
                         CAST_AI(npc_thrall_old_hillsbrad::npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP();
                 }
            }
        }
        return true;
    }
        void JustDied(Unit* /*killer*/) override
        {
            Talk(SAY_DEATH);

            if (instance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
                instance->SetData(TYPE_THRALL_PART4, DONE);
        }
        void Reset()
        {
            SecondarySpellTimer = 5000;
            NormalCastTimer = 0;
            SuperCastTimer = 35000;
            BerserkTimer = 720000;
            CloseDoorTimer = 15000;

            LastSuperSpell = rand()%3;

            FlameWreathTimer = 0;
            FlameWreathCheckTime = 0;

            CurrentNormalSpell = 0;
            ArcaneCooldown = 0;
            FireCooldown = 0;
            FrostCooldown = 0;

            DrinkInterruptTimer = 10000;

            ElementalsSpawned = false;
            Drinking = false;
            DrinkInturrupted = false;

            if (instance)
            {
                // Not in progress
                instance->SetData(TYPE_ARAN, NOT_STARTED);
                instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), true);
            }
        }
        void JustDied(Unit* Killer)
        {
            if (!ghost && instance)
            {
                Unit* skarvald = Unit::GetUnit(*me, instance->GetData64(DATA_SKARVALD));
                if (skarvald)
                {
                    if (skarvald->isDead())
                    {
                        DoScriptText(YELL_DALRONN_SKA_DIED, me);

                        if (instance)
                            instance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE);
                    }
                    else
                    {
                        DoScriptText(YELL_DALRONN_DAL_DIEDFIRST, me);

                        me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
                        //DoCast(me, SPELL_SUMMON_DALRONN_GHOST, true);
                        Creature* temp = me->SummonCreature(MOB_DALRONN_GHOST, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_CORPSE_DESPAWN, 5000);
                        if (temp)
                        {
                            temp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                            temp->AI()->AttackStart(Killer);
                        }
                    }
                }
            }
        }
 void JustDied(Unit* /*slayer*/) override
 {
     instance->SetData(TYPE_NARALEX_EVENT, FAIL);
     instance->SetData(TYPE_NARALEX_PART1, FAIL);
     instance->SetData(TYPE_NARALEX_PART2, FAIL);
     instance->SetData(TYPE_NARALEX_PART3, FAIL);
 }
Example #6
0
    bool OnGossipHello(Player* pPlayer, Creature* pCreature)
    {
        if ( pPlayer->GetTeamId() == TEAM_ALLIANCE)
            return false;

        InstanceScript* pInstance = pCreature->GetInstanceScript();
        if (pInstance && pInstance->GetBossState(DATA_GUNSHIP_BATTLE_EVENT) == NOT_STARTED)
        {
            pPlayer->ADD_GOSSIP_ITEM(0, "Ready for battle", 631, HORDE_GOSSIP_ACTION_START);
            pPlayer->ADD_GOSSIP_ITEM(0, "Return Later", 631, HORDE_GOSSIP_ACTION_CANCEL);
            pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());

            return true;
        }

        if (pInstance && pInstance->GetBossState(DATA_GUNSHIP_BATTLE_EVENT) == DONE)
        {
            pPlayer->ADD_GOSSIP_ITEM(0, "Go to the top of the Deathbringer", 631, HORDE_GOSSIP_ACTION_TP);
            pPlayer->ADD_GOSSIP_ITEM(0, "Return Later", 631, HORDE_GOSSIP_ACTION_CANCEL);
            pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());

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

            if (uiChaoticEnergyBurstTimer <= diff)
            {
                Unit* pAnomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
                if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
                {
                    if (pAnomalus && pAnomalus->HasAura(SPELL_RIFT_SHIELD))
                        DoCast(pTarget, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
                    else
                        DoCast(pTarget, SPELL_CHAOTIC_ENERGY_BURST);
                }
                uiChaoticEnergyBurstTimer = 1*IN_MILLISECONDS;
            } else uiChaoticEnergyBurstTimer -= diff;

            if (uiSummonCrazedManaWraithTimer <= diff)
            {
                Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX()+1, me->GetPositionY()+1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1*IN_MILLISECONDS);
                if (Wraith)
                    if (Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0))
                        Wraith->AI()->AttackStart(pTarget);
                Unit* Anomalus = Unit::GetUnit(*me, pInstance ? pInstance->GetData64(DATA_ANOMALUS) : 0);
                if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
                    uiSummonCrazedManaWraithTimer = 5*IN_MILLISECONDS;
                else
                    uiSummonCrazedManaWraithTimer = 10*IN_MILLISECONDS;
            } else uiSummonCrazedManaWraithTimer -= diff;
        }
Example #8
0
        void Reset()
        {
            Phase = IDLE;
            luiCrystals.clear();
            ohNovos = true;
            me->CastStop();
            lSummons.DespawnAll();
            crystalHandlerAmount = 0;

            if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
            if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
            if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);

            if (instance)
            {
                instance->SetData(DATA_NOVOS_EVENT, NOT_STARTED);
                for (uint8 n = 0; n < 4; ++n)
                    luiCrystals.push_back(instance->GetData64(DATA_NOVOS_CRYSTAL_1 + n));
                for (std::list<uint64>::const_iterator itr = luiCrystals.begin(); itr != luiCrystals.end(); ++itr)
                {
                    if (GameObject* temp = instance->instance->GetGameObject(*itr))
                        temp->SetGoState(GO_STATE_READY);
                }
            }
        }
    bool OnGossipHello(Player* pPlayer, Creature* pCreature)
    {
        if( !pCreature->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP) )
            return true;

        InstanceScript* pInstance = pCreature->GetInstanceScript();
        if( !pInstance )
            return true;

        uint32 gossipTextId = 0;
        switch( pInstance->GetData(TYPE_INSTANCE_PROGRESS) )
        {
            case INSTANCE_PROGRESS_INITIAL:
                gossipTextId = MSG_TESTED;
                break;
            case INSTANCE_PROGRESS_INTRO_DONE:
            case INSTANCE_PROGRESS_BEASTS_DEAD:
            case INSTANCE_PROGRESS_FACTION_CHAMPIONS_DEAD:
            case INSTANCE_PROGRESS_VALKYR_DEAD:
                gossipTextId = MSG_NEXT_STAGE;
                break;
            case INSTANCE_PROGRESS_JARAXXUS_DEAD:
                gossipTextId = MSG_CRUSADERS;
                break;
            case INSTANCE_PROGRESS_DONE:
                pCreature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                return true;
            default:
                return true;
        }

        pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "We are ready!", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1337);
        pPlayer->SEND_GOSSIP_MENU(gossipTextId, pCreature->GetGUID());
        return true;
    }
Example #10
0
            void UpdateAI(uint32 const diff)
            {
                if (!UpdateVictim())
                    return;

                if (uiChaoticEnergyBurstTimer <= diff)
                {
                    Creature* Anomalus = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ANOMALUS));
                    if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                    {
                        if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
                            DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST);
                        else
                            DoCast(target, SPELL_CHAOTIC_ENERGY_BURST);
                    }
                    uiChaoticEnergyBurstTimer = 1000;
                }
                else
                    uiChaoticEnergyBurstTimer -= diff;

                if (uiSummonCrazedManaWraithTimer <= diff)
                {
                    if (Creature* Wraith = me->SummonCreature(MOB_CRAZED_MANA_WRAITH, me->GetPositionX() + 1, me->GetPositionY() + 1, me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000))
                        if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
                            Wraith->AI()->AttackStart(target);
                    Creature* Anomalus = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_ANOMALUS));
                    if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD))
                        uiSummonCrazedManaWraithTimer = 5000;
                    else
                        uiSummonCrazedManaWraithTimer = 10000;
                }
                else
                    uiSummonCrazedManaWraithTimer -= diff;
            }
Example #11
0
		void DoAction(int32 param)
		{
			if( param == -1 )
			{
				summons.DespawnAll();
			}
			else if( param == 1 )
			{
				if( !pInstance )
					return;

				pInstance->SetData(BOSS_BLACK_KNIGHT, IN_PROGRESS);
				Talk(TEXT_BK_AGGRO);
				me->CastSpell((Unit*)NULL, (pInstance->GetData(DATA_TEAMID_IN_INSTANCE)==TEAM_HORDE ? SPELL_RAISE_DEAD_JAEREN : SPELL_RAISE_DEAD_ARELAS), false);
				if( Creature* announcer = pInstance->instance->GetCreature(pInstance->GetData64(DATA_ANNOUNCER)) )
					announcer->DespawnOrUnsummon();

				events.Reset();
				events.ScheduleEvent(EVENT_ANNOUNCER_SAY_ZOMBIE, 2500);
				events.ScheduleEvent(EVENT_SPELL_PLAGUE_STRIKE, urand(7000,9000));
				events.ScheduleEvent(EVENT_SPELL_ICY_TOUCH, urand(3500,7000));
				events.ScheduleEvent(EVENT_SPELL_DEATH_RESPITE, urand(13000,15000));
				events.ScheduleEvent(EVENT_SPELL_OBLITERATE, urand(11000,19000));
			}
		}
 void Reset()
 {
     ShadowNovaTimer = urand(12000, 17000);
     BerserkTimer = 360000;
     FuriousRoarTimer = 0;
     FuriousRoarCount = 0;
     Phase = PHASE_1;
     StormRider = false;
     Berserk = false;
     if (instance)
     {
         instance->SetData(DATA_HALFUS, NOT_STARTED);
         if (instance->GetData(DATA_STORM_RIDER) == 1)
         {
             DoCast(me, SPELL_SHADOW_WRAPPED);
             StormRider = true;
         }
         if (instance->GetData(DATA_THE_SLATE_DRAGON) == 1)
             DoCast(me, SPELL_MALEVOLENT_STRAKES);
         if (instance->GetData(DATA_NETHER_SCION) == 1)
             DoCast(me, SPELL_FRENZIED_ASSAULT);
     }
     me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);
     me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_GRIP, true);
 }
Example #13
0
        void Reset()
        {
            sacrificed = false;
            SetCombatMovement(true);

            summons.DespawnAll();
            me->RemoveAllAuras();

            if (Phase > INTRO)
            {
                me->SetFlying(true);
                me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING);
            }

            if (Phase > NORMAL)
                Phase = NORMAL;

            introTimer = 1 * IN_MILLISECONDS;
            introPhase = 0;
            arthasGUID = 0;

            if (instance)
            {
                instance->SetData(DATA_SVALA_SORROWGRAVE_EVENT, NOT_STARTED);
                instance->SetData64(DATA_SACRIFICED_PLAYER, 0);
            }
        }
Example #14
0
        void UpdateAI(const uint32 diff)
        {
            //Return since we have no target
            if (!UpdateVictim())
                return;

            //Fear_Timer
            if (Fear_Timer <= diff)
            {
                DoCast(me->getVictim(), SPELL_FEAR);
                DoResetThreat();
                Fear_Timer = 20000;
            } else Fear_Timer -= diff;

            //Casting Heal to other twins or herself.
            if (Heal_Timer <= diff)
            {
                if (pInstance)
                {
                    Unit* pKri = Unit::GetUnit((*me), pInstance->GetData64(DATA_KRI));
                    Unit* pVem = Unit::GetUnit((*me), pInstance->GetData64(DATA_VEM));

                    switch (urand(0, 2))
                    {
                        case 0:
                            if (pKri)
                                DoCast(pKri, SPELL_HEAL);
                            break;
                        case 1:
                            if (pVem)
                                DoCast(pVem, SPELL_HEAL);
                            break;
                        case 2:
                            DoCast(me, SPELL_HEAL);
                            break;
                    }
                }

                Heal_Timer = 15000+rand()%15000;
            } else Heal_Timer -= diff;

            //Checking if Vem is dead. If yes we will enrage.
            if (Check_Timer <= diff)
            {
                if (!VemDead)
                {
                    if (pInstance)
                    {
                        if (pInstance->GetData(DATA_VEMISDEAD))
                        {
                            DoCast(me, SPELL_ENRAGE);
                            VemDead = true;
                        }
                    }
                }
                Check_Timer = 2000;
            } else Check_Timer -= diff;

            DoMeleeAttackIfReady();
        }
Example #15
0
        void Reset()
        {
            me->SetSwim(true);
            me->SetDisableGravity(true);
            SpoutAnimTimer = 1000;
            RotTimer = 0;
            WaterboltTimer = 15000; // give time to get in range when fight starts
            SpoutTimer = 45000;
            WhirlTimer = 18000; // after avery spout
            PhaseTimer = 120000;
            GeyserTimer = rand()%5000 + 15000;
            CheckTimer = 15000; // give time to get in range when fight starts
            WaitTimer = 60000; // never reached
            WaitTimer2 = 60000; // never reached

            Submerged = true; // will be false at combat start
            Spawned = false;
            InRange = false;
            CanStartEvent = false;

            Summons.DespawnAll();

            if (instance)
            {
                instance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED);
                instance->SetData(DATA_STRANGE_POOL, NOT_STARTED);
            }
            DoCast(me, SPELL_SUBMERGE); // submerge anim
            me->SetVisible(false); // we start invis under water, submerged
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC);
        }
        void Reset()
        {
            CataclysmicBolt_Timer = 10000;
            Enrage_Timer = 600000;                              //10 minutes
            SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds

            BlessingOfTides = false;

            if (instance)
            {
                uint64 RAdvisors[MAX_ADVISORS];
                RAdvisors[0] = instance->GetData64(DATA_SHARKKIS);
                RAdvisors[1] = instance->GetData64(DATA_TIDALVESS);
                RAdvisors[2] = instance->GetData64(DATA_CARIBDIS);
                //Respawn of the 3 Advisors
                Creature* pAdvisor = NULL;
                for (int i=0; i<MAX_ADVISORS; ++i)
                    if (RAdvisors[i])
                    {
                        pAdvisor = (Unit::GetCreature((*me), RAdvisors[i]));
                        if (pAdvisor && !pAdvisor->IsAlive())
                        {
                            pAdvisor->Respawn();
                            pAdvisor->AI()->EnterEvadeMode();
                            pAdvisor->GetMotionMaster()->MoveTargetedHome();
                        }
                    }
                instance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED);
            }

        }
Example #17
0
    bool OnGossipHello(Player* pPlayer, Creature* pCreature)
    {
        if ( pPlayer->GetTeamId() == TEAM_HORDE)
            return false;

        InstanceScript* pInstance = pCreature->GetInstanceScript();
        if (pInstance && pInstance->GetBossState(DATA_GUNSHIP_BATTLE_EVENT) == NOT_STARTED)
        {
            pPlayer->ADD_GOSSIP_ITEM(0, "My allies are in good condition, Muradin, Forward", 10875, ALLIANCE_GOSSIP_ACTION_START);
            pPlayer->ADD_GOSSIP_ITEM(0, "Return Later", 631, ALLIANCE_GOSSIP_ACTION_CANCEL);
            pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());

            return true;
        }

        if (pInstance && pInstance->GetBossState(DATA_GUNSHIP_BATTLE_EVENT) == DONE)
        {
            pPlayer->ADD_GOSSIP_ITEM(0, "Go to the top of the Deathbringer", 10876, ALLIANCE_GOSSIP_ACTION_TP);
            pPlayer->ADD_GOSSIP_ITEM(0, "Return Later", 631, ALLIANCE_GOSSIP_ACTION_CANCEL);
            pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID());

            return true;
        }
        return false;
    }
        void UpdateAI(uint32 const diff)
        {
            if (Repair_Timer <= diff)
            {
                if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS)
                {
                    if (Unit* pMekgineer = Unit::GetUnit((*me), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER)))
                    {
                        if (me->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE))
                        {
                            //are we already channeling? Doesn't work very well, find better check?
                            if (!me->GetUInt32Value(UNIT_CHANNEL_SPELL))
                            {
                                //me->GetMotionMaster()->MovementExpired();
                                //me->GetMotionMaster()->MoveIdle();

                                DoCast(me, SPELL_REPAIR, true);
                            }
                            Repair_Timer = 5000;
                        }
                        else
                        {
                            //me->GetMotionMaster()->MovementExpired();
                            //me->GetMotionMaster()->MoveFollow(pMekgineer, 0, 0);
                        }
                    }
                } else Repair_Timer = 5000;
            } else Repair_Timer -= diff;

            if (!UpdateVictim())
                return;

            DoMeleeAttackIfReady();
        }
Example #19
0
        void RestoreAll()
        {
            if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_RIGHT)))
                instance->HandleGameObject(ObjectGuid::Empty, false, go);

            if (GameObject* go = ObjectAccessor::GetGameObject(*me, instance->GetGuidData(DATA_GO_CAVE_IN_LEFT)))
                instance->HandleGameObject(ObjectGuid::Empty, false, go);

            if (!GoSummonList.empty())
                for (GuidList::const_iterator itr = GoSummonList.begin(); itr != GoSummonList.end(); ++itr)
                {
                    if (GameObject* go = ObjectAccessor::GetGameObject(*me, *itr))
                        go->RemoveFromWorld();
                }

            if (!SummonList.empty())
                for (GuidList::const_iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
                {
                    if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
                    {
                        if (summon->IsAlive())
                            summon->DisappearAndDie();
                        else
                            summon->RemoveCorpse();
                    }
                }
        }
        void Reset()
        {
            HolyLight_Timer = 20000;
            DivineShield_Timer = 20000;

            if (instance)
            {
                switch (me->GetEntry())
                {
                case SH_AELMAR:
                    instance->SetData(TYPE_SH_AELMAR, 0);
                    break;
                case SH_CATHELA:
                    instance->SetData(TYPE_SH_CATHELA, 0);
                    break;
                case SH_GREGOR:
                    instance->SetData(TYPE_SH_GREGOR, 0);
                    break;
                case SH_NEMAS:
                    instance->SetData(TYPE_SH_NEMAS, 0);
                    break;
                case SH_VICAR:
                    instance->SetData(TYPE_SH_VICAR, 0);
                    break;
                }
            }
        }
        void UpdateAI(const uint32 diff)
        {
            if (uiResurectTimer)
            {
                if (uiResurectTimer <= diff)
                {
                    if (uiResurectPhase == 1)
                    {
                        Unit* ingvar = Unit::GetUnit(*me, instance ? instance->GetData64(DATA_INGVAR) : 0);
                        if (ingvar)
                        {
                            ingvar->SetStandState(UNIT_STAND_STATE_STAND);
                            ingvar->CastSpell(ingvar, SPELL_SCOURG_RESURRECTION_HEAL, false);
                        }
                        uiResurectTimer = 3000;
                        uiResurectPhase = 2;
                    }
                    else if (uiResurectPhase == 2)
                    {
                        if (Creature* ingvar = Unit::GetCreature(*me, instance ? instance->GetData64(DATA_INGVAR) : 0))
                        {
                            ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY);

                            if (ingvar->GetVictim())
                                if (boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI* ai = CAST_AI(boss_ingvar_the_plunderer::boss_ingvar_the_plundererAI, ingvar->AI()))
                                    ai->StartZombiePhase();

                            me->GetMotionMaster()->MovePoint(2, x+1, y, z+30);
                            ++uiResurectPhase;
                            uiResurectTimer = 0;
                        }
                    }
                } else uiResurectTimer -= diff;
            }
        }
Example #22
0
        void UpdateAI(const uint32 diff)
        {
            //Return since we have no target
            if (!UpdateVictim())
                return;

            //spam stormstrike in hc mode if spawns are dead
            if (IsHeroic())
            {
                if (Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
                {
                    if (Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
                    {
                        if (!pGuard1->isAlive() && !pGuard2->isAlive())
                            DoCast(me->getVictim(), SPELL_STORMSTRIKE);
                    }
                }
            }

            if (uiEarthShieldTimer <= diff)
            {
                DoCast(me, SPELL_EARTH_SHIELD);
                uiEarthShieldTimer = 20000;
            } else uiEarthShieldTimer -= diff;

            if (uiChainHealTimer <= diff)
            {
                if (uint64 TargetGUID = GetChainHealTargetGUID())
                {
                    if (Creature *pTarget = Unit::GetCreature(*me, TargetGUID))
                        DoCast(pTarget, SPELL_CHAIN_HEAL);

                    //If one of the adds is dead spawn heals faster
                    Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0);
                    Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0);
                    uiChainHealTimer = ((pGuard1 && !pGuard1->isAlive()) || (pGuard2 && !pGuard2->isAlive()) ? 3000 : 8000) + rand()%3000;
                }
            } else uiChainHealTimer -= diff;

            if (uiBloodlustTimer <= diff)
            {
                DoCast(me, SPELL_BLOODLUST);
                uiBloodlustTimer = urand(35000,45000);
            } else uiBloodlustTimer -= diff;

            if (uiEarthShockTimer <= diff)
            {
                DoCast(me->getVictim(), SPELL_EARTH_SHOCK);
                uiEarthShockTimer = urand(8000,13000);
            } else uiEarthShockTimer -= diff;

            if (uiLightningBoltTimer <= diff)
            {
                if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
                    DoCast(pTarget, SPELL_LIGHTNING_BOLT);
                uiLightningBoltTimer = urand(18000,24000);
            } else uiLightningBoltTimer -= diff;

            DoMeleeAttackIfReady();
        }
 void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
 {
     switch (waypointId)
     {
         case 4:
             eventProgress = 1;
             currentEvent = TYPE_NARALEX_PART1;
             instance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS);
             break;
         case 5:
             Talk(SAY_MUST_CONTINUE);
             instance->SetData(TYPE_NARALEX_PART1, DONE);
             break;
         case 11:
             eventProgress = 1;
             currentEvent = TYPE_NARALEX_PART2;
             instance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS);
             break;
         case 19:
             Talk(SAY_BEYOND_THIS_CORRIDOR);
             break;
         case 24:
             eventProgress = 1;
             currentEvent = TYPE_NARALEX_PART3;
             instance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS);
             break;
     }
 }
Example #24
0
        void AttackStart(Unit* pWho)
        {
            if (me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE) || me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
                return;

            if (me->Attack(pWho, true))
            {
                me->AddThreat(pWho, 0.0f);
                me->SetInCombatWith(pWho);
                pWho->SetInCombatWith(me);
                DoStartMovement(pWho);

                if (Creature *pGuard1 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_1) : 0))
                {
                    pGuard1->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
                    if (!pGuard1->getVictim() && pGuard1->AI())
                        pGuard1->AI()->AttackStart(pWho);
                }
                if (Creature *pGuard2 = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EREKEM_GUARD_2) : 0))
                {
                    pGuard2->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_OOC_NOT_ATTACKABLE|UNIT_FLAG_NON_ATTACKABLE);
                    if (!pGuard2->getVictim() && pGuard2->AI())
                        pGuard2->AI()->AttackStart(pWho);
                }
            }
        }
        void Reset()
        {
            uiVenganceTimer = 10000;
            uiRadianceTimer = 16000;
            uiHammerJusticeTimer = 25000;
            uiResetTimer = 5000;

            bDone = false;
            Map* pMap = me->GetMap();
            if (hasBeenInCombat && pMap && pMap->IsDungeon())
            {
                Map::PlayerList const &players = pMap->GetPlayers();
                for (Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
                {
                     if(itr->GetSource() && itr->GetSource()->IsAlive() && !itr->GetSource()->IsGameMaster())
                        return; //se almeno un player ¡§¡§ vivo, esce						
                }
                
                if(instance)
                {
                   GameObject* GO = GameObject::GetGameObject(*me, instance->GetData64(DATA_MAIN_GATE1));
                   if(GO)
                      instance->HandleGameObject(GO->GetGUID(),true);
                   Creature* announcer=pMap->GetCreature(instance->GetData64(DATA_ANNOUNCER));
                   instance->SetData(DATA_ARGENT_SOLDIER_DEFEATED,0);
                   announcer->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                 }
                 me->RemoveFromWorld();

                 //ResetEncounter();
            }
        }
Example #26
0
        void JustDied(Unit * /*victim*/)
        {
            DoScriptText(SAY_DEATH, me);

            if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS)
                pInstance->SetData(TYPE_THRALL_PART4, DONE);
        }
Example #27
0
        void JustDied(Unit* /*killer*/) override
        {
            if (instance->GetData(DATA_BUG_TRIO_DEATH) < 2)// Unlootable if death
                me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);

            instance->SetData(DATA_BUG_TRIO_DEATH, 1);
        }
Example #28
0
        void BeginEvent(Player* player)
        {
            if (!instance)
                return;

            ShadeGUID = instance->GetData64(DATA_SHADEOFAKAMA);
            if (!ShadeGUID)
                return;

            Creature* Shade = (Unit::GetCreature((*me), ShadeGUID));
            if (Shade)
            {
                instance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS);
                // Prevent players from trying to restart event
                me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
                CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(me->GetGUID());
                CAST_AI(boss_shade_of_akama::boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers();
                Shade->AddThreat(me, 1000000.0f);
                me->CombatStart(Shade);
                Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE);
                Shade->SetTarget(me->GetGUID());
                if (player)
                    Shade->AddThreat(player, 1.0f);
                DoZoneInCombat(Shade);
                EventBegun = true;
            }
        }
        bool OnGossipHello(Player* player, Creature* creature)
        {
            InstanceScript* instance = creature->GetInstanceScript();
            if (!instance)
                return true;

            char const* _message = "We are ready!";

            if (player->IsInCombat() || instance->IsEncounterInProgress() || instance->GetData(TYPE_EVENT))
                return true;

            uint8 i = 0;
            for (; i < NUM_MESSAGES; ++i)
            {
                if ((!_GossipMessage[i].state && instance->GetBossState(_GossipMessage[i].encounter) != DONE)
                    || (_GossipMessage[i].state && instance->GetBossState(_GossipMessage[i].encounter) == DONE))
                {
                    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, _message, GOSSIP_SENDER_MAIN, _GossipMessage[i].id);
                    break;
                }
            }

            if (i >= NUM_MESSAGES)
                return false;

            player->SEND_GOSSIP_MENU(_GossipMessage[i].msgnum, creature->GetGUID());
            return true;
        }
Example #30
0
        void EnterCombat(Unit* /*who*/) override
        {
            Talk(SAY_AGGRO);

            instance->SetData(TYPE_ARAN, IN_PROGRESS);
            instance->HandleGameObject(instance->GetData64(DATA_GO_LIBRARY_DOOR), false);
        }