void OnQuestStart( Player* mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();

		Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 9623);
		if(creat == NULL)
			return;
		creat->m_escorter = mTarget;
		creat->GetAIInterface()->setMoveType(11);
		creat->GetAIInterface()->StopMovement(3000);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "He-l-p Me... ts.. ts...");
		creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);


		sEAS.CreateCustomWaypointMap(creat);

		sEAS.WaypointCreate(creat,-6305.657715f, -1977.757080f, -268.076447f, 5.564124f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6292.354492f, -1988.233032f, -265.271667f, 4.821922f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6296.333984f, -2004.225342f, -268.766388f, 3.337522f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6329.421387f, -2007.737549f, -258.587250f, 3.769490f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6343.778809f, -2017.559204f, -256.952026f, 3.577064f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6360.504883f, -2030.157959f, -261.204926f, 3.526014f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6381.367676f, -2038.451904f, -262.319946f, 2.713128f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6404.608398f, -2028.813721f, -262.817230f, 1.146257f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6399.632813f, -2018.668091f, -263.569824f, 0.800682f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6383.180664f, -2003.231689f, -270.639984f, 0.631821f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6351.983887f, -1976.397827f, -276.039001f, 1.138403f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6342.651855f, -1958.451050f, -274.056122f, 1.805992f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6353.083008f, -1918.406006f, -264.135101f, 1.515395f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6350.737305f, -1900.465942f, -258.695831f, 2.677785f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6366.535645f, -1892.092651f, -256.424347f, 2.025904f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6378.548828f, -1866.535278f, -260.363281f, 1.154112f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6370.422852f, -1842.526978f, -259.409515f, 1.711744f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6374.264648f, -1825.782349f, -260.584442f, 1.955218f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6382.359375f, -1811.540527f, -266.374359f, 2.901623f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6383.307129f, -1794.137207f, -267.334686f, 1.821700f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6399.292980f, -1710.144897f, -273.734283f, 1.252285f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6361.579102f, -1582.413574f, -272.221008f, 1.798137f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6391.618652f, -1409.568237f, -272.190521f, 1.711742f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6407.588867f, -1305.676880f, -271.632935f, 0.553279f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6349.980469f, -1276.069580f, -266.971375f, 1.236575f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6324.551758f, -1233.252441f, -267.178619f, 0.451176f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6288.604492f, -1215.046265f, -267.426117f, 2.177482f, 1, 256, 8841);
		sEAS.WaypointCreate(creat,-6298.290039f, -1182.650024f, -269.101013f, 3.211410f, 1, 256, 8841);
		sEAS.EnableWaypoints( creat );
	}
Beispiel #2
0
	void OnLootTaken(Player* pLooter, ItemPrototype *pItemInfo)
	{
		QuestLogEntry * en = pLooter->GetQuestLogForEntry(422);
		if(!en)
		return;

		float SSX = pLooter->GetPositionX();
		float SSY = pLooter->GetPositionY();
		float SSZ = pLooter->GetPositionZ();
		float SSO = pLooter->GetOrientation();

		Creature* NewCreature = pLooter->GetMapMgr()->GetInterface()->SpawnCreature(1770, SSX, SSY, SSZ, SSO, true, false, 0, 0);
		if ( NewCreature != NULL )
			NewCreature->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "The Sons of Arugal will rise against all who challenge the power of the Moonrage!");
	}
        void OnQuestComplete(Player* mTarget, QuestLogEntry* qLogEntry)
        {
            float X = mTarget->GetPositionX();
            float Y = mTarget->GetPositionY();
            float Z = mTarget->GetPositionZ();

            Creature* MacKinley = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(X, Y, Z, 2501);
            if(MacKinley)
            {
                std::string say = "Bah! ";
                say += mTarget->GetName();
                say += ", this foot won't budge!";
                MacKinley->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, say.c_str());
            }
        }
        void OnQuestComplete(Player* mTarget, QuestLogEntry* qLogEntry)
        {
            float X = mTarget->GetPositionX();
            float Y = mTarget->GetPositionY();
            float Z = mTarget->GetPositionZ();

            Creature* Crank = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(X, Y, Z, 2498);
            if(Crank)
            {
                std::string say = "Hm... if you're looking to adle wits. ";
                say += mTarget->GetName();
                say += ", then the secret behind Zanzil's zombies might just fo the trick!";
                Crank->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, say.c_str());
            }
        }
  void OnQuestComplete(Player* mTarget, QuestLogEntry *qLogEntry)
  {
    if(!mTarget)
		return;

    Creature *creat = mTarget->GetMapMgr()->GetSqlIdCreature(43727);
    if(creat == NULL)
      return;

    creat->SetUInt32Value(UNIT_FIELD_DISPLAYID,901);
	creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Ribbit! No! This cannot...ribbit...be! You have duped me with...ribbit..your foul trickery! Ribbit!");

	TimedEvent *te = TimedEvent::Allocate(this, new CallbackP1<Zenn_Foulhoof, Creature*>(this, &Zenn_Foulhoof::DemorpNPC, creat), 0, 50*1000, 1);  
	creat->event_AddEvent(te);
  }
        void GossipSelectOption(Object* pObject, Player* pPlayer, uint32 Id, uint32 IntId, const char* EnteredCode)
        {
            if(pPlayer == NULL)
                return;

            if(!pObject->IsCreature())
                return;

            switch(IntId)
            {
                case 0:
                    GossipHello(pObject, pPlayer);
                    break;
                case 1:
                    {
                        int32 i = -1;
                        Creature* pPrisoner = static_cast<Creature*>(pObject);
                        switch(pPrisoner->GetEntry())
                        {
                            case 20677:
                                i = 0;
                                break;
                            case 20678:
                                i = 1;
                                break;
                            case 20679:
                                i = 2;
                                break;
                        }

                        if(i == -1)
                            return;

                        QuestLogEntry* pQuest = pPlayer->GetQuestLogForEntry(10368);
                        if(pQuest != NULL && pQuest->GetMobCount(i) < pQuest->GetQuest()->required_mobcount[i])
                        {
                            pQuest->SetMobCount(i, pQuest->GetMobCount(i) + 1);
                            pQuest->SendUpdateAddKill(i);
                            pQuest->UpdatePlayerFields();

                            pPrisoner->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You've freed me! The winds speak to my people one again and grant us their strength. I thank you, stranger.");
                            pPrisoner->Despawn(5000, 6 * 60 * 1000);
                            pPrisoner->SetStandState(STANDSTATE_STAND);
                        }
                    }
                    break;
            }
        }
        void OnQuestComplete(Player* mTarget, QuestLogEntry* qLogEntry)
        {
            float SSX = mTarget->GetPositionX();
            float SSY = mTarget->GetPositionY();
            float SSZ = mTarget->GetPositionZ();

            Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 4452);
            if(creat == NULL)
                return;

            string msg = "Hahah! ";
            msg += mTarget->GetName();
            msg += ", you make quite a partner!";
            creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, msg.c_str());
            creat->Emote(EMOTE_ONESHOT_LAUGH);
        }
    void OnDied(Unit* mKiller)
    {
        if (!mKiller->isPlayer())
            return;

        Player* plr = static_cast<Player*>(mKiller);
        uint8 chance = (uint8)Util::getRandomUInt(5);
        uint32 spawn = 0;

        switch (chance)
        {
            case 0:
            case 1:
                spawn = 22459; //Freed Shat'ar Warrior
                break;

            case 2:
                spawn = 21661; //Cabal Skirmisher
                break;

            case 3:
                spawn = 16805; //Broken Skeleton
                break;

            case 4:
                spawn = 18470; //Bonelasher
                break;

            case 5:
                spawn = 22045; //Vengeful Husk
                break;
        }

        Creature* creat = plr->GetMapMgr()->CreateAndSpawnCreature(spawn, getCreature()->GetPositionX(), getCreature()->GetPositionY(), getCreature()->GetPositionZ(), 0);
        if (creat == nullptr)
            return;

        creat->Despawn(1 * 60 * 1000, 0);

        if (spawn != 22459)
            return;

        creat->GetAIInterface()->m_canMove = false;
        creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Finally! I'm free!");

        plr->AddQuestKill(10873, 0, 0);
    }
    void OnQuestStart(Player* mTarget, QuestLogEntry* /*qLogEntry*/) override
    {
        float SSX = mTarget->GetPositionX();
        float SSY = mTarget->GetPositionY();
        float SSZ = mTarget->GetPositionZ();

        Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 11856);
        if (creat == NULL)
            return;
        creat->m_escorter = mTarget;
        creat->GetAIInterface()->setWaypointScriptType(Movement::WP_MOVEMENT_SCRIPT_QUEST);
        creat->GetAIInterface()->StopMovement(10);
        creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Lets go");
        creat->setUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
        // Prevention "not starting from spawn after attacking"
        creat->GetAIInterface()->SetAllowedToEnterCombat(true);
        creat->SetFaction(1801);
    }
        void OnQuestStart(Player* mTarget, QuestLogEntry* qLogEntry)
        {
            float SSX = mTarget->GetPositionX();
            float SSY = mTarget->GetPositionY();
            float SSZ = mTarget->GetPositionZ();

            Creature* Overlord = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 4500);

            if(Overlord == NULL)
                return;

            std::string say = "Puny ";
            say += mTarget->GetName();
            say += " wanna fight Overlord Mok'Morokk? Me beat you! Me boss here!";
            Overlord->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, say.c_str());
            Overlord->SetFaction(72);
            Overlord->GetAIInterface()->disable_melee = false;
            Overlord->GetAIInterface()->SetAllowedToEnterCombat(true);
        }
