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

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

        if (Dashel == nullptr)
            return;

        Dashel->SetFaction(72);
        Dashel->GetAIInterface()->setMeleeDisabled(false);
        Dashel->GetAIInterface()->SetAllowedToEnterCombat(true);
    }
		void OnQuestStart(Player* mTarget, QuestLogEntry* qLogEntry)
		{
			float SSX = mTarget->GetPositionX();
			float SSY = mTarget->GetPositionY();
			float SSZ = mTarget->GetPositionZ();

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

			if(Dashel == NULL)
				return;

			Dashel->SetFaction(28);
			Dashel->GetAIInterface()->disable_melee = false;
			Dashel->GetAIInterface()->SetAllowedToEnterCombat(true);
		}
Beispiel #3
0
bool SummonSuccubusQuest(uint8_t /*effectIndex*/, Spell* s)
{
    CreatureProperties const* cp = sMySQLStore.getCreatureProperties(5677);
    if (cp == nullptr)
        return false;

    Creature* pCreature = s->p_caster->GetMapMgr()->CreateCreature(cp->Id);
    pCreature->Load(cp, s->p_caster->GetPositionX(), s->p_caster->GetPositionY(), s->p_caster->GetPositionZ());
    pCreature->GetAIInterface()->Init(pCreature, AI_SCRIPT_AGRO, Movement::WP_MOVEMENT_SCRIPT_NONE);
    pCreature->GetAIInterface()->taunt(s->p_caster, true);
    pCreature->PushToWorld(s->p_caster->GetMapMgr());
    pCreature->Despawn(60000, 0);

    return true;
}
		void OnQuestStart(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, 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 #5
0
	void OnQuestStart(Player* pPlayer, QuestLogEntry* qLogEntry)
	{
		Creature *windwatcher = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 6176);
		if(!windwatcher) return;

		// questgiver will walk to the place where Cyclonian is spawned
		// only walk when we are at home
		if(windwatcher->CalcDistance(250.839996f, -1470.579956f, 55.4491f) > 1) return;
		{
			windwatcher->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Follow me");
			sEAS.CreateCustomWaypointMap(windwatcher);
			sEAS.WaypointCreate(windwatcher, 269.29f, -1433.32f, 50.31f, 0.19f, 0, 0, 0);
			sEAS.WaypointCreate(windwatcher, 328.52f, -1442.03f, 40.5f, 5.65f, 0, 0, 0);
			sEAS.WaypointCreate(windwatcher, 333.31f, -1453.69f, 42.01f, 4.68f, 0, 0, 0);
			sEAS.EnableWaypoints(windwatcher);
			windwatcher->GetAIInterface()->setMoveType(11);
		}
		windwatcher->Despawn(15*60*1000, 0);

		// spawn cyclonian if not spawned already
		Creature *cyclonian = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(323.947f, -1483.68f, 43.1363f, 6239);
		if( cyclonian == NULL)
		{
			cyclonian = sEAS.SpawnCreature(pPlayer, 6239, 323.947f, -1483.68f, 43.1363f, 0.682991f);

			// if spawning cyclonian failed, we have to return.
			if(cyclonian == NULL)
				return;
		}

		// queue cyclonian for despawn
		cyclonian->Despawn(15*60*1000, 0);
	}
