Example #1
0
bool BlessingofIncineratus(uint32 i, Spell* pSpell)
{
	Player *pPlayer = (Player*)pSpell->u_caster;
	if(!pPlayer)
		return true;

	if(!pSpell->u_caster->IsPlayer())
		return true;

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(9805);
	if(qle == NULL)
		return true;

	GameObject *big = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-1972, 6276, 56, 300077);
	GameObject *east = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-1841, 6387, 52, 400050);
	GameObject *west = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-1920, 6361, 56, 400051);
	GameObject *south = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-1808, 6293, 59, 400052);

	if(big != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, big) < 30)
		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}
	}
	if(east != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, east) < 30)
		if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
		{
			qle->SetMobCount(1, qle->GetMobCount(1)+1);
			qle->SendUpdateAddKill(1);
			qle->UpdatePlayerFields();
		}
	}
	if(south != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, south) < 30)
		if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2])
		{
			qle->SetMobCount(2, qle->GetMobCount(2)+1);
			qle->SendUpdateAddKill(2);
			qle->UpdatePlayerFields();
		}
	}
	if(west != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, west) < 30)
		if(qle->GetMobCount(3) < qle->GetQuest()->required_mobcount[3])
		{
			qle->SetMobCount(3, qle->GetMobCount(3)+1);
			qle->SendUpdateAddKill(3);
			qle->UpdatePlayerFields();
		}
	}
	return true;
}
// Leading the Ancestors Home
bool CompleteAncestorRitual(uint32 i, Spell * pSpell)
{
    if(pSpell == NULL || pSpell->p_caster == NULL || !pSpell->p_caster->IsInWorld())
        return true;

    Player* pPlayer = pSpell->p_caster;
    QuestLogEntry* pQuest = GetQuest( pPlayer, 11610 );
    if( !pQuest )
        return true;

    GameObject* pElderObj;
    pElderObj = pPlayer->GetMapMgr()->GetMapScript()->FindClosestGameObject( 191088, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ());
    if(pElderObj != NULL && pPlayer->GetDistance2dSq(pElderObj) < 8.0f)
    {
        KillMobForQuest( pPlayer, 11610, 0);
        return true;
    }

    pElderObj = pPlayer->GetMapMgr()->GetMapScript()->FindClosestGameObject( 191089, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ());
    if(pElderObj != NULL && pPlayer->GetDistance2dSq(pElderObj) < 8.0f)
    {
        KillMobForQuest( pPlayer, 11610, 1);
        return true;
    }

    pElderObj = pPlayer->GetMapMgr()->GetMapScript()->FindClosestGameObject( 191090, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ());
    if(pElderObj != NULL && pPlayer->GetDistance2dSq(pElderObj) < 8.0f)
    {
        KillMobForQuest( pPlayer, 11610, 2);
        return true;
    }

    return true;
}
bool PlantingSeaforiumDepthCharge(uint32 i, Spell * pSpell)
{
    if(pSpell == NULL || pSpell->p_caster == NULL || !pSpell->p_caster->IsInWorld())
        return true;

    
    Player* pPlayer = pSpell->p_caster;
    QuestLogEntry* pQuest = GetQuest( pPlayer, 11608);
    if( !pQuest )
        return true;

    GameObject* pSinkhole = pPlayer->GetMapMgr()->GetMapScript()->FindClosestGameObject( 300171, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ());
    if( pSinkhole == NULL )
        return true;

    pPlayer->GetMapMgr()->GetMapScript()->SpawnCreature( 25401, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetOrientation());
    
    float posX = pSinkhole->GetPositionX();
    if(posX == 2657.13f)
        KillMobForQuest( pPlayer, 11608, 0);

    if(posX == 2716.02f)
        KillMobForQuest( pPlayer, 11608, 1);

    if(posX == 2877.96f)
        KillMobForQuest( pPlayer, 11608, 2);

    if(posX == 2962.16f)
        KillMobForQuest( pPlayer, 11608, 3);

    return true;
}
Example #4
0
bool MeasuringWarpEnergies(uint32 i, Spell* pSpell)
{
	Player *pPlayer = (Player*)pSpell->u_caster;
	if(!pPlayer)
		return true;

	if(!pSpell->u_caster->IsPlayer())
		return true;

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10313);
	if(qle == NULL)
		return true;

	GameObject *north = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(3216, 4045, 145, 300094);
	GameObject *east = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2766, 3865, 145, 300094);
	GameObject *west = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2958, 4318, 145, 300094);
	GameObject *south = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(2817, 4337, 145, 300094);

	if(north != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, north) < 30)
		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}
	}
	if(east != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, east) < 30)
		if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
		{
			qle->SetMobCount(1, qle->GetMobCount(1)+1);
			qle->SendUpdateAddKill(1);
			qle->UpdatePlayerFields();
		}
	}
	if(south != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, south) < 30)
		if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2])
		{
			qle->SetMobCount(2, qle->GetMobCount(2)+1);
			qle->SendUpdateAddKill(2);
			qle->UpdatePlayerFields();
		}
	}
	if(west != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, west) < 30)
		if(qle->GetMobCount(3) < qle->GetQuest()->required_mobcount[3])
		{
			qle->SetMobCount(3, qle->GetMobCount(3)+1);
			qle->SendUpdateAddKill(3);
			qle->UpdatePlayerFields();
		}
	}
	return true;
}
Example #5
0
// Leading the Ancestors Home
bool CompleteAncestorRitual(uint32 i, Spell * pSpell)
{
	if(pSpell == NULL || pSpell->p_caster == NULL || !pSpell->p_caster->IsInWorld())
		return true;

	Player* pPlayer = pSpell->p_caster;
	QuestLogEntry* pQuest = sEAS.GetQuest( pPlayer, 11610 );
	if( !pQuest )
		return true;

	GameObject* pElderObj;
	pElderObj = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 191088);
	if(pElderObj != NULL && pPlayer->GetDistance2dSq(pElderObj) < 8.0f)
	{
		sEAS.KillMobForQuest( pPlayer, 11610, 0);
		return true;
	}

	pElderObj = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 191089);
	if(pElderObj != NULL && pPlayer->GetDistance2dSq(pElderObj) < 8.0f)
	{
		sEAS.KillMobForQuest( pPlayer, 11610, 1);
		return true;
	}

	pElderObj = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 191090);
	if(pElderObj != NULL && pPlayer->GetDistance2dSq(pElderObj) < 8.0f)
	{
		sEAS.KillMobForQuest( pPlayer, 11610, 2);
		return true;
	}

	return true;
}
bool DouseEternalFlame(uint32 i, Spell* pSpell)
{
	if (pSpell->p_caster == NULL)
		return true;

	Player* plr = pSpell->p_caster;
	QuestLogEntry *qle = plr->GetQuestLogForEntry(9737);
	if(qle == NULL)
		return true;

	GameObject* Flame = plr->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(3678, -3640, 139, 182068);
	if(Flame != NULL)
	{
		if(plr->CalcDistance(plr, Flame) < 30)
			if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
			{
				qle->SetMobCount(0, qle->GetMobCount(0)+1);
				qle->SendUpdateAddKill(0);
				qle->UpdatePlayerFields();
				Creature * pCreature = plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 10917 );
				if ( pCreature != NULL )
				{
					pCreature->SetFaction(11 );
				}
			}
	}
	return true;
}
Example #7
0
bool LayingWastetotheUnwanted(uint32 i, Spell* pSpell)
{
    Player *pPlayer = (Player*)pSpell->u_caster;
	if(!pPlayer)
		return true;

    if(!pSpell->u_caster->IsPlayer())
        return true;

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10078);
	if(qle == NULL)
		return true;
	
	GameObject *east = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-156, 2517, 43, 183123);
	GameObject *meast = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-154, 2661, 44, 183123);
	GameObject *mwest = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-172, 2773, 35, 183123);
	GameObject *west = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-172, 2818, 27, 183123);

	if(east != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, east) < 30)
		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}
	}
	if(meast != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, meast) < 30)
		if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
		{
			qle->SetMobCount(1, qle->GetMobCount(1)+1);
			qle->SendUpdateAddKill(1);
			qle->UpdatePlayerFields();
		}
	}
	if(mwest != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, mwest) < 30)
		if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2])
		{
			qle->SetMobCount(2, qle->GetMobCount(2)+1);
			qle->SendUpdateAddKill(2);
			qle->UpdatePlayerFields();
		}
	}
	if(west != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, west) < 30)
		if(qle->GetMobCount(3) < qle->GetQuest()->required_mobcount[3])
		{
			qle->SetMobCount(3, qle->GetMobCount(3)+1);
			qle->SendUpdateAddKill(3);
			qle->UpdatePlayerFields();
		}
	}
	return true;
}
Example #8
0
bool Carcass(uint32 i, Spell* pSpell) // Becoming a Shadoweave Tailor
{
	if(!pSpell->u_caster->IsPlayer())
		return true;

	Player*	pPlayer = TO_PLAYER(pSpell->u_caster);
	QuestLogEntry	*pQuest = pPlayer->GetQuestLogForEntry( 10804 );
	Creature*	NetherDrake = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 21648);
	GameObject* FlayerCarcass = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 185155);

	if ( FlayerCarcass == NULL )
	{
		FlayerCarcass = sEAS.SpawnGameobject(pPlayer, 185155, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 0, 1, 0, 0, 0, 0);
		FlayerCarcass->Despawn(60000);
	}
	if ( NetherDrake == NULL )
		return true;

	if ( NetherDrake->HasActiveAura(38502) )
		return true;

	if( pQuest!=NULL && pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
	{
		NetherDrake->CastSpell(NetherDrake, dbcSpell.LookupEntry( 38502 ), true);
		NetherDrake->GetAIInterface()->m_moveFly = true;
		NetherDrake->GetAIInterface()->MoveTo(pPlayer->GetPositionX(), pPlayer->GetPositionY()+2, pPlayer->GetPositionZ(), 0);
		pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 )+1);
		pQuest->SendUpdateAddKill( 0 );
		pQuest->UpdatePlayerFields();
	}
	return true;
}
Example #9
0
bool ChatHandler::HandleSummonCommand(const char* args, WorldSession *m_session)
{
    if (!*args)
        return false;

    sGMLog.writefromsession(m_session, "summoned %s on map %u, %f %f %f", args, m_session->GetPlayer()->GetMapId(), m_session->GetPlayer()->GetPositionX(), m_session->GetPlayer()->GetPositionY(), m_session->GetPlayer()->GetPositionZ());

    Player *chr = objmgr.GetPlayer(args, false);
    if (chr)
    {
        // send message to user
        char buf[256];
        char buf0[256];
        if (chr->IsBeingTeleported() == true)
        {
            snprintf((char*)buf, 256, "%s is already being teleported.", chr->GetName());
            SystemMessage(m_session, buf);
            return true;
        }
        snprintf((char*)buf, 256, "You are summoning %s.", chr->GetName());
        SystemMessage(m_session, buf);

        if (!m_session->GetPlayer()->m_isGmInvisible)
        {
            // send message to player
            snprintf((char*)buf0, 256, "You are being summoned by %s.", m_session->GetPlayer()->GetName());
            SystemMessageToPlr(chr, buf0);
        }

        Player * plr = m_session->GetPlayer();

        if (plr->GetMapMgr() == chr->GetMapMgr())
            chr->_Relocate(plr->GetMapId(), plr->GetPosition(), false, false, plr->GetInstanceID());
        else
        {
            sEventMgr.AddEvent(chr, &Player::EventPortToGM, plr, 0, 1, 1, 0);
        }
    }
    else
    {
        PlayerInfo * pinfo = objmgr.GetPlayerInfoByName(args);
        if (!pinfo)
        {
            char buf[256];
            snprintf((char*)buf, 256, "Player (%s) does not exist.", args);
            SystemMessage(m_session, buf);
        }
        else
        {
            Player * pPlayer = m_session->GetPlayer();
            char query[512];
            snprintf((char*)&query, 512, "UPDATE characters SET mapId = %u, positionX = %f, positionY = %f, positionZ = %f, zoneId = %u WHERE guid = %u;", pPlayer->GetMapId(), pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), pPlayer->GetZoneId(), pinfo->guid);
            CharacterDatabase.Execute(query);
            char buf[256];
            snprintf((char*)buf, 256, "(Offline) %s has been summoned.", pinfo->name);
            SystemMessage(m_session, buf);
        }
    }
    return true;
}
Example #10
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;
}
Example #11
0
bool BurnItUp(uint32 i, Spell* pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;

	Player *pPlayer = static_cast< Player* >( pSpell->u_caster );

	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10087 );
	if ( pQuest == NULL )
		return true;

	if ( pQuest->GetMobCount( 0 ) < pQuest->GetQuest()->required_mobcount[0] )
	{
		GameObject *pEastern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -300.0f, 2407.0f, 50.0f, 183122 );
		if( pEastern == NULL )
			pEastern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -300.0f, 2407.0f, 50.0f, 185122 );

		if ( pEastern != NULL && pPlayer->CalcDistance( pPlayer, pEastern ) < 30 )
		{
			pQuest->SetMobCount( 0, pQuest->GetMobCount( 0 ) + 1 );
			pQuest->SendUpdateAddKill( 0 );
			pQuest->UpdatePlayerFields();
			
			GameObject *pGameobject = sEAS.SpawnGameobject( pPlayer, 183816, -300.0f, 2407.0f, 50.0f, 0, 4 );
			if ( pGameobject != NULL )
			{
     			sEAS.GameobjectDelete( pGameobject, 1 * 60 * 1000 );
			}

			return true;
		}
	}

	if ( pQuest->GetMobCount( 1 ) < pQuest->GetQuest()->required_mobcount[1] )
	{
		GameObject *pWestern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -350.0f, 2708.0f, 35.0f, 183122 );
		if( pWestern == NULL )
			pWestern = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords( -300.0f, 2407.0f, 50.0f, 185122 );

		if ( pWestern != NULL && pPlayer->CalcDistance( pPlayer, pWestern ) < 30 )
		{
			pQuest->SetMobCount( 1, pQuest->GetMobCount( 1 ) + 1 );
			pQuest->SendUpdateAddKill( 1 );
			pQuest->UpdatePlayerFields();
			
			GameObject *pGameobject = sEAS.SpawnGameobject(pPlayer, 183816, -350.0f, 2708.0f, 35.0f, 0, 4);
			if ( pGameobject != NULL )
			{
     			sEAS.GameobjectDelete( pGameobject, 1 * 60 * 1000 );
			}

			return true;
		}
	}

	return true;
}
Example #12
0
bool ChatHandler::HandleAppearCommand(const char* args, WorldSession *m_session)
{
	if(!*args)
		return false;

	Player *slf = m_session->GetPlayer();
	if(!slf) return true;
	Player *chr = objmgr.GetPlayer(args, false);
	if (chr && ( chr->m_isGmInvisible != INVIS_ADMIN || slf->RS_getAccess() == RS_ADMIN ) )
	{
		char buf[256];
		if( chr->IsBeingTeleported() ) 
		{
			snprintf((char*)buf,256, "%s is already being teleported.", chr->GetName());
			SystemMessage(m_session, buf);
			return true;
		}
		MapInfo * pMI = chr->GetMapMgr()->GetMapInfo();
		if(pMI && pMI->required_access > slf->RS_getAccess())
		{
			snprintf((char*)buf,256, "You do not have the required access level to go to this location.");
			SystemMessage(m_session, buf);
			return true;
		}
		if(chr->m_isGmInvisible && !slf->m_isGmInvisible)
		{
			SystemMessage(m_session, "Target unit is using GM Invis,");
			SystemMessage(m_session, "You need to turn on GM Invis to port to this player");
			return true;
		}

		snprintf((char*)buf,256, "Appearing at %s's location.", chr->GetName());	// -- europa
		SystemMessage(m_session, buf);
		if( slf->m_isGmInvisible == INVIS_NONE )
		{
			char buf0[256];
			snprintf((char*)buf0,256, "%s is appearing to your location.", slf->GetName());
			SystemMessageToPlr(chr, buf0);
		}

		//m_session->GetPlayer()->SafeTeleport(chr->GetMapId(), chr->GetInstanceID(), chr->GetPosition());
		//If the GM is on the same map as the player, use the normal safeteleport method
		if ( slf->GetMapId() == chr->GetMapId() && m_session->GetPlayer()->GetInstanceID() == chr->GetInstanceID() )
			slf->SafeTeleport(chr->GetMapId(),chr->GetInstanceID(),chr->GetPosition());
		else
			slf->SafeTeleport(chr->GetMapMgr(), chr->GetPosition());
		//The player and GM are not on the same map. We use this method so we can port to BG's (Above method doesn't support them)
	}
	else
	{
		char buf[256];
		snprintf((char*)buf,256, "Player (%s) does not exist or is not logged in.", args);
		SystemMessage(m_session, buf);
	}

	return true;
}
Example #13
0
bool BalanceMustBePreserved(uint32 i, Spell* pSpell)
{
	Player *pPlayer = (Player*)pSpell->u_caster;
	if(!pPlayer)
		return true;

	if(!pSpell->u_caster->IsPlayer())
		return true;

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(9720);
	if(qle == NULL)
		return true;

    GameObject *lake1 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-756, 5926, 19, 300076);
	GameObject *lake2 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-213, 6302, 21, 300076);
	GameObject *lake3 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(498, 8197, 21, 300076);
	GameObject *lake4 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(566, 6358, 23, 300076);

	if(lake1 != NULL)
	{
		if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
		{
			qle->SetMobCount(0, qle->GetMobCount(0)+1);
			qle->SendUpdateAddKill(0);
			qle->UpdatePlayerFields();
		}
	}
	if(lake2 != NULL)
	{
		if(qle->GetMobCount(3) < qle->GetQuest()->required_mobcount[3])
		{
			qle->SetMobCount(3, qle->GetMobCount(3)+1);
			qle->SendUpdateAddKill(3);
			qle->UpdatePlayerFields();
		}
	}
	if(lake3 != NULL)
	{
		if(qle->GetMobCount(1) < qle->GetQuest()->required_mobcount[1])
		{
			qle->SetMobCount(1, qle->GetMobCount(1)+1);
			qle->SendUpdateAddKill(1);
			qle->UpdatePlayerFields();
		}
	}
	if(lake4 != NULL)
	{
		if(qle->GetMobCount(2) < qle->GetQuest()->required_mobcount[2])
		{
			qle->SetMobCount(2, qle->GetMobCount(2)+1);
			qle->SendUpdateAddKill(2);
			qle->UpdatePlayerFields();
		}
	}
	return true;
}
Example #14
0
bool ToLegionHold(uint32 i, Aura* pAura, bool apply)
{
	if ( pAura == NULL || pAura->GetUnitCaster() == NULL || !pAura->GetUnitCaster()->IsPlayer() )
		return true;

	Player* pPlayer = TO_PLAYER( pAura->GetUnitCaster() );

	Creature* pJovaanCheck = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(-3310.743896f, 2951.929199f, 171.132538f, 21633);
	if ( pJovaanCheck != NULL )
		return true;

	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 10563 );
	if ( pQuest == NULL )
	{
		pQuest = pPlayer->GetQuestLogForEntry( 10596 );
		if ( pQuest == NULL )
			return true;
	}

	if ( apply )
	{

		pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, 20366 );
		pPlayer->Root();
		Creature* pJovaan = sEAS.SpawnCreature( pPlayer, 21633, -3310.743896f, 2951.929199f, 171.132538f, 5.054039f, 0 );	// Spawn Jovaan
		if ( pJovaan != NULL )
		{
			pJovaan->SetUInt64Value( UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 );
			if ( pJovaan->GetAIInterface() != NULL )
			{
				pJovaan->GetAIInterface()->SetAllowedToEnterCombat( false );
			}
		}
		GameObject* pGameObject = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 184834);
		if ( pGameObject != NULL )
		{
			pGameObject->Despawn(60000);
			pPlayer->UpdateNearbyGameObjects();
		}
	}
	else
	{
		if ( pQuest->GetMobCount( 2 ) < pQuest->GetQuest()->required_mobcount[2] )
		{
			pQuest->SetMobCount( 2, pQuest->GetMobCount( 2 ) + 1 );
			pQuest->SendUpdateAddKill( 2 );
			pQuest->UpdatePlayerFields();
		}
	
		pPlayer->SetUInt32Value( UNIT_FIELD_DISPLAYID, pPlayer->GetUInt32Value( UNIT_FIELD_NATIVEDISPLAYID ) );
		pPlayer->UnRoot();
	}

	return true;
}
Example #15
0
  void OnDied(Unit* mKiller)
  {
	if(!mKiller->IsPlayer())
	  return;

	Player* plr = TO_PLAYER(mKiller);

			if(plr == NULL || plr->GetMapMgr() == NULL || plr->GetMapMgr()->GetInterface() == NULL)
				return;
	sEAS.SpawnCreature(plr, 12144, _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 0, 1*60*1000);
  }