Beispiel #11
0
	void OnQuestStart( Player* mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();

		Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 467);

				if(creat == NULL)
			return;
		creat->m_escorter = mTarget;
		creat->GetAIInterface()->setMoveType(11);
		creat->GetAIInterface()->SetAllowedToEnterCombat(false);
		creat->GetAIInterface()->StopMovement(3000);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Okay let's do this, you gotta protect me and stuff, I can't fight on my own!");
		creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);

		sEAS.CreateCustomWaypointMap(creat);
		sEAS.WaypointCreate(creat,-10521.876953f, 1064.410278f, 54.820744f, 3.220135f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10548.616211f, 1072.964111f, 49.694920f, 3.345799f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10596.891602f, 1057.281982f, 38.864330f, 3.451828f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10663.427734f, 1030.475952f, 32.725643f, 3.098398f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10715.894531f, 1030.825317f, 33.473114f, 3.165157f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10754.050781f, 1016.978821f, 32.843971f, 3.443188f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10917.114258f, 997.355408f, 35.466064f, 3.314383f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10937.306641f, 1020.598755f, 36.644848f, 1.488332f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10933.578125f, 1058.460571f, 36.027996f, 1.472624f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10958.590820f, 1105.329224f, 36.635437f, 2.076595f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10895.253906f, 1248.348877f, 33.385048f, 1.176529f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10890.806641f, 1297.475708f, 34.488716f, 1.698819f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10917.052734f, 1419.003296f, 42.823147f, 1.804847f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10948.415039f, 1422.049927f, 43.411053f, 3.332447f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-10989.025391f, 1410.501953f, 42.863670f, 2.673498f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-11016.258789f, 1434.814697f, 42.987415f, 2.005909f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-11024.154297f, 1488.091064f, 43.177536f, 1.566087f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-11048.541992f, 1513.367798f, 43.154915f, 2.369550f, 0, 256, 0);
		sEAS.WaypointCreate(creat,-11065.412109f, 1526.429321f, 43.328102f, 3.068554f, 0, 256, 0);
		sEAS.EnableWaypoints( creat );
	}