Beispiel #6
0
bool InducingVision(uint32 i, Spell * pSpell)
{
		if(!pSpell->p_caster) return true;
		Player *mTarget = pSpell->p_caster;
		if( mTarget == NULL || mTarget->GetMapMgr() == NULL || mTarget->GetMapMgr()->GetInterface() == NULL )
			return true;
		  Creature *creat = mTarget->GetMapMgr()->GetInterface()->SpawnCreature(2983, -2238.994873f, -408.009552f, -9.424423f, 5.753043f, true, false, 0, 0);
		  creat->GetAIInterface()->setMoveType(11);

		  sEAS.CreateCustomWaypointMap(creat);

		  sEAS.WaypointCreate(creat,-2240.521729f, -407.114532f, -9.424648f, 5.753043f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-2225.764404f, -419.251404f, -9.360950f, 5.575544f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-2200.883789f, -440.999634f, -5.606637f, 5.599899f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-2143.712646f, -468.068665f, -9.401191f, 0.797177f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-2100.811279f, -420.980194f, -5.322747f, 0.918914f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-2079.469482f, -392.465576f, -10.262321f, 0.930689f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-2043.699707f, -343.802155f, -6.971242f, 0.934694f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-2001.858521f, -242.533966f, -10.763200f, 0.952265f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1924.751343f, -119.969292f, -11.770116f, 0.754775f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1794.804565f, -7.919222f, -9.326016f, 0.711578f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1755.206421f, 72.430847f, 1.121445f, 1.103484f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1734.550049f, 116.842003f, -4.337420f, 3.350100f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1720.041870f, 125.933235f, -2.325089f, 0.903206f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1704.406860f, 183.596405f, 12.065074f, 0.691148f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1674.317261f, 201.597565f, 11.235887f, 0.475164f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1624.068726f, 223.555389f, 2.074259f, 0.416259f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1572.863403f, 234.714813f, 2.305119f, 0.781471f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1542.866943f, 277.896759f, 20.543165f, 1.256637f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1541.813232f, 316.415649f, 49.910889f, 1.248783f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1526.979126f, 329.664001f, 61.835552f, 1.182024f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1524.173584f, 335.237610f, 63.325703f, 1.173092f, 0, 256, 0);
		  sEAS.WaypointCreate(creat,-1513.968506f, 355.759338f, 63.064487f, 1.119193f, 0, 256, 0);
		  return true;
}
	void GossipSelectOption(Object* pObject, Player* plr, uint32 Id, uint32 IntId, const char * EnteredCode)
	{
		if(!plr)
			return;

		Creature* doctor = TO_CREATURE(pObject);
		if (doctor == NULL)
			return;

		switch (IntId)
		{
			case 0:
				GossipHello(pObject, plr, true);
				break;

			case 1:
			{
				plr->GetItemInterface()->RemoveItemAmt(2799, 1);
				doctor->CastSpell(doctor, dbcSpell.LookupEntry(12380), true);
				if( !plr || !plr->GetMapMgr() || !plr->GetMapMgr()->GetInterface() )
					return;
				Creature* firstenemy = sEAS.SpawnCreature(plr, 1511, -13770.5, -6.79, 42.8, 5.7 , 0);
				firstenemy->GetAIInterface()->MoveTo(-13727.8, -26.2, 46.15, 4.07);
				firstenemy->Despawn(10*60*1000, 0);
			}break;
		}
	}
	void OnQuestComplete(Player* pPlayer, QuestLogEntry *qLogEntry)
	{
		if (!pPlayer)
			return;
		
		GameObject* obj = NULL;

		for(uint8 i = 0; i < 9; i++)
		{
			obj = sEAS.SpawnGameobject(pPlayer, GO_MEAT, MeatSpawnPoints[i].x, MeatSpawnPoints[i].y, MeatSpawnPoints[i].z, MeatSpawnPoints[i].o, 1, 0, 0, 0, 0);
			sEAS.GameobjectDelete(obj, 2*60*1000);
		}
		for(uint8 i = 0; i < 5; i++)
		{
			obj = sEAS.SpawnGameobject(pPlayer, GO_BOTTLE, BottleSpawnPoints[i].x, BottleSpawnPoints[i].y, BottleSpawnPoints[i].z, BottleSpawnPoints[i].o, 1, 0, 0, 0, 0);
			sEAS.GameobjectDelete(obj, 2*60*1000);
		}
		for(uint8 i = 0; i < 3; i++)
		{
			obj = sEAS.SpawnGameobject(pPlayer, GO_BREAD, BreadSpawnPoints[i].x, BreadSpawnPoints[i].y, BreadSpawnPoints[i].z, BreadSpawnPoints[i].o, 1, 0, 0, 0, 0);
			sEAS.GameobjectDelete(obj, 2*60*1000);
		}	
     	
		Creature* Negolash = sEAS.SpawnCreature(pPlayer, 1494, -14657.400391, 155.115997, 4.081050, 0.353429);
		Negolash->GetAIInterface()->MoveTo(-14647.526367, 143.710052, 1.164550, 1.909);
	}
