Beispiel #1
0
    void MoveInLineOfSight(Unit* who)
    {
        if (HasEscortState(STATE_ESCORT_ESCORTING))
            return;

        if (who->GetTypeId() == TYPEID_PLAYER)
        {
            if (who->HasAura(34877,1) && CAST_PLR(who)->GetQuestStatus(10277) == QUEST_STATUS_INCOMPLETE)
            {
                float Radius = 10.0f;
                if (me->IsWithinDistInMap(who, Radius))
                {
                    Start(false, false, who->GetGUID());
                }
            }
        }
    }
 void UpdateAI(const uint32 uiDiff)
 {
     if (uiCheckTimer <= uiDiff)
     {
         if (Creature* pWarp = me->FindNearestCreature(NPC_WARP_CHASER, 9.0f, false))
         {
             if (pWarp->GetGUID() != uiWarpGUID && CAST_PLR(me->GetOwner())->GetQuestStatus(QUEST_BLOODY) == QUEST_STATUS_INCOMPLETE)
             {
                 uiWarpGUID = pWarp->GetGUID();
                 DoScriptText(EMOTE_GATHER_BLOOD, me);
                 me->CastSpell(me->GetOwner(), SPELL_GATHER_WARP_BLOOD, false);
             }
         }
         uiCheckTimer = 8000;
     }
     else uiCheckTimer -= uiDiff;
 }
Beispiel #3
0
 void SendItem(Unit* receiver) {
     if (CAST_PLR(receiver)->HasItemCount(11169, 1, false)
             && CAST_PLR(receiver)->HasItemCount(11172, 11, false)
             && CAST_PLR(receiver)->HasItemCount(11173, 1, false)
             && !CAST_PLR(receiver)->HasItemCount(11522, 1, true)) {
         ItemPosCountVec dest;
         uint8 msg = CAST_PLR(receiver)->CanStoreNewItem(NULL_BAG,
                 NULL_SLOT, dest, 11522, 1, false);
         if (msg == EQUIP_ERR_OK)
             CAST_PLR(receiver)->StoreNewItem(dest, 11522, 1, true);
     }
 }
        void SpellHit(Unit *caster, const SpellEntry *spell)
        {
            if (caster->GetTypeId() == TYPEID_PLAYER)
            {
                                                                //Yenniku's Release
                if (!bReset && CAST_PLR(caster)->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE && spell->Id == 3607)
                {
                    me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
                    me->CombatStop();                   //stop combat
                    me->DeleteThreatList();             //unsure of this
                    me->setFaction(83);                 //horde generic

                    bReset = true;
                    Reset_Timer = 60000;
                }
            }
            return;
        }