Beispiel #12
0
// The Big Bone Worm (Group)
bool Quest_TheBigBoneWorm(uint32 i, Aura* pAura, bool apply)
{
	if(apply)
		return true;

	if(!pAura->GetUnitCaster()->IsPlayer())
		return true;

	Player *plr = (Player*)pAura->GetUnitCaster();
	QuestLogEntry *qle = plr->GetQuestLogForEntry(10930);

	if(qle == NULL)
		return true;

	uint8 chance = RandomUInt(2);
	uint32 entry = 0;

	switch(chance)
	{
	case 0:
		entry = 22038;
		break;

	case 1:
		entry = 22483;
		break;

	case 2:
		entry = 22482;
		break;
	}

	Creature *creat = sEAS.SpawnCreature(plr, entry, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 5*60*1000);

	if(entry == 22483) //Sand Gnomes ;)
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "YIEEEEEEEAA!");

	return true;

}
Beispiel #13
0
void ProspectorAnvilwardGossip::OnSelectOption(Object* pObject, Player* Plr, uint32 Id, const char* /*Code*/, uint32 /*gossipId*/)
{
    switch (Id)
    {
        case 1:
        {
            Arcemu::Gossip::Menu menu(pObject->getGuid(), 8240, Plr->GetSession()->language);
            menu.AddItem(GOSSIP_ICON_CHAT, Plr->GetSession()->LocalizedGossipOption(461), 2);     // Why... yes, of course. I've something to show you right inside this building. Mr. Anvilward.
            menu.Send(Plr);
        }break;
        case 2:
        {
            Creature* pCreature = static_cast<Creature*>(pObject);

            pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, ANVILWARD_SAY_1);
            Arcemu::Gossip::Menu::Complete(Plr);
            pCreature->GetAIInterface()->setWaypointScriptType(Movement::WP_MOVEMENT_SCRIPT_QUEST);

            pCreature->GetAIInterface()->StopMovement(10);
        }break;
    }
};
Beispiel #14
0
bool AwakenPeon(uint32 i, Spell * pSpell)
{
	if ( pSpell == NULL || pSpell->p_caster == NULL )
		return true;

	Player * pPlayer = pSpell->p_caster;
	Unit * pUnit = pSpell->GetUnitTarget();
	if ( pUnit == NULL || !pUnit->IsCreature() )
		return true;

	Creature * pTarget = TO_CREATURE( pUnit );
	if ( !pTarget->HasAura( 17743 ) )
		return true;

	if ( pTarget->GetEntry() == 10556 )
	{
		QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 5441 );
		if ( pQuest == NULL || pQuest->GetMobCount(0) < pQuest->GetQuest()->required_mobcount[0] )
			return true;

		WorldPacket data(SMSG_PLAY_OBJECT_SOUND, 12);
		data << uint32( 6197 ) << pTarget->GetGUID();
		pPlayer->SendMessageToSet(&data, true);
		pTarget->RemoveAllAuras();
		string Text;
		Text = "Ow!  Ok, I'll get back to work, ";
		Text += pPlayer->GetName();
		Text += "!";
		pTarget->SendChatMessage( CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, Text.c_str() );
		pTarget->Emote( EMOTE_STATE_WORK_CHOPWOOD );

		pQuest->SetMobCount( 0, pQuest->GetMobCount(0)+1 );
		pQuest->SendUpdateAddKill( 0 );
		pQuest->UpdatePlayerFields();
	}

	return true;
}
Beispiel #15
0
	void OnQuestStart( Player* mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();


		Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 349);
				if(creat == NULL)
			return;
		creat->m_escorter = mTarget;
		creat->GetAIInterface()->setMoveType(11);
		creat->GetAIInterface()->StopMovement(3000);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Okay let's do!");
		creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);

		sEAS.CreateCustomWaypointMap(creat);
		sEAS.WaypointCreate(creat,-8769.745117f, -2186.538818f, 141.841599f, 3.457182f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8783.108398f, -2197.826416f, 140.165878f, 3.597175f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8828.141602f, -2188.636963f, 138.618134f, 4.815924f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8809.825195f, -2233.663574f, 144.356613f, 5.723056f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8795.662109f, -2242.221436f, 146.450958f, 5.408901f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8775.052734f, -2261.419922f, 149.575378f, 0.355398f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8690.659180f, -2241.627930f, 153.590225f, 5.829625f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8664.609375f, -2254.313232f, 154.770416f, 4.164592f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8675.779297f, -2278.719482f, 155.470612f, 4.643681f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8679.915039f, -2324.837646f, 155.916428f, 3.819015f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8760.700195f, -2386.090088f, 156.647003f, 4.206810f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8810.614258f, -2479.427246f, 133.146484f, 3.788514f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8927.923828f, -2590.238525f, 132.446716f, 3.439012f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-8992.492188f, -2607.978516f, 130.872818f, 2.472971f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-9123.129883f, -2498.676270f, 116.559822f, 1.946754f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-9165.129883f, -2376.718994f, 94.946968f, 2.406212f, 0, 256, 1826);
		sEAS.WaypointCreate(creat,-9278.547852f, -2296.741699f, 68.041824f, 2.861743f, 0, 256, 1826);
		sEAS.EnableWaypoints(creat);
	}
	void OnQuestStart( Player *mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetMapScript() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();

		Creature *creat = mTarget->GetMapMgr()->GetMapScript()->FindClosestCreature(2768, SSX, SSY, SSZ);
		if(creat == NULL)
			return;
		creat->m_escorter = mTarget;   
		creat->GetAIInterface()->setMoveType(11);
		creat->GetAIInterface()->StopMovement(3000);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Defens Me!");
		creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);

		CreateCustomWaypointMap(creat);
		for(uint32 i = 0; i < SunkenTreauseWPCount; i++)
		{
			WaypointCreate(creat, SunkenTreauseWP[i].mX, SunkenTreauseWP[i].mY, SunkenTreauseWP[i].mZ, 0.0f, 0, 256, 4049);
		}
		EnableWaypoints(creat);
	}
		void OnReachWP(uint32 i, bool usl)
		{
			if(i == 3 && check)
			{
				check = false;
				Creature* Arthas = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 26499);
				Creature* Jaina = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 26497);
				if(Arthas && Jaina)  //Show must go on!
				{
					//we add 0,5s per speech
					//1 = 0s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Glad you could make it, Uther...");
					Arthas->PlaySoundToSet(12828);
					//2 = 2,5s
					_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Watch your tone with me, boy. You may be the prince, but I'm still your superior as a paladin.", 2500);
					sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)12839, EVENT_UNK, 2500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//3 = 9s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "As if I could forget. Listen Uther, there's something about the plague you should know.", 9000);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12829, EVENT_UNK, 9000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//4 = 14,5s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Oh no, it's already begun. These people may look fine now, but it's only a matter of time before they turn into the Undead!", 14500);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12830, EVENT_UNK, 14500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//5 = 25s
					_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "What?!", 25000);
					sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)12840, EVENT_UNK, 25000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//6 = 26,5s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "This entire city must be purged.", 26500);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12831, EVENT_UNK, 26500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//7 = 29s
					_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "How can you even consider that? There's *got* to be some other way.", 29000);
					sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)12841, EVENT_UNK, 29000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//8 = 33,5s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Damn it, Uther! As your future king, I order you to purge this city!", 33500);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12832, EVENT_UNK, 33500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//9 = 38s
					_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You are *not* my king yet, boy. Nor would I obey that command even if you were.", 38000);
					sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)12842, EVENT_UNK, 38000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//10 = 44,5s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Then I must consider this an act of treason.", 44500);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12833, EVENT_UNK, 44500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//11 = 49s
					_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Treason?! Have you lost your mind, Arthas?", 49000);
					sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)12843, EVENT_UNK, 49000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//12 = 53,5s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Have I? Lord Uther, by my right of succession and the sovereignty of my crown, I hereby relieve you of your command, and suspend your paladins from service.", 53500);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12834, EVENT_UNK, 53500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//13 = 65s
					Jaina->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Arthas! You can't just--", 65000);
					sEventMgr.AddEvent(TO_OBJECT(Jaina), &Object::PlaySoundToSet, (uint32)12837, EVENT_UNK, 65000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//14 = 67,5s
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "It's done! Those of you who have the will to save this land, follow me. The rest of you... get out of my sight.", 67500);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12835, EVENT_UNK, 67500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//15 = 77s
					//here few knights should leave, after speech, Uther should leave also
					_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You've just crossed a terrible threshold, Arthas.", 77000);
					sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)12844, EVENT_UNK, 77000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//16 = 80,5s
					//Jaina begins leaving
					Arthas->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Jaina? ", 80500);
					sEventMgr.AddEvent(TO_OBJECT(Arthas), &Object::PlaySoundToSet, (uint32)12836, EVENT_UNK, 80500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//17 = 82s
					Jaina->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I'm sorry, Arthas. I can't watch you do this...", 82000);
					sEventMgr.AddEvent(TO_OBJECT(Jaina), &Object::PlaySoundToSet, (uint32)12838, EVENT_UNK, 82000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					//trigger Arthas actions = 86,5s
					sEventMgr.AddEvent(Arthas, &Creature::CallScriptUpdate, EVENT_SCRIPT_UPDATE_EVENT, 86500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					_unit->Despawn(100000, 0);
				}
			}
		}