Beispiel #9
0
bool SummonSuccubusQuest(uint32 i, Spell* s)
{
    CreatureInfo* ci = CreatureNameStorage.LookupEntry(5677);
    CreatureProto* cp = CreatureProtoStorage.LookupEntry(5677);
    if (!ci || !cp)
        return false;

    Creature* pCreature = s->p_caster->GetMapMgr()->CreateCreature(cp->Id);
    pCreature->Load(cp, s->p_caster->GetMapMgr(), s->p_caster->GetPositionX(), s->p_caster->GetPositionY(), s->p_caster->GetPositionZ());
    pCreature->GetAIInterface()->Init(pCreature, AITYPE_AGRO, MOVEMENTTYPE_NONE);
    pCreature->GetAIInterface()->taunt(s->p_caster, true);
    pCreature->PushToWorld(s->p_caster->GetMapMgr());
    pCreature->Despawn(60000, 0);

    return true;
}
    void OnCombatStart(Unit* mTarget)
    {
		_unit->SendChatMessage( CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "You wish to confront the master? You must weather the storm!");
		spark_timer = 0;
		last_creation_hp = 100;
		RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
		for( uint8 i=0; i<SPARKS_COUNT; i++)
		{
			CreatureProto *cp = CreatureProtoStorage.LookupEntry(28926);
			CreatureInfo *ci = CreatureNameStorage.LookupEntry(28926);
			Creature* c = NULL;
			if (cp && ci)
			{
				c = _unit->GetMapMgr()->CreateCreature( 28926 );
				if (c)
				{
					c->Load(cp,_unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), _unit->GetOrientation());
					c->PushToWorld(_unit->GetMapMgr());
					sparks[i] = c->GetGUID();
					c->Root();
					c->GetAIInterface()->disable_combat = true;
					for( uint8 i=0; i<7; i++ )
						c->SchoolImmunityList[i] = 1;
				}
			}
		}
    }
Beispiel #11
0
bool ChatHandler::HandleWPShowCommand(const char* args, WorldSession *m_session)
{
	uint64 guid = m_session->GetPlayer()->GetSelection();
	if (guid == 0)
	{
		SystemMessage(m_session, "No selection.");
		return true;
	}

	Creature* pCreature = m_session->GetPlayer()->GetMapMgr()->GetCreature(GET_LOWGUID_PART(guid));
	if(!pCreature)
	{
		SystemMessage(m_session, "You should select a Creature.");
		return true;
	}

	if( pCreature->m_spawn == NULL )
	{
		SystemMessage(m_session, "You cannot add waypoints to a creature that is not saved.");
		return true;
	}

	char* pBackwards = strtok((char*)args, " ");
	bool Backwards = (pBackwards)? ((atoi(pBackwards)>0)?true:false) : false;

	AIInterface* ai = pCreature->GetAIInterface();
	Player* pPlayer = m_session->GetPlayer();


	if(pPlayer->waypointunit != ai)
	{
		if(ai->m_WayPointsShowing == true) 
		{
			SystemMessage(m_session, "Some one else is also Viewing this Creatures WayPoints.");
			SystemMessage(m_session, "Viewing WayPoints at the same time as some one else can cause undesireble results.");
			return true;
		}

		if(pPlayer->waypointunit != NULL)
		{
			pPlayer->waypointunit->hideWayPoints(pPlayer);
		}
		pPlayer->waypointunit = ai;
		ai->showWayPoints(pPlayer,Backwards);
		ai->m_WayPointsShowBackwards = Backwards;
	}
	else
	{
		if(ai->m_WayPointsShowing == true) 
		{
			SystemMessage(m_session, "Waypoints Already Showing.");
		}
		else
			ai->showWayPoints(m_session->GetPlayer(),Backwards);
	}

	SystemMessage(m_session, "Showing waypoints for creature %u", pCreature->GetSQL_id());
	return true;
}
Beispiel #12
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* Bartleby = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 6090);

		if(Bartleby == NULL)
			return;

		Bartleby->SetFaction(168);
		Bartleby->GetAIInterface()->disable_melee = false;
		Bartleby->GetAIInterface()->SetAllowedToEnterCombat(true);
	}
	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* Dashel = mTarget->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(SSX, SSY, SSZ, 6784);

		if(Dashel == NULL)
			return;

		Dashel->SetUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, 28);
		Dashel->GetAIInterface()->disable_melee = false;
		Dashel->GetAIInterface()->SetAllowedToEnterCombat(true);
	}