Beispiel #5
0
        void WaypointReached(uint32 i)
        {
            Player* pPlayer = NULL;
            if (me->isSummon())
                if (Unit* summoner = CAST_SUM(me)->GetSummoner())
                    if (summoner->GetTypeId() == TYPEID_PLAYER)
                        pPlayer = CAST_PLR(summoner);

            if (!pPlayer)
                return;

            switch(i)
            {
            case 26:
                me->DespawnOrUnsummon();
                break;
            }
        }
	void DamageTaken(Unit* done_by, uint32& damage)
	{
		if (done_by->GetTypeId() == TYPEID_PLAYER)
		{
			if (damage > me->GetHealth())
			{
				me->SetHealth(1);
				damage = 0;
			}

            if (me->HealthBelowPctDamaged(20, damage))
			{
				if (CAST_PLR(done_by)->GetQuestStatus(QUEST_THE_END_OF_THE_DESERTERS) == QUEST_STATUS_INCOMPLETE)
					me->CastSpell(done_by, SPELL_GAVIS_GREYSHIELD_CREDIT, true);

				phase = PHASE_GAVIS_SURRENDER;
			}
		}
	}
        void WaypointReached(uint32 uiPointId) {
            Player* pPlayer = GetPlayerForEscort();

            if (!pPlayer)
                return;

            switch (uiPointId) {
            case 4:
                DoScriptText(SAY_PROGRESS_2, me, pPlayer);
                break;
            case 5:
                DoScriptText(SAY_PROGRESS_3, me, pPlayer);
                break;
            case 8:
                DoScriptText(EMOTE_PROGRESS_4, me);
                break;
            case 9: {
                me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f,
                        20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f,
                        20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                break;
            }
            case 10:
                DoScriptText(SAY_PROGRESS_5, me, pPlayer);
                break;
            case 11:
                DoScriptText(SAY_PROGRESS_6, me, pPlayer);
                SetRun();
                break;
            case 19:
                DoScriptText(SAY_PROGRESS_7, me, pPlayer);
                break;
            case 20:
                DoScriptText(EMOTE_PROGRESS_8, me);
                DoScriptText(SAY_PROGRESS_9, me, pPlayer);
                if (pPlayer)
                    CAST_PLR(pPlayer)->GroupEventHappens(QUEST_SUNKEN_TREASURE,
                            me);
                break;
            }
        }
            void WaypointReached(uint32 uiPointId)
            {
                Player* pPlayer = GetPlayerForEscort();

                if (!pPlayer)
                    return;

                switch(uiPointId)
                {
                case 9:Talk(SAY_POINT_1);break;
                case 10:
                {
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1459.62f, -3019.78f, 11.8f, 5.08f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1471.77f, -3032.95f, 12.39f, 6.03f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    break;
                }
                case 11:
                {
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1517.95f, -3023.16f, 12.93f, 4.79f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    me->SummonCreature(NPC_HAMMERFALL_GRUNT, -1522.69f, -3023.90f, 12.45f, 5.12f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    break;
                }
                case 13:
                {
                    if(Creature* Jorell = me->FindNearestCreature(2733,8.0f,true))
                    {
                        Jorell->MonsterSay("You will never stop the Forsaken, Kinelory. The Dark Lady shall make you suffer.",0,0);
                    }
                    break;
                }              
                case 14:Talk(SAY_HOUSE_1);break;
                case 15:Talk(SAY_HOUSE_2); break;
                case 16:Talk(SAY_HOUSE_3); break;
                case 17:SetRun(); break;
                case 27:
                    Talk(SAY_END);
                    if (pPlayer)
                        CAST_PLR(pPlayer)->GroupEventHappens(QUEST_KINELORY_STRIKES, me);
                    Reset();
                    break;
                }
            }
Beispiel #9
0
    void DamageTaken(Unit* pDoneBy, uint32& uiDamage)
    {
        if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20)
        {
            if (Player* pPlayer = GetPlayerForEscort())
            {
                if (pPlayer->GetTypeId() == TYPEID_PLAYER)
                    CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature);

                uiDamage = 0;

                me->RestoreFaction();
                m_creature->RemoveAllAuras();
                m_creature->DeleteThreatList();
                m_creature->CombatStop(true);

                SetRun(false);
            }
        }
    }