Beispiel #18
0
	void OnQuestStart( Player* mTarget, QuestLogEntry * qLogEntry)
	{
				if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();


		Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 3465);
		if(creat == NULL)
			return;		
		creat->m_escorter = mTarget;   
		creat->GetAIInterface()->setMoveType(11);
		creat->GetAIInterface()->SetAllowedToEnterCombat(false);
		creat->GetAIInterface()->StopMovement(3000);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Enough talk, help me get back to Ratchet will you? Let me know when you're ready and we'll make our break!");
		creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);

		sEAS.CreateCustomWaypointMap(creat);
		sEAS.WaypointCreate(creat,-1607.61f, -3846.03f, 14.3572f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1601.69f, -3845.79f, 14.4817f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1594.94f, -3844.55f, 14.823f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1588.44f, -3843.31f, 15.354f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1581.88f, -3842.06f, 16.2485f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1575.89f, -3840.92f, 17.1104f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1570.30f, -3839.8f, 17.9687f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1564.34f, -3838.72f, 18.9013f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1558.74f, -3837.65f, 19.0262f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1552.89f, -3836.54f, 18.7007f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1547.43f, -3835.5f, 18.6492f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1541.33f, -3834.44f, 18.9799f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1536.76f, -3835.05f, 19.4686f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1531.07f, -3835.98f, 20.3061f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1523.45f, -3837.19f, 21.3995f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1517.71f, -3837.22f, 22.2306f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1511.25f, -3837.25f, 23.0413f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1505.6f, -3837.28f, 23.6246f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1500.16f, -3837.31f, 23.8903f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1495.08f, -3837.33f, 23.9026f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1489.17f, -3837.59f, 23.8869f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1482.45f, -3837.57f, 23.63f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1476.31f, -3837.61f, 23.194f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1467.31f, -3839.26f, 22.3576f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1460.5f, -3841.34f, 21.7234f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1454.07f, -3843.84f, 21.0815f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1445.73f, -3846.94f, 20.289f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1437.76f, -3847.57f, 19.8442f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1429.79f, -3848.21f, 19.3784f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1423.26f, -3848.67f, 18.9816f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1415.31f, -3847.78f, 18.5469f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1406.03f, -3845.68f, 17.8986f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1399.99f, -3843.36f, 17.8729f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1375.81f, -3840.52f, 18.7323f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1372.16f, -3838.88f, 18.8057f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1361.21f, -3832.72f, 17.926f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1355.54f, -3828.14f, 17.5429f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1348.75f, -3822.75f, 17.5781f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1338.12f, -3816.78f, 17.5464f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1328.21f, -3811.28f, 17.6097f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1320.31f, -3807.99f, 18.1579f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1313.69f, -3804.48f, 19.2114f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1305.6f, -3799.6f, 20.4015f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1302.12f, -3792.88f, 20.6411f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1296.79f, -3786.92f, 22.0117f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1290.65f, -3780.14f, 24.335f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1286.06f, -3777.14f, 26.583f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1280.86f, -3776.57f, 27.7688f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1273.94f, -3779.63f, 26.4915f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1264.78f, -3783.29f, 26.6199f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1256.33f, -3783.53f, 26.094f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1248.37f, -3784.3f, 25.5332f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1240.41f, -3785.08f, 25.1034f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1231.61f, -3784.21f, 24.472f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1223.92f, -3782.33f, 23.623f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1216.24f, -3779.79f, 24.0898f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1208.55f, -3777.58f, 24.5246f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1197.85f, -3772.64f, 23.8734f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1191.31f, -3770.45f, 23.4831f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1184.86f, -3768.21f, 23.2267f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1174.51f, -3761.98f, 22.8914f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1167.65f, -3757.85f, 22.2859f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1159.04f, -3752.67f, 21.3435f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1152.09f, -3748.49f, 20.238f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1145.65f, -3744.69f, 18.7876f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1138.34f, -3742.05f, 17.6977f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1131.72f, -3739.67f, 17.0391f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1121.53f, -3736.45f, 17.7398f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1115.49f, -3736.1f, 17.7868f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1107.49f, -3735.9f, 18.1145f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1099.49f, -3735.69f, 18.714f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1091.5f, -3735.49f, 19.1923f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1083.5f, -3735.28f, 19.3328f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1074.13f, -3734.84f, 19.4273f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1065.55f, -3730.66f, 19.8925f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1063.96f, -3727.33f, 20.5922f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1060.76f, -3719.66f, 22.14f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1057.56f, -3712.33f, 24.3349f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1054.37f, -3705.33f, 25.9164f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1050.46f, -3697.17f, 26.9811f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1048.16f, -3694.28f, 26.3632f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1042.54f, -3689.67f, 24.7195f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1036.35f, -3684.61f, 23.4694f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1030.22f, -3679.16f, 23.1939f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1024.87f, -3671.21f, 22.8851f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1019.65f, -3668.06f, 22.237f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1013.34f, -3666.59f, 21.184f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-1003.49f, -3665.46f, 19.6068f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-998.347f, -3661.75f, 19.4684f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-991.859f, -3657.07f, 18.869f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-985.371f, -3652.39f, 18.4673f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-980.152f, -3648.56f, 18.5684f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-974.281f, -3643.16f, 18.2057f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-965.768f, -3640.76f, 16.6939f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-960.052f, -3642.37f, 15.2018f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-956.27f, -3647.81f, 12.6505f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-955.801f, -3655.79f, 10.7971f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-955.332f, -3663.78f, 9.82122f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-954.707f, -3671.47f, 9.07335f, 3.098398f, 0, 256, 19805);
		sEAS.WaypointCreate(creat,-951.746f, -3678.91f, 8.21153f, 3.098398f, 0, 256, 19805);
		sEAS.EnableWaypoints( creat );
	}
		void OnQuestComplete(Player* mTarget, QuestLogEntry* qLogEntry)
		{
			Creature* creat = mTarget->GetMapMgr()->GetInterface()->SpawnCreature(1946, 2467.314f, 14.8471f, 23.5950f, 0, true, false, 0, 0);
			creat->Despawn(60000, 0);
			creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "You have disturbed my rest. Now face my wrath!");
		}
