コード例 #1
0
ファイル: guildmaster.cpp プロジェクト: CrystalEMU/CrystalEMU
void teleportPlayerToGuildHouse(Player *player, Creature *_creature)
{
 if (player->GetGuildId() == 0)
 {
 //if player has no guild
 _creature->MonsterWhisper(MSG_NOTINGUILD, player->GetGUID());
 sprintf(str,"I am sorry %u but you must be in a guild!", player->GetName());
 return;
 }

 if (!player->getAttackers().empty())
 {
 //if player in combat
 _creature->MonsterSay(MSG_INCOMBAT, LANG_UNIVERSAL, player->GetGUID());
 return;
 }

 float x, y, z;
 uint32 map;

 if (getGuildHouseCoords(player->GetGuildId(), x, y, z, map))
 {
 //teleport player to the specified location
 player->TeleportTo(map, x, y, z, 0.0f);
 }
 else
 _creature->MonsterWhisper(MSG_NOGUILDHOUSE, player->GetGUID());
}
コード例 #2
0
void teleportPlayerToGuildHouse(Player *player, Creature *_creature)
{
 if (player->GetGuildId() == 0)
 {
 //if player has no guild
 _creature->Whisper(MSG_NOTINGUILD, LANG_UNIVERSAL, player);
 return;
 }

 if (!player->getAttackers().empty())
 {
 //if player in combat
 _creature->Say(MSG_INCOMBAT, LANG_UNIVERSAL, player);
 return;
 }

 float x, y, z;
 uint32 map;

 if (getGuildHouseCoords(player->GetGuildId(), x, y, z, map))
 {
 //teleport player to the specified location
 player->TeleportTo(map, x, y, z, 0.0f);
 }
 else
 _creature->Whisper(MSG_NOGUILDHOUSE, LANG_UNIVERSAL, player);
}
コード例 #3
0
void teleportPlayerToGuildHouse(Player *pPlayer, Creature *_Creature)
{
	if (pPlayer->GetGuildId() == 0)
	{
		//if pPlayer has no guild
		pPlayer->GetSession()->SendNotification("Du bist in keiner Gilde erstelle eine oder trete einer vorhandenen Gilde bei.");
		return;
	}

	if (!pPlayer->getAttackers().empty())
	{
		//if pPlayer in combat
		pPlayer->GetSession()->SendNotification("Du befindest dich im Kampf!");
		return;
	}

	float x, y, z;
	uint32 map;

	if (getGuildHouseCoords(pPlayer->GetGuildId(), x, y, z, map))
	{
		//teleport pPlayer to the specified location
		pPlayer->TeleportTo(map, x, y, z, 0.0f);
	}
	else
		pPlayer->GetSession()->SendNotification("Deine Gilde hat kein Gildenhaus!");

}
コード例 #4
0
ファイル: guildmaster.cpp プロジェクト: Asandru/Script-Land
bool ItemUse_item_guild_house(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets)
{
	QueryResult_AutoPtr result;

	if(pPlayer)
	result = WorldDatabase.PQuery("SELECT `comment` FROM `guildhouses` WHERE `guildId` = %u",pPlayer->GetGuildId());

	if (result)
	{
        if(pPlayer->isInFlight())
        {
            pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
        }
        if (pPlayer && !pPlayer->isInCombat() && !pPlayer->HasSpellCooldown(TELEPORT_SPELL_ID) )
		{
			float x, y, z;
			uint32 map;
			
			if (getGuildHouseCoords(pPlayer->GetGuildId(), x, y, z, map))
			{
				//teleport player to the specified location
				pPlayer->TeleportTo(map, x, y, z, 0.0f);
			}else 
				if (pPlayer)
					pPlayer->SendEquipError(EQUIP_ERR_CANT_DO_RIGHT_NOW, pItem, NULL);
		}
		else 
		if (pPlayer)
		{
			pPlayer->SendEquipError( EQUIP_ERR_NOT_IN_COMBAT, pItem, NULL);
		}
	}

    return false;
}
コード例 #5
0
void teleportPlayerToGuildHouse(Player *player, Creature *_creature)
{
    if (player->GetGuildId() == 0)
    {
        _creature->MonsterWhisper(MSG_NOTINGUILD, player->GetGUID());
        return;
    }

    if (!player->getAttackers().empty())
    {
        _creature->MonsterSay(MSG_INCOMBAT, LANG_UNIVERSAL, player->GetGUID());
        return;
    }

    float x, y, z;
    uint32 map;

    if (getGuildHouseCoords(player->GetGuildId(), x, y, z, map))
    {
        player->TeleportTo(map, x, y, z, 0.0f);
    }
    else
        _creature->MonsterWhisper(MSG_NOGUILDHOUSE, player->GetGUID());
}