Beispiel #14
0
bool SummonSuccubusQuest(uint32 i, Spell* s)
{

    CreatureInfo const* ci = sMySQLStore.GetCreatureInfo(5677);
    CreatureProto const* cp = sMySQLStore.GetCreatureProto(5677);
    if(!ci || !cp)
        return false;

    Creature* pCreature = s->p_caster->GetMapMgr()->CreateCreature(cp->Id);
    pCreature->Load(cp, s->p_caster->GetPositionX(), s->p_caster->GetPositionY(), s->p_caster->GetPositionZ());
    pCreature->GetAIInterface()->Init(pCreature, AITYPE_AGRO, Movement::WP_MOVEMENT_SCRIPT_NONE);
    pCreature->GetAIInterface()->taunt(s->p_caster, true);
    pCreature->PushToWorld(s->p_caster->GetMapMgr());
    pCreature->Despawn(60000, 0);

    return true;
}
    void GossipSelectOption(Object* pObject, Player*  pPlayer, uint32 Id, uint32 IntId, const char* Code)
    {
        TheVioletHoldScript* pInstance = (TheVioletHoldScript*)pPlayer->GetMapMgr()->GetScript();

        if (!pInstance)
            return;

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

        Creature* pCreature = TO_CREATURE(pObject);

        switch (IntId)
        {
            case 0:
                GossipHello(pObject, pPlayer);
                break;

            case 1:
            {
                  GossipMenu* menu;
                  objmgr.CreateGossipMenuForPlayer(&menu, pObject->GetGUID(), SINCLARI_ON_FINISH, pPlayer);
                  menu->AddItem(ICON_CHAT, pPlayer->GetSession()->LocalizedGossipOption(SINCLARI_GET_SAFETY), 2);
                  menu->SendTo(pPlayer);

                  // New Encounter State included
                  pInstance->SetInstanceData(Data_EncounterState, MAP_VIOLET_HOLD, State_PreProgress);
            }break;

            case 2:
            {
                      TO_CREATURE(pObject)->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
                      pCreature->GetAIInterface()->setMoveType(MOVEMENTTYPE_NONE);
                      //pCreature->MoveToWaypoint(1);
                      pCreature->GetAIInterface()->StopMovement(10);

            }break;

            case 3:
            {
                  Arcemu::Gossip::Menu::Complete(pPlayer);
                  pPlayer->SafeTeleport(pPlayer->GetInstanceID(), MAP_VIOLET_HOLD, 1830.531006f, 803.939758f, 44.340508f, 6.281611f);
            }break;
        }
    }
Beispiel #16
0
    void SpawnHighborneLamenter(Player* pThis, uint32 entry, float posX, float posY, float posZ, float posO)
    {
        CreatureProperties const* p = sMySQLStore.getCreatureProperties(entry);
        if (p == nullptr)
            return;

        Creature* creature = pThis->GetMapMgr()->CreateCreature(entry);
        creature->m_spawn = nullptr;
        creature->Load(p, posX, posY, posZ);
        creature->SetOrientation(posO);
        creature->GetAIInterface()->setCombatDisabled(true);
        creature->GetAIInterface()->setMeleeDisabled(true);
        creature->GetAIInterface()->setTargetingDisabled(true);
        creature->PushToWorld(pThis->GetMapMgr());
        creature->Despawn(180000, 0);
        creature->setUInt32Value(UNIT_FIELD_FACTIONTEMPLATE, 35);
        creature->setServersideFaction();
    }