Beispiel #20
0
	void OnQuestStart( Player* mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();


		Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 3439);
		if(creat == NULL)
			return;
		creat->m_escorter = mTarget;   
		creat->GetAIInterface()->setMoveType(11);
		creat->GetAIInterface()->SetAllowedToEnterCombat(false);
		creat->GetAIInterface()->StopMovement(3000);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Okay let's do this, you gotta protect me and stuff, I can't fight on my own!");
		creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);


		sEAS.CreateCustomWaypointMap(creat);

		sEAS.WaypointCreate(creat,1113.4f, -3110.22f, 82.4277f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1119.19f, -3122.02f, 82.5178f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1118.31f, -3139.95f, 82.8615f, 3.098398f, 0, 256, 11912);								
		sEAS.WaypointCreate(creat,1121.38f, -3147.83f, 84.6616f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1124.61f, -3156.1f, 88.7833f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1130.02f, -3162.84f, 91.8255f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1135.39f, -3169.53f, 92.1331f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1140.67f, -3182.66f, 91.89f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1152.04f, -3208.41f, 91.6341f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1146.66f, -3232.49f, 91.6839f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1134.9f, -3271.74f, 91.6708f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1128.68f, -3292.49f, 92.4652f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1122.19f, -3314.16f, 92.6764f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1115.32f, -3337.09f, 91.7156f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1109.38f, -3356.92f, 92.9116f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1105.75f, -3369.05f, 94.1855f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1100.28f, -3387.33f, 94.1077f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1095.44f, -3403.48f, 92.2158f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1089.72f, -3422.56f, 91.4141f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1088.96f, -3430.99f, 90.8609f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1087.98f, -3441.86f, 89.2736f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1086.62f, -3456.92f, 85.1732f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1081.47f, -3467.23f, 82.0964f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1076.72f, -3476.72f, 79.1774f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1071.38f, -3487.4f, 77.395f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1076.77f, -3495.27f, 75.1605f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1088.36f, -3504.89f, 73.3598f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1084.75f, -3514.3f, 71.8212f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1080.68f, -3524.89f, 69.9172f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1076.34f, -3536.21f, 66.6681f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1072.30f, -3547.52f, 63.0944f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1066.32f, -3562.31f, 60.1643f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1069.11f, -3573.12f, 58.152f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1071.14f, -3580.96f, 56.8904f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1061.25f, -3590.68f, 54.482f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1050.3f, -3601.45f, 52.8842f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1045.51f, -3606.16f, 51.8961f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1039.6f, -3615.77f, 49.1786f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1035.35f, -3630.47f, 45.3412f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1032.73f, -3639.51f, 42.9659f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1029.05f, -3652.25f, 38.7237f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1025.66f, -3663.95f, 35.4199f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1023.06f, -3672.94f, 33.6937f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1018.17f, -3689.83f, 29.327f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1014.29f, -3703.26f, 28.1314f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1011.5f, -3712.89f, 28.3098f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1007.59f, -3726.41f, 28.5626f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1005.23f, -3734.59f, 28.226f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,1000.71f, -3750.21f, 27.2183f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,991.184f, -3745.22f, 27.3147f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,980.426f, -3743.73f, 27.1928f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,967.803f, -3739.3f, 27.1358f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,960.049f, -3736.57f, 27.1334f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,950.89f, -3728.36f, 27.1419f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,944.546f, -3722.67f, 27.1419f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,932.694f, -3720.85f, 27.1827f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,918.623f, -3721.25f, 27.155f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,906.234f, -3722.75f, 27.1815f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,888.526f, -3720.43f, 27.1757f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,872.566f, -3719.05f, 27.1022f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,860.014f, -3717.95f, 27.143f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,829.08f, -3720.65f, 27.1734f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,806.728f, -3719.8f, 27.2459f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,739.49f, -3716.49f, 27.3376f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,721.539f, -3719.41f, 27.1518f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,681.091f, -3718.2f, 26.8029f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,650.641f, -3722.22f, 26.7092f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,635.284f, -3724.97f, 26.9639f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,603.042f, -3719.17f, 27.1852f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,576.173f, -3714.34f, 27.1907f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,564.184f, -3713.83f, 27.1849f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,539.246f, -3712.76f, 27.1729f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,517.794f, -3701.6f, 27.257f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,502.569f, -3693.69f, 27.1875f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,497.299f, -3690.95f, 27.1848f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,462.66f, -3687.48f, 27.1848f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,431.287f, -3686.83f, 27.1848f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,413.891f, -3686.46f, 27.1848f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,394.705f, -3676.41f, 27.1848f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,374.136f, -3659.1f, 27.1848f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,349.007f, -3649.73f, 27.1857f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,319.978f, -3648.94f, 27.1862f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,319.978f, -3648.94f, 27.1862f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,303.064f, -3628.28f, 27.4367f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,291.016f, -3613.57f, 29.0272f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,281.84f, -3611.71f, 30.2372f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,266.977f, -3612.43f, 31.1779f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,254.811f, -3613.01f, 31.6233f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,245.462f, -3613.47f, 31.5706f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,231.717f, -3617.76f, 30.9447f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,218.659f, -3621.84f, 30.1022f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,209.439f, -3624.72f, 29.4542f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,199.989f, -3627.67f, 29.2537f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,186.186f, -3631.98f, 28.14f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,167.974f, -3637.67f, 27.2364f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,154.744f, -3641.8f, 27.2517f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,143.806f, -3645.22f, 27.3126f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,132.638f, -3648.7f, 27.2088f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,120.611f, -3652.46f, 27.1889f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,107.037f, -3656.7f, 27.185f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,95.5258f, -3660.3f, 27.185f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,82.1243f, -3664.48f, 27.185f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,70.9563f, -3667.97f, 27.1943f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,59.0439f, -3671.69f, 27.9463f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,45.5851f, -3675.89f, 29.0178f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,36.5935f, -3678.7f, 29.3503f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,26.3991f, -3681.89f, 29.4141f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,22.4474f, -3683.12f, 29.4396f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,8.81682f, -3687.38f, 29.0755f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-5.01755f, -3688.22f, 27.2689f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-18.7321f, -3689.06f, 27.1837f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-27.6556f, -3689.6f, 27.1804f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-42.5709f, -3696.07f, 27.0441f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-55.1746f, -3701.55f, 28.0819f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-68.5347f, -3702.28f, 29.0473f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-79.0191f, -3702.85f, 27.8198f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-92.7386f, -3703.6f, 26.9801f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-107.716f, -3704.42f, 27.0756f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-122.42f, -3708.86f, 27.1443f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-140.8f, -3714.41f, 27.1919f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-157.17f, -3719.35f, 27.7222f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-175.697f, -3730.1f, 27.2898f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-185.142f, -3735.58f, 27.2565f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-199.367f, -3743.84f, 28.6632f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-214.832f, -3752.81f, 27.2439f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-227.442f, -3760.13f, 26.4763f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-237.718f, -3766.09f, 26.0274f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-249.758f, -3773.08f, 26.997f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-259.71f, -3775.02f, 28.0756f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-273.843f, -3777.78f, 29.9517f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-286.622f, -3780.27f, 31.3675f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-303.287f, -3783.53f, 32.0795f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-319.305f, -3786.65f, 30.1144f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-330.553f, -3788.85f, 27.8853f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-342.072f, -3797.98f, 27.1848f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-352.839f, -3806.52f, 27.7424f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-364.782f, -3815.98f, 28.0461f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-377.015f, -3818.45f, 27.8833f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-391.249f, -3821.32f, 29.0991f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-402.541f, -3823.6f, 30.3326f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-416.411f, -3829.47f, 30.8822f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-428.845f, -3834.73f, 30.4149f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-445.092f, -3841.6f, 28.8669f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-455.425f, -3845.97f, 28.8621f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-470.898f, -3852.51f, 28.5759f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-487.256f, -3859.43f, 27.1612f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-499.413f, -3864.57f, 27.2075f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-509.691f, -3868.92f, 27.9372f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-520.246f, -3873.38f, 29.2394f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-529.364f, -3877.24f, 29.7561f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-539.753f, -3881.64f, 29.5172f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-548.208f, -3885.21f, 29.2254f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-561.084f, -3890.66f, 28.795f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-576.06f, -3896.99f, 28.4577f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-592.748f, -3904.05f, 27.6594f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-606.95f, -3910.06f, 28.5744f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-615.792f, -3913.79f, 28.8637f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-627.286f, -3918.66f, 28.731f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-627.286f, -3918.66f, 28.731f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-647.512f, -3927.21f, 26.4148f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-658.491f, -3927.29f, 26.6015f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-672.711f, -3927.4f, 27.173f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-683.811f, -3927.48f, 26.1342f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-692.03f, -3927.54f, 25.6526f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-702.11f, -3927.62f, 25.1975f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-721.55f, -3927.76f, 23.8796f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-732.469f, -3927.84f, 23.1171f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-746.962f, -3923.75f, 21.7104f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-753.487f, -3921.9f, 21.0421f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-762.783f, -3919.28f, 19.5729f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-773.176f, -3916.34f, 16.9823f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-779.354f, -3914.6f, 15.1756f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-784.848f, -3908.98f, 13.2143f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-790.426f, -3903.27f, 11.2414f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-796.382f, -3897.18f, 8.97999f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-800.074f, -3888.44f, 8.34248f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-803.347f, -3880.71f, 8.0567f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-807.413f, -3871.09f, 7.89321f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-811.2f, -3862.14f, 7.98673f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-814.963f, -3853.24f, 8.50162f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-819.941f, -3841.47f, 9.26294f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-825.901f, -3827.38f, 8.80521f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-828.589f, -3821.03f, 9.38863f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-832.959f, -3810.69f, 10.1485f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-836.746f, -3801.74f, 11.6839f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-839.807f, -3794.5f, 13.3517f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-846.928f, -3788.8f, 13.8683f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-850.98f, -3782.56f, 15.4662f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-855.229f, -3776.02f, 16.6032f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-857.811f, -3772.05f, 17.612f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-861.766f, -3765.96f, 18.6269f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-868.647f, -3761.04f, 18.5869f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-877.786f, -3758.52f, 16.6433f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-883.917f, -3756.83f, 14.9905f, 3.098398f, 0, 256, 11912);
		sEAS.WaypointCreate(creat,-892.883f, -3760.42f, 12.4808f, 3.098398f, 0, 256, 11912);
		sEAS.EnableWaypoints( creat );

	}