Beispiel #10
0
        void JustDied(Unit* Killer)
        {
            uint32 spawnCreatureID = 0;

            switch (urand(0, 2))
            {
                case 0:
                    spawnCreatureID = 17681;
                    if (Killer->GetTypeId() == TYPEID_PLAYER)
                        CAST_PLR(Killer)->KilledMonsterCredit(spawnCreatureID, 0);
                    break;
                case 1:
                case 2:
                    spawnCreatureID = possibleSpawns[urand(0, 30)];
                    break;
            }

            if (spawnCreatureID)
                me->SummonCreature(spawnCreatureID, 0.0f, 0.0f, 0.0f, me->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 60000);
        }
        void DamageTaken(Unit* /*doneBy*/, uint32& Damage)
        {
            if (HealthBelowPct(20))
            {
                if (Player* player = GetPlayerForEscort())
                {
                    if (player->GetTypeId() == TYPEID_PLAYER)
                        CAST_PLR(player)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, me);

                    Damage = 0;

                    me->RestoreFaction();
                    me->RemoveAllAuras();
                    me->DeleteThreatList();
                    me->CombatStop(true);

                    SetRun(false);
                }
            }
        }
            void WaypointReached(uint32 uiPointId)
            {
                Player* player = GetPlayerForEscort();

                if (!player)
                    return;

                switch (uiPointId)
                {
                case 4:
                    Talk(SAY_PROGRESS_2, player->GetGUID());
                    break;
                case 5:
                    Talk(SAY_PROGRESS_3, player->GetGUID());
                    break;
                case 8:
                    Talk(EMOTE_PROGRESS_4);
                    break;
                case 9:
                    me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    me->SummonCreature(MOB_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
                    break;
                case 10:
                    Talk(SAY_PROGRESS_5, player->GetGUID());
                    break;
                case 11:
                    Talk(SAY_PROGRESS_6, player->GetGUID());
                    SetRun();
                    break;
                case 19:
                    Talk(SAY_PROGRESS_7, player->GetGUID());
                    break;
                case 20:
                    Talk(EMOTE_PROGRESS_8);
                    Talk(SAY_PROGRESS_9, player->GetGUID());
                    if (player)
                        CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
                    break;
                }
            }
Beispiel #13
0
        void JustDied(Unit* /*killer*/)
        {
            DoScriptText(EMOTE_ABORT, me);

            if (someplayer)
            {
                Unit* p = Unit::GetUnit((*me), someplayer);
                if (p && p->GetTypeId() == TYPEID_PLAYER)
                {
                    switch (me->GetEntry())
                    {
                        case ENTRY_BNAAR_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10299);
                            CAST_PLR(p)->FailQuest(10329);
                            break;
                        case ENTRY_CORUU_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10321);
                            CAST_PLR(p)->FailQuest(10330);
                            break;
                        case ENTRY_DURO_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10322);
                            CAST_PLR(p)->FailQuest(10338);
                            break;
                        case ENTRY_ARA_C_CONSOLE:
                            CAST_PLR(p)->FailQuest(10323);
                            CAST_PLR(p)->FailQuest(10365);
                            break;
                    }
                }
            }

            if (goConsole)
            {
                if (GameObject* go = GameObject::GetGameObject((*me), goConsole))
                    go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
            }
        }
    void UpdateAI(const uint32 /*diff*/)
    {
        if (KillCount >= 3 && PlayerGUID)
        {
            if (Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID))
            {
                me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
                CAST_PLR(pPlayer)->CompleteQuest(QUEST_UNEXPECTED_RESULT);
                KillCount = 0;
            }
        }


        if (Summon)
        {
            me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
            me->SummonCreature(MOB_GHARZUL, 8726, -7148.23f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
            me->SummonCreature(MOB_ANGERSHADE, 8726, -7148.23f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
            me->SummonCreature(MOB_ANGERSHADE, 8726, -7148.23f, 35.22f, 0, TEMPSUMMON_CORPSE_DESPAWN, 4000);
            Summon = false;
        }
    }
    void MoveInLineOfSight(Unit* pWho)
    {
        if (!m_uiRandomTalkCooldown && pWho->GetTypeId() == TYPEID_UNIT && me->IsWithinDistInMap(pWho, 10.0f))
        {
            switch(pWho->GetEntry())
            {
                case NPC_HAGGARD:
                    if (Player* pPlayer = GetPlayerForEscort())
                        DoScriptText(SAY_KHAD_HAGGARD, pWho, pPlayer);
                    m_uiRandomTalkCooldown = 7500;
                    break;
                case NPC_ANCHORITE:
                    if (Player* pPlayer = GetPlayerForEscort())
                        DoScriptText(SAY_KHAD_ALDOR_GREET, pWho, pPlayer);
                    m_uiRandomTalkCooldown = 7500;
                    break;
                case NPC_ARCANIST:
                    if (Player* pPlayer = GetPlayerForEscort())
                        DoScriptText(SAY_KHAD_SCRYER_GREET, pWho, pPlayer);
                    m_uiRandomTalkCooldown = 7500;
                    break;
            }
        }

        if (HasEscortState(STATE_ESCORT_ESCORTING))
            return;

        if (pWho->GetTypeId() == TYPEID_PLAYER)
        {
            if (CAST_PLR(pWho)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
            {
                float Radius = 10.0f;
                if (me->IsWithinDistInMap(pWho, Radius))
                {
                    Start(false, false, pWho->GetGUID());
                }
            }
        }
    }
Beispiel #16
0
    void UpdateAI(const uint32 uiDiff)
    {
        if (m_uiPhase)
        {
            if (m_uiPhaseTimer < uiDiff)
                m_uiPhaseTimer = 7500;
            else
            {
                m_uiPhaseTimer -= uiDiff;
                return;
            }

            switch(m_uiPhase)
            {
                case 1:
                    DoScriptText(SAY_COMPLETE, m_creature);
                    ++m_uiPhase;
                    break;
                case 2:
                    if (Unit* pUnit = Unit::GetUnit(*m_creature, m_uiPlayerGUID))
                        CAST_PLR(pUnit)->AreaExploredOrEventHappens(QUEST_590);

                    m_creature->CastSpell(m_creature,SPELL_DRINK,true);
                    ++m_uiPhase;
                    break;
                case 3:
                    EnterEvadeMode();
                    break;
            }

            return;
        }

        if (!UpdateVictim())
            return;

        DoMeleeAttackIfReady();
    }
Beispiel #17
0
        void SpellHit(Unit* caster, const SpellInfo* spell)
        {
            if (!caster)
                return;

            if (caster->GetTypeId() == TYPEID_PLAYER && spell->Id == ORB && !me->HasAura(ENRAGE))
            {
                PlayerGUID = caster->GetGUID();
                if (PlayerGUID)
                {
                    Unit* player = Unit::GetUnit((*me), PlayerGUID);
                    if (player && CAST_PLR(player)->GetQuestStatus(QUESTG) == QUEST_STATUS_INCOMPLETE)
                        DoCast(player, 45110, true);
                }
                DoCast(me, ENRAGE);
                Unit* Myrmidon = me->FindNearestCreature(DM, 70);
                if (Myrmidon)
                {
                    me->AddThreat(Myrmidon, 100000.0f);
                    AttackStart(Myrmidon);
                }
            }
        }
Beispiel #18
0
    void SpellHit(Unit *caster, const SpellEntry *spell)
    {
        if (spell->Id == SPELL_PERSUASIVE_STRIKE && caster->GetTypeId() == TYPEID_PLAYER && me->isAlive() && !uiSpeech_counter)
        {
            if(CAST_PLR(caster)->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE)
            {
                uiPlayerGUID = caster->GetGUID();
                uiSpeech_timer = 1000;
                uiSpeech_counter = 1;
                me->setFaction(caster->getFaction());
                me->CombatStop(true);
                me->GetMotionMaster()->MoveIdle();
                me->SetReactState(REACT_PASSIVE);
                DoCastAOE(58111, true);

                DoScriptText(RAND(SAY_PERSUADE1,SAY_PERSUADE2,SAY_PERSUADE3,
                                  SAY_PERSUADE4,SAY_PERSUADE5,SAY_PERSUADE6,
                                  SAY_PERSUADE7), caster);

                DoScriptText(RAND(SAY_CRUSADER1,SAY_CRUSADER2,SAY_CRUSADER3,
                                  SAY_CRUSADER4,SAY_CRUSADER5,SAY_CRUSADER6), me);
            }
        }
    }
		void JustDied(Unit* Killer) {
			if (pInstance) {
				switch (me->GetEntry()) {
				case SH_AELMAR:
					pInstance->SetData(TYPE_SH_AELMAR, 2);
					break;
				case SH_CATHELA:
					pInstance->SetData(TYPE_SH_CATHELA, 2);
					break;
				case SH_GREGOR:
					pInstance->SetData(TYPE_SH_GREGOR, 2);
					break;
				case SH_NEMAS:
					pInstance->SetData(TYPE_SH_NEMAS, 2);
					break;
				case SH_VICAR:
					pInstance->SetData(TYPE_SH_VICAR, 2);
					break;
				}
				if (pInstance->GetData(TYPE_SH_QUEST)
						&& Killer->GetTypeId() == TYPEID_PLAYER)
					CAST_PLR(Killer)->KilledMonsterCredit(SH_QUEST_CREDIT, 0);
			}
		}
Beispiel #20
0
        void UpdateAI(const uint32 diff)
        {
            if (SayTimer <= diff)
            {
                if (Event)
                    SayTimer = NextStep(++Step);
            } else SayTimer -= diff;

            if (Attack)
            {
                Player* player = Unit::GetPlayer(*me, PlayerGUID);
                me->setFaction(14);
                me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                if (player)
                {
                Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
                if (Creepjack)
                {
                    Creepjack->Attack(player, true);
                    Creepjack->setFaction(14);
                    Creepjack->GetMotionMaster()->MoveChase(player);
                    Creepjack->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
                Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
                if (Malone)
                {
                    Malone->Attack(player, true);
                    Malone->setFaction(14);
                    Malone->GetMotionMaster()->MoveChase(player);
                    Malone->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
                    DoStartMovement(player);
                    AttackStart(player);
                }
                Attack = false;
            }

            if (HealthBelowPct(5) && !Done)
            {
                me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                me->RemoveAllAuras();

                Unit* Creepjack = me->FindNearestCreature(NPC_CREEPJACK, 20);
                if (Creepjack)
                {
                    CAST_CRE(Creepjack)->AI()->EnterEvadeMode();
                    Creepjack->setFaction(1194);
                    Creepjack->GetMotionMaster()->MoveTargetedHome();
                    Creepjack->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
                Unit* Malone = me->FindNearestCreature(NPC_MALONE, 20);
                if (Malone)
                {
                    CAST_CRE(Malone)->AI()->EnterEvadeMode();
                    Malone->setFaction(1194);
                    Malone->GetMotionMaster()->MoveTargetedHome();
                    Malone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
                }
                me->setFaction(1194);
                Done = true;
                Talk(SAY_GIVEUP);
                me->DeleteThreatList();
                me->CombatStop();
                me->GetMotionMaster()->MoveTargetedHome();
                Player* player = Unit::GetPlayer(*me, PlayerGUID);
                if (player)
                    CAST_PLR(player)->GroupEventHappens(QUEST_WBI, me);
            }
            DoMeleeAttackIfReady();
        }
Beispiel #21
0
 void JustDied(Unit* /*killer*/)
 {
     if (PlayerGUID && !Completed)
         if (Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID))
             CAST_PLR(pPlayer)->FailQuest(QUEST_POWERING_OUR_DEFENSES);
 }
Beispiel #22
0
 void JustDied(Unit* /*killer*/)
 {
     if (PlayerGUID)
         if (Player* pPlayer = Unit::GetPlayer(*me, PlayerGUID))
             CAST_PLR(pPlayer)->FailQuest(QUEST_UNEXPECTED_RESULT);
 }
Beispiel #23
0
 void KilledUnit(Unit* Killed)
 {
     if (Killed->GetTypeId() == TYPEID_PLAYER)
         if (CAST_PLR(Killed)->GetQuestStatus(QUEST_SECOND_TRIAL) == QUEST_STATUS_INCOMPLETE)
             CAST_PLR(Killed)->FailQuest(QUEST_SECOND_TRIAL);
 }
Beispiel #24
0
 void JustDied(Unit* killer)
 {
     if (Player* pPlayer = GetPlayerForEscort())
         CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER);
 }
Beispiel #25
0
        bool MeetQuestCondition(Unit* pPlayer)
        {
            switch(me->GetEntry())
            {
                case 29061:                                     // Ellen Stanbridge
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12742) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29072:                                     // Kug Ironjaw
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12748) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29067:                                     // Donovan Pulfrost
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12744) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29065:                                     // Yazmina Oakenthorn
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12743) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29071:                                     // Antoine Brack
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12750) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29032:                                     // Malar Bravehorn
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12739) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29068:                                     // Goby Blastenheimer
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12745) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29073:                                     // Iggy Darktusk
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12749) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29074:                                     // Lady Eonys
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12747) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                case 29070:                                     // Valok the Righteous
                    if (CAST_PLR(pPlayer)->GetQuestStatus(12746) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                                case 49355:                                     // Lord Harford
                    if (CAST_PLR(pPlayer)->GetQuestStatus(28649) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
                                case 49356:                                     // Gally Lumpstain
                    if (CAST_PLR(pPlayer)->GetQuestStatus(28650) == QUEST_STATUS_INCOMPLETE)
                        return true;
                    break;
            }

            return false;
        }