Beispiel #17
0
bool ChatHandler::HandleDeleteCommand(const char* args, WorldSession *m_session)
{

	uint64 guid = m_session->GetPlayer()->GetSelection();
	if(guid == 0)
	{
		SystemMessage(m_session, "No selection.");
		return true;
	}

	Creature *unit = m_session->GetPlayer()->GetMapMgr()->GetCreature(GET_LOWGUID_PART(guid));
	if(!unit)
	{
		SystemMessage(m_session, "You should select a creature.");
		return true;
	}
	if(unit->IsPet())
	{
		SystemMessage(m_session, "You can't delete a pet." );
		return true;
	}
	sGMLog.writefromsession(m_session, "used npc delete, sqlid %u, creature %s, pos %f %f %f", unit->GetSQL_id(), unit->GetCreatureInfo()->Name, unit->GetPositionX(), unit->GetPositionY(), unit->GetPositionZ());

	unit->GetAIInterface()->hideWayPoints( m_session->GetPlayer() );
    
    unit->DeleteFromDB();

	if(unit->IsInWorld())
	{
		if(unit->m_spawn)
		{
			uint32 cellx = uint32(((_maxX-unit->m_spawn->x)/_cellSize));
			uint32 celly = uint32(((_maxY-unit->m_spawn->y)/_cellSize));

			if(cellx <= _sizeX && celly <= _sizeY)
			{
				CellSpawns * sp = unit->GetMapMgr()->GetBaseMap()->GetSpawnsList(cellx, celly);
				if( sp != NULL )
				{
					for( CreatureSpawnList::iterator itr = sp->CreatureSpawns.begin(); itr != sp->CreatureSpawns.end(); ++itr )
						if( (*itr) == unit->m_spawn )
						{
							sp->CreatureSpawns.erase( itr );
							break;
						}
				}
				delete unit->m_spawn;
                unit->m_spawn = NULL;
			}
		}
		unit->RemoveFromWorld(false,true);
	}

	BlueSystemMessage(m_session, "Creature deleted");

	return true;
}
    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);
    }
Beispiel #19
0
bool ChatHandler::HandleSaveWaypoints(const char* args, WorldSession* m_session)
{
	Creature* cr = m_session->GetPlayer()->GetMapMgr()->GetCreature(GET_LOWGUID_PART(m_session->GetPlayer()->GetSelection()));
	if(!cr || !cr->GetSQL_id())
		return false;

	Player* pPlayer = m_session->GetPlayer();

	if(pPlayer->waypointunit == cr->GetAIInterface())
	{
		if(cr->GetAIInterface()->m_WayPointsShowing)
			pPlayer->waypointunit->hideWayPoints(pPlayer);
		pPlayer->waypointunit = NULL;
	}

	cr->GetAIInterface()->saveWayPoints();
	return true;
}
	void OnDamageTaken(Unit* mAttacker, float fAmount)
	{
		Creature * pCreature = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( _unit->GetPositionX(), _unit->GetPositionY(), 0.0f, 14762);
		if(pCreature)
			pCreature->GetAIInterface()->AttackReaction( mAttacker, 1 );

		pCreature = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( _unit->GetPositionX(), _unit->GetPositionY(), 0.0f, 14763);
		if(pCreature)
			pCreature->GetAIInterface()->AttackReaction( mAttacker, 1 );

		pCreature = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( _unit->GetPositionX(), _unit->GetPositionY(), 0.0f, 14764);
		if(pCreature)
			pCreature->GetAIInterface()->AttackReaction( mAttacker, 1 );

		pCreature = _unit->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( _unit->GetPositionX(), _unit->GetPositionY(), 0.0f, 14765);
		if(pCreature)
			pCreature->GetAIInterface()->AttackReaction( mAttacker, 1 );
	}
Beispiel #21
0
    void OnActivate(Player* player)
    {
        Creature* Ulag = player->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(2390.101807f, 336.676788f, 40.015614f, 6390);
        GameObject* pDoor = player->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2388.480029f, 338.3901f, 40.092899f, 176594);
        QuestLogEntry* en = player->GetQuestLogForEntry(1819);
        if (en == nullptr || pDoor == nullptr || Ulag == nullptr)
            return;

        Creature* NewCreature = player->GetMapMgr()->GetInterface()->SpawnCreature(6390, 2390.101807f, 336.676788f, 40.015614f, 2.259590f, true, false, 0, 0);
        if (NewCreature != nullptr)
        {
            NewCreature->Despawn(180000, 0);
            NewCreature->GetAIInterface()->setNextTarget(player);
            NewCreature->GetAIInterface()->AttackReaction(player, 1);
            pDoor->setFlags(GO_FLAG_NONSELECTABLE | GO_FLAG_NEVER_DESPAWN);
            pDoor->setState(GO_STATE_OPEN);
        };
    }
        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 #23