Beispiel #21
0
void GameEventMgr::DoScript(uint32 event_id, uint32 sql_id, uint8 type, uint32 data1, uint32 data2, uint32 data3, char * say, uint32 mapid)
{
	MapMgr * mapmgr = sInstanceMgr.GetMapMgr( mapid );
	if( mapmgr == NULL )
		return;

	Creature *c;
	GameObject *go;
	if(type < GAMEOBJECT_CHANGE_STATE)
	{
		c = mapmgr->GetSqlIdCreature( sql_id );
		if( c == NULL ) return;
	}
	else
	{
		go = mapmgr->GetSqlIdGameObject( sql_id );
		if( go == NULL ) return;
	}

	// create backup for original values
	EventScript * es = new EventScript();
	es->sql_id = sql_id;
	es->mapid = mapid;
	es->type = type;
	es->data_1 = 0; // null them out first!
	es->data_2 = 0;
	es->data_3 = 0;

	if( c && strlen(say) )
	{
		c->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, say);
	}

	switch( type )
	{
		case CREATURE_CHANGE_SCRIPTED_CHANGE:
		{
			CALL_SCRIPT_EVENT(c, GameEventStart)(event_id);
		} break;
		case CREATURE_CHANGE_EMOTE:
		{
			// do not backup one-shoot emote
			c->Emote(EmoteType(data1));

			// backup emote state first
			es->data_2 = c->GetEmoteState();
			c->SetEmoteState(data2);

			// backup stand state
			es->data_3 = static_cast<uint32>(c->GetStandState());
			c->SetStandState(static_cast<uint8>(data3));
		} break;

		case CREATURE_CHANGE_DISPLAYID:
		{
			es->data_1 = c->GetDisplayId();
			c->SetDisplayId(data1);
			es->data_2 = c->GetNativeDisplayId();
			c->SetNativeDisplayId(data2);
			es->data_3 = c->GetMount();
			c->SetMount(data3);

			c->EventModelChange();
		} break;

		case CREATURE_CHANGE_WEAPON:
		{
			es->data_1 = c->GetEquippedItem(MELEE);
			es->data_2 = c->GetEquippedItem(OFFHAND);
			es->data_3 = c->GetEquippedItem(RANGED);
			c->SetEquippedItem(MELEE, data1);
			c->SetEquippedItem(OFFHAND, data2);
			c->SetEquippedItem(RANGED, data3);
		} break;

		case CREATURE_CHANGE_REACT:
		{
			es->data_1 = c->GetFaction();
			c->SetFaction(data1);
			es->data_2 = c->GetUInt32Value(UNIT_NPC_FLAGS);
			c->SetUInt32Value(UNIT_NPC_FLAGS, data2);
			es->data_3 = c->GetUInt32Value(UNIT_FIELD_FLAGS);
			c->SetUInt32Value(UNIT_FIELD_FLAGS, data3);
		} break;

		case CREATURE_CAST_SPELL_ON_EVENT_START:
		{
			SpellEntry * sp = dbcSpell.LookupEntryForced( data1 );
			if( sp == NULL )
				return;

			SpellCastTime * casttime = dbcSpellCastTime.LookupEntry(sp->CastingTimeIndex);
			Spell * spell = sSpellFactoryMgr.NewSpell(c, sp, false, NULL);

			SpellCastTargets t(0);

			// force self casting
			if( data2 )
			{
				t.m_unitTarget = c->GetGUID();
			}
			else
			{
				spell->GenerateTargets(&t);
				spell->m_targets = t;
			}

			if (objmgr.IsSpellDisabled(spell->GetProto()->Id) || spell->CanCast(false) != SPELL_CANCAST_OK || !spell->HasPower() || c->m_silenced || c->IsStunned() || c->IsFeared() )
			{
				delete spell;
				return;
			}

			if( casttime->CastTime > 0 )
				c->GetAIInterface()->StopMovement(casttime->CastTime);

			spell->prepare(&t);

		} break;

		case CREATURE_CAST_SPELL_ON_EVENT_STOP:
		{
			// this time just backup it, we will procez it on event end
			es->data_1 = data1;
			es->data_2 = data2;
		} break;

		case CREATURE_CHANGE_UPDATE_FIELD:
		{
			es->data_1 = data1;
			es->data_2 = c->GetUInt32Value(data1);
			c->SetUInt32Value(data1, data2);
		} break;

		case CREATURE_CHANGE_DESPAWN:
		{
			GameEventMap::iterator itr = CheckAndReturnEvent( event_id );
			if( itr == m_GameEventMap.end() )
				return;

			uint32 current_time = mktime(&g_localTime);
			// this is calculated in seconds and added 1 extra second as timer for spawn and despawn
			uint32 respawntime = itr->second->end_time - current_time + 1;
			// values here are in miliseconds
			c->Despawn(0, respawntime*1000);
			delete es;
			return;
		} break;

		case GAMEOBJECT_CHANGE_STATE:
		{
			es->data_1 = (uint32)go->GetState();
			go->SetState((uint8)data1);
		} break;
	}

	// insert event into storage
	GameEventScriptMap::iterator itr = m_GameEventScriptBackup.find(event_id);
	if( itr == m_GameEventScriptBackup.end() )
	{
		set< EventScript* > s;
		s.insert( es );
		m_GameEventScriptBackup.insert(make_pair(event_id, s));
	}
	else
	{
		itr->second.insert( es );
	}
}
Beispiel #22
0
	void OnQuestStart( Player* mTarget, QuestLogEntry * qLogEntry)
	{
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return;
		float SSX = mTarget->GetPositionX();
		float SSY = mTarget->GetPositionY();
		float SSZ = mTarget->GetPositionZ();

		Creature* creat = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 10427);
		if(creat == NULL)
			return;
		creat->m_escorter = mTarget;
		creat->GetAIInterface()->setMoveType(11);
		creat->GetAIInterface()->SetAllowedToEnterCombat(false);
		creat->GetAIInterface()->StopMovement(3000);
		creat->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Please help me, you gotta protect me and stuff, I can't fight on my own!");
		creat->SetUInt32Value(UNIT_NPC_FLAGS, 0);

		sEAS.CreateCustomWaypointMap(creat);
		sEAS.WaypointCreate(creat,-5005.66f, -882.705f, -6.05186f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4968.67f, -937.131f, -4.99042f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4968.03f, -958.455f, -5.53631f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4968.48f, -986.432f, -4.80345f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4975.32f, -998.646f, -5.12671f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4970.91f, -1014.12f, -5.47358f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4963.23f, -1026.1f, -4.9985f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4957.29f, -1035.31f, -5.62972f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4952.49f, -1042.99f, -8.61785f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4946.27f, -1053.72f, -15.9727f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4936.83f, -1054.79f, -22.0583f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4929.3f, -1054.22f, -25.8246f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4917.66f, -1051.53f, -30.242f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4909.1f, -1049.48f, -33.0802f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4902.48f, -1052.76f, -33.4847f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4904.48f, -1056.73f, -33.8546f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4910.38f, -1064.18f, -38.8506f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4914.76f, -1069.12f, -42.8664f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4918.88f, -1073.68f, -45.7238f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4924.54f, -1078.76f, -48.3099f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4931.68f, -1084.4f, -51.0179f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4926.66f, -1090.7f, -53.2325f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4919.66f, -1096.19f, -53.3382f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4911.05f, -1099.43f, -53.7044f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4903.92f, -1102.06f, -54.9974f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4897.52f, -1101.48f, -55.4563f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4896.49f, -1104.66f, -55.2742f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4894.82f, -1110.74f, -53.9336f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4892.71f, -1118.51f, -51.0561f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4888.98f, -1125.24f, -50.4447f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4884.62f, -1131.47f, -50.44f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4880.34f, -1137.57f, -50.5127f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4875.03f, -1144.52f, -50.5812f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4868.65f, -1152.74f, -50.9722f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4860.4f, -1160.88f, -50.6212f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4854.03f, -1167.17f, -49.6659, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4849.72f, -1171.42f, -48.9519f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4844.17f, -1176.9f, -48.3381f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4841.19f, -1182.11f, -48.7754f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4836.73f, -1189.87f, -49.3734f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4841.24f, -1195.48f, -49.4889f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4848.26f, -1198.64f, -49.3465f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4855.31f, -1202.44f, -48.8531f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4862.2f, -1206.18f, -48.6235f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4869.06f, -1209.9f, -46.1434f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4877.32f, -1214.39f, -44.1166f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4885.63f, -1218.9f, -43.5811f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4893.63f, -1223.24f, -42.5644f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4899.27f, -1228.69f, -42.2637f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4906.03f, -1235.23f, -41.9083f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4911.57f, -1240.58f, -42.9282f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4916.96f, -1245.79f, -43.973f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4921.24f, -1249.92f, -45.7031f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4924.52f, -1256.67f, -46.0392f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4927.78f, -1263.37f, -46.5725f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4932.77f, -1273.62f, -47.139f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4935.51f, -1279.24f, -47.1182f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4935.57f, -1285.64f, -46.7144f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4935.14f, -1293.67f, -46.2301f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4934.16f, -1302.12f, -46.1045f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4933.4f, -1308.37f, -46.5583f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4931.24f, -1315.97f, -47.6485f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4929.03f, -1323.71f, -48.8701f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4926.87f, -1331.31f, -49.926f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4922.54f, -1338.16f, -50.7557f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4917.05f, -1344.31f, -51.2097f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4910.32f, -1348.82f, -51.5222f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4903.97f, -1353.76f, -50.9117f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4901.07f, -1361.11f, -51.4375f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4901.38f, -1369.51f, -52.6119f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4904.58f, -1376.73f, -52.6119f, 3.098398f, 0, 256, 9900);
		sEAS.WaypointCreate(creat,-4910.54f, -1378.76f, -52.6119f, 3.098398f, 0, 256, 9900);
		sEAS.EnableWaypoints(creat);
	}
		void AIUpdate()
		{
			switch(phase)
			{
				case 0:
					{
						_unit->GetAIInterface()->StopMovement(0);
						_unit->GetAIInterface()->SetAIState(STATE_SCRIPTMOVE);
						_unit->GetAIInterface()->setMoveType(MOVEMENTTYPE_WANTEDWP);
						_unit->GetAIInterface()->setWaypointToMove(1);
					}
					break;
				case 1:
					{
						_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I can only help you with a clean death.", 300);
						sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)14294, EVENT_UNK, 100, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
						Creature* citizen = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 28167);
						if(citizen)
						{
							_unit->GetAIInterface()->MoveTo(citizen->GetPositionX(), citizen->GetPositionY(), citizen->GetPositionZ(), citizen->GetOrientation());
							_unit->DealDamage(citizen, citizen->GetUInt32Value(UNIT_FIELD_HEALTH), 0, 0, 0);
						}
						citizen = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 28169);
						if(citizen)
						{
							_unit->GetAIInterface()->MoveTo(citizen->GetPositionX(), citizen->GetPositionY(), citizen->GetPositionZ(), citizen->GetOrientation());
							_unit->DealDamage(citizen, citizen->GetUInt32Value(UNIT_FIELD_HEALTH), 0, 0, 0);
						}
						_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "That was just the beginning.", 1000);
						sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)14295, EVENT_UNK, 1000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
						phase++;
						sEventMgr.AddEvent(_unit, &Creature::CallScriptUpdate, EVENT_SCRIPT_UPDATE_EVENT, 1500, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
					}
					break;
				case 2:
					{
						//we need that tricky animation here
						//spawn Mal'Ganis
						CreatureProto* cp = CreatureProtoStorage.LookupEntry(26533);
						CreatureInfo* ci = CreatureNameStorage.LookupEntry(26533);
						Creature* c = NULL;
						if(cp && ci)
						{
							c = _unit->GetMapMgr()->CreateCreature(26533);
							if(c)
							{
								//position is guessed
								c->Load(cp, 2113.52f, 1288.01f, 136.382f, 2.30383f);
								c->PushToWorld(_unit->GetMapMgr());
							}
						}
						if(c)
						{
							c->bInvincible = true;
							c->GetAIInterface()->m_canMove = false;
							c->GetAIInterface()->SetAllowedToEnterCombat(false);
							for(uint8 i = 0; i < 7; i++)
								c->SchoolImmunityList[i] = 1;
							c->SetUInt64Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
							//1 = 0s
							c->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Yes, this is the beginning. I've been waiting for you, young prince. I am Mal'Ganis.");
							c->PlaySoundToSet(14410);
							//2 = 13s
							//change all citizens to undeads...
							sEventMgr.AddEvent(c, &Creature::CallScriptUpdate, EVENT_SCRIPT_UPDATE_EVENT, 13000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
							c->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "As you can see, your people are now mine. I will now turn this city, household by household, until the flame of life has been snuffed out forever.", 13000);
							sEventMgr.AddEvent(TO_OBJECT(c), &Object::PlaySoundToSet, (uint32)14411, EVENT_UNK, 13000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
							//2 = 32s
							_unit->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "I won't allow it Mal'Ganis better than these people die by my hand than serve as your slaves in death.", 32000);
							sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)14296, EVENT_UNK, 32000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
							c->Despawn(38500, 0);
							//3 = 37s
							/*sEventMgr.AddEvent(TO_UNIT(_unit), &Unit::SendChatMessage, (uint8)CHAT_MSG_MONSTER_SAY, (uint32)LANG_UNIVERSAL,
							"Mal'Ganis will send out some of his blablabla - write that txt",
							EVENT_UNIT_CHAT_MSG, 37000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);*/
							sEventMgr.AddEvent(TO_OBJECT(_unit), &Object::PlaySoundToSet, (uint32)14885, EVENT_UNK, 39000, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
						}
					}
					break;
			}
		}