Beispiel #26
0
 void MoveInLineOfSight(Unit *who)
 {
     if(who->GetTypeId() == TYPEID_PLAYER && CAST_PLR(who)->isGameMaster()
         && !who->GetVehicle() && vehicle->GetPassenger(SEAT_TURRET))
         who->EnterVehicle(vehicle, SEAT_PLAYER);
 }
Beispiel #27
0
        void DoSplit(int atPercent /* 75 50 25 */)
        {
            DoScriptText(SAY_SPLIT, me);

            ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227f, 2083.814453f, 125.648788f, 0);
            ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875f, 2118.504639f, 133.058151f, 0);
            ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266f, 2058.231201f, 133.058151f, 0);

            ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3;

            switch (urand(0, 2))
            {
            case 0:
                bossc=place1;
                i1=place2;
                i2=place3;
                break;
            case 1:
                bossc=place2;
                i1=place1;
                i2=place3;
                break;
            case 2:
                bossc=place3;
                i1=place1;
                i2=place2;
                break;
            }

            for (uint16 i = 0; i < 41; ++i)
            {
                if (Player* target = CAST_PLR(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)))
                {
                    if (Group *pGrp = target->GetGroup())
                        for (uint8 ico = 0; ico < TARGETICONCOUNT; ++ico)
                        {
                            //if (grp->m_targetIcons[ico] == me->GetGUID()) -- private member :(
                            pGrp->SetTargetIcon(ico, 0, 0);
                        }

                    break;
                }
            }

            me->RemoveAllAuras();
            me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
            me->SetVisible(false);
            me->GetMap()->CreatureRelocation(me, bossc->x, bossc->y, bossc->z, bossc->r);
            Invisible = true;
            DoResetThreat();
            DoStopAttack();

            switch (atPercent)
            {
            case 75:
                Images75 = true;
                break;
            case 50:
                Images50 = true;
                break;
            case 25:
                Images25 = true;
                break;
            }

            Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0);

            Creature* Image1 = me->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
            if (Image1)
            {
                Image1->SetMaxHealth(me->GetMaxHealth() / 5);
                Image1->SetHealth(me->GetHealth() / 5);
                if (target)
                    Image1->AI()->AttackStart(target);
                CAST_AI(boss_skeram::boss_skeramAI, Image1->AI())->IsImage = true;
            }

            Creature* Image2 = me->SummonCreature(15263, i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000);
            if (Image2)
            {
                Image2->SetMaxHealth(me->GetMaxHealth() / 5);
                Image2->SetHealth(me->GetHealth() / 5);
                if (target)
                    Image2->AI()->AttackStart(target);
                CAST_AI(boss_skeram::boss_skeramAI, Image2->AI())->IsImage = true;
            }
            Invisible = true;
            delete place1;
            delete place2;
            delete place3;
        }
        void MoveInLineOfSight(Unit *who)
        {
            if (!who || (!who->isAlive())) return;

            if (me->IsWithinDistInMap(who, 10.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(1719) == QUEST_STATUS_INCOMPLETE && !EventInProgress)
            {
                PlayerGUID = who->GetGUID();
                EventInProgress = true;
            }
        }
Beispiel #29
0
        void MoveInLineOfSight(Unit* who)
        {
            if (!who || PlayerGUID)
                return;

            if (!PlayerGUID && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30) && CAST_PLR(who)->GetQuestStatus(10987) == QUEST_STATUS_INCOMPLETE)
            {
                PlayerGUID = who->GetGUID();
                return;
            }

            ScriptedAI::MoveInLineOfSight(who);
        }
		void KilledUnit(Unit * victim) {
			DoScriptText(RAND(SAY_SLAY1, SAY_SLAY2, SAY_SLAY3), me);

			if (victim && (victim->GetTypeId() == TYPEID_PLAYER))
				GainSoulCharge(CAST_PLR(victim));
		}