0
bool ChatHandler::HandleNpcComeCommand(const char* args, WorldSession* m_session)
{
	// moves npc to players location
	Player * plr = m_session->GetPlayer();
	Creature * crt = getSelectedCreature(m_session, true);
	if(!crt) return true;

	crt->GetAIInterface()->MoveTo(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), plr->GetOrientation());
	return true;
}
		void OnActivate(Player* pPlayer)
		{
			if(pPlayer->GetQuestLogForEntry(10974))
			{
				Creature*  pCreature = NULL;
				pCreature = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(3989.094482f, 6071.562500f, 266.416656f, 22920);
				if(pCreature != NULL)
				{
					pCreature->SetFaction(14);
					pCreature->SetFloatValue(OBJECT_FIELD_SCALE_X, 1);
					pCreature->GetAIInterface()->setNextTarget(pPlayer);
					pCreature->GetAIInterface()->AttackReaction(pPlayer, 1);
				}
			}
			else
			{
				pPlayer->BroadcastMessage("Missing required quest : Stasis Chambers of Bash'ir");
			}
		}
Beispiel #25
0
bool ChatHandler::HandleNpcComeCommand(const char* args, WorldSession* m_session)
{
	// moves npc to players location
	Player * plr = m_session->GetPlayer();
	Creature * crt = getSelectedCreature(m_session, true);
	if(!crt) return true;

	crt->GetAIInterface()->MoveTo(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), plr->GetOrientation());
	sGMLog.writefromsession(m_session,"used npc come command on %s, sqlid %u",crt->GetCreatureInfo()->Name,crt->GetSQL_id());
	return true;
}
Beispiel #26
0
bool ChatHandler::HandleDeleteWaypoints(const char* args, WorldSession * m_session)
{
	Creature* cr = 
		m_session->GetPlayer()->GetMapMgr()->GetCreature(GET_LOWGUID_PART(m_session->GetPlayer()->GetSelection()));
	if(!cr)return false;
	if(!cr->GetSQL_id())
		return false;

	if(cr->GetAIInterface()->m_WayPointsShowing)
	{
		SystemMessage(m_session, "Waypoints are showing, hide them first.");
		return true;
	}
	
	WorldDatabase.Execute("DELETE FROM creature_waypoints WHERE spawnid=%u",cr->GetSQL_id());

	cr->GetAIInterface()->deleteWaypoints();
	SystemMessage(m_session, "Deleted waypoints for %u", cr->GetSQL_id());
	return true;
}
Beispiel #27
0
bool ChatHandler::HandleSaveWaypoints(const char* args, WorldSession * m_session)
{
	Creature* cr = 
		m_session->GetPlayer()->GetMapMgr()->GetCreature(GET_LOWGUID_PART(m_session->GetPlayer()->GetSelection()));
	if(!cr)return false;
	if(!cr->GetSQL_id())
		return false;
	
	cr->GetAIInterface()->saveWayPoints();
	return true;
}
Beispiel #28
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 #29
0
	void OnActivate(Player* pPlayer)
	{

		Creature* Ulag = NULL;
		GameObject* pDoor = NULL;
		Ulag = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(2390.101807f, 336.676788f, 40.015614f, 6390);
		pDoor = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2388.480029f, 338.3901f, 40.092899f, 176594);
		QuestLogEntry * en = pPlayer->GetQuestLogForEntry(1819);
		if(!en || pDoor==NULL || Ulag)
		return;

		Creature* NewCreature = pPlayer->GetMapMgr()->GetInterface()->SpawnCreature(6390, 2390.101807f, 336.676788f, 40.015614f, 2.259590f, true, false, 0, 0);
		if ( NewCreature != NULL )
		{
			NewCreature->Despawn(180000, 0);
			NewCreature->GetAIInterface()->setNextTarget(pPlayer);
			NewCreature->GetAIInterface()->AttackReaction(pPlayer, 1);
			pDoor->SetUInt32Value(GAMEOBJECT_FLAGS, 33);
			pDoor->SetByte(GAMEOBJECT_BYTES_1, 0, 0);
		};
	}
Beispiel #30
0
	void OnDied(Unit *mKiller)
	{
		if(!mKiller->IsPlayer())
		return;

		Player *plr = (Player*)mKiller;
		uint8 chance = (uint8)RandomUInt(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 = sEAS.SpawnCreature(plr, spawn, _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 1*60*1000);

		if(spawn != 22459)
			return;

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

		QuestLogEntry *qle = plr->GetQuestLogForEntry(10873);
		if(qle == NULL)
			return;

		if(qle->GetMobCount(0) == qle->GetQuest()->required_mobcount[0])
			return;

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