Example #16
0
  void OnDied(Unit *mKiller)
  {
	if(!mKiller->IsPlayer())
	  return;

	Player *plr = static_cast<Player*>(mKiller);

			if(plr == NULL || plr->GetMapMgr() == NULL || plr->GetMapMgr()->GetInterface() == NULL)
				return;
	EAS::SpawnCreature(plr, 12144, _unit->GetPositionX(), _unit->GetPositionY(), _unit->GetPositionZ(), 0, 1*60*1000);
  }
Example #17
0
bool FindingTheSource(uint32 i, Spell* pSpell)
{
	Player* pPlayer = TO_PLAYER (pSpell->u_caster);
	if(!pPlayer)
		return true;

	if(!pSpell->u_caster->IsPlayer())
		return true;

	QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(974);
	if(qle == NULL)
		return true;

	GameObject* place1 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7163, -1149, -264, 148503);
	GameObject* place2 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7281, -1244, -248, 148503);
	GameObject* place3 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7140, -1465, -242, 148503);
	GameObject* place4 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7328, -1461, -242, 148503);
	GameObject* place5 = pPlayer->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(-7092, -1305, -187, 148503);

	if(place1 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place1) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);		
	}
	if(place2 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place2) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);
	}
	if(place3 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place3) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);
	}
	if(place4 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place4) < 11)
			pPlayer->CastSpell(pPlayer, 14797, true);
	}
	if(place5 != NULL)
	{
		if(pPlayer->CalcDistance(pPlayer, place5) < 11)
		{
			if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
			{
				qle->SetMobCount(0, qle->GetMobCount(0)+1);
				qle->SendUpdateAddKill(0);
				qle->UpdatePlayerFields();
			}
		}
	}
	return true;
}
Example #18
0
bool FuryoftheDreghoodElders(uint32 i, Spell * pSpell)
{
  Player *pPlayer = (Player*)pSpell->u_caster;
  if(!pPlayer)
	  return true;

  if(!pSpell->u_caster->IsPlayer())
    return true;



  QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(10369);
  if(qle == NULL)
    return true;

  Creature *arzethpower = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), 19354);

  if(arzethpower == NULL)
	  return true;

  Creature *arzethless = sEAS.SpawnCreature(pPlayer, 20680, arzethpower->GetPositionX(), arzethpower->GetPositionY(), arzethpower->GetPositionZ(), arzethpower->GetOrientation(), 0);
  arzethpower->Despawn(1, 6*60*1000);
  arzethless->Despawn(5*60*1000, 0);
  return true;

}
Example #19
0
bool SpragglesCanteen(uint32 i, Spell* pSpell) // Quest: Lost!
{
  if(!pSpell->u_caster->IsPlayer())
    return true;

  Player *pPlayer = (Player*)pSpell->u_caster;
  
  Creature *target = pPlayer->GetMapMgr()->GetCreature( GET_LOWGUID_PART( pPlayer->GetSelection() ) );
  if(target == NULL)
    return true;

  if(target->GetEntry() != 9999)
    return true;

  QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(4492);
  if(qle == NULL)
    return true;

  target->SetStandState(0);
  target->setDeathState(ALIVE);

  target->Despawn(30*1000, 1*60*1000);

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

  return true;
}
Example #20
0
bool DouseEternalFlame(uint32 i, Spell* pSpell)
{
	Player *plr = (Player*)pSpell->u_caster;
	if(!plr)
		return true;

	if(!pSpell->u_caster->IsPlayer())
		return true;

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

	GameObject *Flame = plr->GetMapMgr()->GetInterface()->GetGameObjectNearestCoords(3678, -3640, 139, 182068);
	if(Flame != NULL)
	{
		if(plr->CalcDistance(plr, Flame) < 30)
			if(qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
			{
				qle->SetMobCount(0, qle->GetMobCount(0)+1);
				qle->SendUpdateAddKill(0);
				qle->UpdatePlayerFields();
			}
	}
	return true;
}
Example #21
0
// War is Hell
bool WarIsHell(uint32 i, Spell * pSpell)
{
	if( !pSpell->u_caster->IsPlayer() )
		return true;

	Player * plr = TO_PLAYER(pSpell->u_caster);
	if( plr == NULL )
		return true;

	Creature * target = TO_CREATURE(plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords( plr->GetPositionX(), plr->GetPositionY() , plr->GetPositionZ(), 24008 ));
	if( target == NULL )
		return true;

	QuestLogEntry *qle = plr->GetQuestLogForEntry(11270);
  
	if( qle == NULL )
		return true;
 
	GameObject * obj = NULLGOB;
 
	if( qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0] )
	{
		qle->SetMobCount( 0, qle->GetMobCount( 0 ) + 1 );
		qle->SendUpdateAddKill( 0 );
		
		obj = sEAS.SpawnGameobject(plr, 183816, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 1, 0, 0, 0, 0);
		sEAS.GameobjectDelete(obj, 1*30*1000);
	}
	target->Despawn( 2000, 60*1000 );
	plr->UpdateNearbyGameObjects();
	qle->UpdatePlayerFields();
	return true;
}
Example #22
0
bool ChatHandler::HandleVehicleEjectPassengerCommand( const char *args, WorldSession *session ){
	uint32 seat = 0;

	std::stringstream ss( args );
	ss >> seat;
	if( ss.fail() ){
		RedSystemMessage( session, "You need to specify a seat number." );
		return false;
	}

	Player *p = session->GetPlayer();

	if( p->GetTargetGUID() == 0 ){
		RedSystemMessage( session, "You need to select a vehicle." );
		return false;
	}

	Unit *u = p->GetMapMgr()->GetUnit( p->GetTargetGUID() );
	if( u == NULL ){
		RedSystemMessage( session, "You need to select a vehicle." );
		return false;
	}

	if( u->GetVehicleComponent() == NULL ){
		RedSystemMessage( session, "You need to select a vehicle." );
		return false;
	}

	u->GetVehicleComponent()->EjectPassengerFromSeat( seat );

	return true;
}
Example #23
0
//.admin dispellall
bool ChatHandler::HandleAdminDispelAllCommand(const char* args, WorldSession* m_session)
{
    uint32 pos = 0;
    if (*args)
        pos = atoi(args);

    sGMLog.writefromsession(m_session, "used dispelall command, pos %u", pos);

    PlayerStorageMap::const_iterator itr;
    objmgr._playerslock.AcquireReadLock();
    for (itr = objmgr._players.begin(); itr != objmgr._players.end(); ++itr)
    {
        Player* player = itr->second;
        if (player->GetSession() && player->IsInWorld())
        {
            if (player->GetMapMgr() != m_session->GetPlayer()->GetMapMgr())
            {
                sEventMgr.AddEvent(static_cast< Unit* >(player), &Unit::DispelAll, pos ? true : false, EVENT_PLAYER_CHECKFORCHEATS, 100, 1, EVENT_FLAG_DO_NOT_EXECUTE_IN_WORLD_CONTEXT);
            }
            else
            {
                player->DispelAll(pos ? true : false);
            }
        }
    }
    sGMLog.writefromsession(m_session, "used mass dispel");
    objmgr._playerslock.ReleaseReadLock();

    BlueSystemMessage(m_session, "Dispel action done.");
    return true;
}
Example #24
0
bool FilledShimmeringVessel(uint32 i, Spell* pSpell) // Blood Elf ress. quest
{
    if(!pSpell->u_caster->IsPlayer())
        return true;

    Player* plr = TO_PLAYER(pSpell->u_caster);

    Creature* target = plr->GetMapMgr()->GetCreature(GET_LOWGUID_PART(plr->GetSelection()));
    if(target == NULL)
        return true;

    if(target->GetEntry() != 17768)
        return true;

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

    target->SetStandState(0);
    target->setDeathState(ALIVE);

    target->Despawn(30*1000, 1*60*1000);

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

    return true;
}
Example #25
0
bool ScrollOfMyzrael(uint32 i, Spell* pSpell) 
{
  Player *pPlayer = (Player*)pSpell->u_caster;
  if(!pPlayer)
	  return true;

  if(!pSpell->u_caster->IsPlayer())
    return true;

  QuestLogEntry *qle = pPlayer->GetQuestLogForEntry(656);
  if(qle == NULL)
    return true;

  const float MyzraelPos[] = {-940.7374, -3111.1953, 48.9566, 3.327};

  Creature *myzrael = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(MyzraelPos[0], MyzraelPos[1], MyzraelPos[2], 2755);
  if(myzrael != NULL)
  {
    if(!myzrael->isAlive())
	{
      myzrael->SafeDelete();
	  myzrael = NULL;
	}
    else
      return true;
  }

  myzrael = sEAS.SpawnCreature(pPlayer, 2755, MyzraelPos[0], MyzraelPos[1], MyzraelPos[2], MyzraelPos[3], 0);
  return true;
}
Example #26
0
bool TheFleshLies(uint32 i, Spell * pSpell)
{
	if(!pSpell->u_caster->IsPlayer())
	return true;

	Player *plr = (Player*)pSpell->u_caster;
	Creature *target = (Creature*)plr->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(plr->GetPositionX(), plr->GetPositionY() , plr->GetPositionZ(), 20561);

	if(target == NULL)
		return true;

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

	GameObject *obj = NULL;

	if(qle && qle->GetMobCount(0) < qle->GetQuest()->required_mobcount[0])
	{
		qle->SetMobCount(0, qle->GetMobCount(0)+1);
		qle->SendUpdateAddKill(0);
		
		obj = EAS::SpawnGameobject(plr, 183816, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation(), 1);
		EAS::GameobjectDelete(obj, 1*30*1000);
	}
	target->Despawn(2000, 60*1000);
	plr->UpdateNearbyGameObjects();
	qle->UpdatePlayerFields();
	return true;
}
bool NeutralizingTheCauldrons(uint32 i, Spell* pSpell)
{
    if (pSpell == NULL || pSpell->p_caster == NULL || !pSpell->p_caster->IsInWorld())
        return true;

    Player* pPlayer = pSpell->p_caster;
    QuestLogEntry* pQuest = GetQuest( pPlayer, 11647);
    if ( pQuest == NULL )
        return true;

    GameObject* pCauldron = pPlayer->GetMapMgr()->GetMapScript()->FindClosestGameObject( 187690, pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ() );
    if(pCauldron == NULL)
        return true;

    float posX = pCauldron->GetPositionX();

    if(posX == 3747.07f)
        KillMobForQuest( pPlayer, pQuest, 0 );

    if(posX == 4023.5f)
        KillMobForQuest( pPlayer, pQuest, 1 );

    if(posX == 4126.12f)
        KillMobForQuest( pPlayer, pQuest, 2 );

    return true;
}
Example #28
0
bool TheSeersRelic(uint32 i, Spell* pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;

	Player *pPlayer = static_cast< Player* >( pSpell->u_caster );
	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 9545 );
	if ( pQuest == NULL || pQuest->GetMobCount( 0 ) >= pQuest->GetQuest()->required_mobcount[0] )
		return true;

	Creature *pTarget = pPlayer->GetMapMgr()->GetCreature( GET_LOWGUID_PART( pPlayer->GetSelection() ) );
	if ( pTarget == NULL )
		return true;

	if ( pTarget->GetEntry() != 16852 )
		return true;

	pTarget->SetStandState( 0 );
	pTarget->setDeathState( ALIVE );
	pTarget->Despawn( 30 * 1000, 1 * 60 * 1000 );
  
	pQuest->SetMobCount( 0, 1 );
	pQuest->SendUpdateAddKill( 0 );
	pQuest->UpdatePlayerFields();

	return true;
}
Example #29
0
bool AnAmbitiousPlan(uint32 i, Spell* pSpell)
{
	if ( pSpell == NULL || pSpell->u_caster == NULL || !pSpell->u_caster->IsPlayer() )
		return true;

	Player *pPlayer = static_cast< Player* >( pSpell->u_caster );
	QuestLogEntry *pQuest = pPlayer->GetQuestLogForEntry( 9383 );
	if ( pQuest == NULL )
		return true;

	Creature *pTarget = pPlayer->GetMapMgr()->GetCreature( GET_LOWGUID_PART( pPlayer->GetSelection() ) );
	if ( pTarget == NULL || pTarget->GetEntry() != 16975 )
		return true;

	float SSx = pTarget->GetPositionX();
	float SSy = pTarget->GetPositionY();
	float SSz = pTarget->GetPositionZ();
	pTarget->GetAIInterface()->SetAllowedToEnterCombat( false );
	pTarget->GetAIInterface()->StopMovement( 0 );
	pTarget->GetAIInterface()->setCurrentAgent( AGENT_NULL );
	pTarget->GetAIInterface()->SetAIState( STATE_IDLE );
	pTarget->Despawn( 0, 0 );

	GameObject *pGameobject = sEAS.SpawnGameobject( pPlayer, 183816, SSx, SSy, SSz, 0, 1 );
	if ( pGameobject != NULL )
	{
		sEAS.GameobjectDelete( pGameobject, 1 * 60 * 1000 );
		pPlayer->UpdateNearbyGameObjects();
	}

	return true;
}
Example #30
0
bool FilledShimmeringVessel(uint32 i, Spell* pSpell) // Blood Elf ress. quest
{
	if(!pSpell->u_caster->IsPlayer())
		return true;

	Player *plr = (Player*)pSpell->u_caster;

	Creature *target = plr->GetMapMgr()->GetCreature((uint32)plr->GetSelection());
	if(target == NULL)
		return true;

	if(target->GetEntry() != 17768)
		return true;

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

	target->SetUInt32Value(UNIT_FIELD_BYTES_1,0);
	target->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 0);

	target->Despawn(10*1000, 1*60*1000);

	target->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Thank you, dear Paladin, you just saved my life.");

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

	return true;
}