mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
[11458] Non-item related uint64 guids replaced by ObjectGUids in Player.h
Also let ObjectAccessor::FindPlayer optimize empty guid case work.
This commit is contained in:
parent
1d781cd431
commit
151e5eae9c
13 changed files with 123 additions and 125 deletions
|
|
@ -223,7 +223,7 @@ void WorldSession::HandleMessagechatOpcode( WorldPacket & recv_data )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
GetPlayer()->Whisper(msg, lang, player->GetGUID());
|
GetPlayer()->Whisper(msg, lang, player->GetObjectGuid());
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case CHAT_MSG_PARTY:
|
case CHAT_MSG_PARTY:
|
||||||
|
|
|
||||||
|
|
@ -1525,7 +1525,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
|
||||||
{
|
{
|
||||||
if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
|
if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
|
||||||
{
|
{
|
||||||
bool refresh = pl->GetLootGUID() == creature->GetGUID();
|
bool refresh = pl->GetLootGuid() == creature->GetObjectGuid();
|
||||||
|
|
||||||
//if(refresh) // update loot for new looter
|
//if(refresh) // update loot for new looter
|
||||||
// pl->GetSession()->DoLootRelease(pl->GetLootGUID());
|
// pl->GetSession()->DoLootRelease(pl->GetLootGUID());
|
||||||
|
|
@ -1546,7 +1546,7 @@ void Group::UpdateLooterGuid( Creature* creature, bool ifneed )
|
||||||
{
|
{
|
||||||
if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
|
if (pl->IsWithinDist(creature, sWorld.getConfig(CONFIG_FLOAT_GROUP_XP_DISTANCE), false))
|
||||||
{
|
{
|
||||||
bool refresh = pl->GetLootGUID()==creature->GetGUID();
|
bool refresh = pl->GetLootGuid() == creature->GetObjectGuid();
|
||||||
|
|
||||||
//if(refresh) // update loot for new looter
|
//if(refresh) // update loot for new looter
|
||||||
// pl->GetSession()->DoLootRelease(pl->GetLootGUID());
|
// pl->GetSession()->DoLootRelease(pl->GetLootGUID());
|
||||||
|
|
|
||||||
|
|
@ -847,7 +847,7 @@ bool Item::CanBeTraded(bool mail) const
|
||||||
{
|
{
|
||||||
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK )
|
if (owner->CanUnequipItem(GetPos(),false) != EQUIP_ERR_OK )
|
||||||
return false;
|
return false;
|
||||||
if (owner->GetLootGUID()==GetGUID())
|
if (owner->GetLootGuid() == GetObjectGuid())
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -490,111 +490,111 @@ void WorldSession::HandleSellItemOpcode( WorldPacket & recv_data )
|
||||||
DEBUG_LOG( "WORLD: Received CMSG_SELL_ITEM" );
|
DEBUG_LOG( "WORLD: Received CMSG_SELL_ITEM" );
|
||||||
|
|
||||||
ObjectGuid vendorGuid;
|
ObjectGuid vendorGuid;
|
||||||
uint64 itemguid;
|
ObjectGuid itemGuid;
|
||||||
uint32 count;
|
uint32 count;
|
||||||
|
|
||||||
recv_data >> vendorGuid;
|
recv_data >> vendorGuid;
|
||||||
recv_data >> itemguid;
|
recv_data >> itemGuid;
|
||||||
recv_data >> count;
|
recv_data >> count;
|
||||||
|
|
||||||
if(!itemguid)
|
if (itemGuid.IsEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR);
|
Creature *pCreature = GetPlayer()->GetNPCIfCanInteractWith(vendorGuid, UNIT_NPC_FLAG_VENDOR);
|
||||||
if (!pCreature)
|
if (!pCreature)
|
||||||
{
|
{
|
||||||
DEBUG_LOG("WORLD: HandleSellItemOpcode - %s not found or you can't interact with him.", vendorGuid.GetString().c_str());
|
DEBUG_LOG("WORLD: HandleSellItemOpcode - %s not found or you can't interact with him.", vendorGuid.GetString().c_str());
|
||||||
_player->SendSellError( SELL_ERR_CANT_FIND_VENDOR, NULL, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove fake death
|
// remove fake death
|
||||||
if(GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
if (GetPlayer()->hasUnitState(UNIT_STAT_DIED))
|
||||||
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||||
|
|
||||||
Item *pItem = _player->GetItemByGuid( itemguid );
|
Item *pItem = _player->GetItemByGuid(itemGuid);
|
||||||
if (pItem)
|
if (pItem)
|
||||||
{
|
{
|
||||||
// prevent sell not owner item
|
// prevent sell not owner item
|
||||||
if (_player->GetObjectGuid() != pItem->GetOwnerGuid())
|
if (_player->GetObjectGuid() != pItem->GetOwnerGuid())
|
||||||
{
|
{
|
||||||
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent sell non empty bag by drag-and-drop at vendor's item list
|
// prevent sell non empty bag by drag-and-drop at vendor's item list
|
||||||
if(pItem->IsBag() && !((Bag*)pItem)->IsEmpty())
|
if (pItem->IsBag() && !((Bag*)pItem)->IsEmpty())
|
||||||
{
|
{
|
||||||
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// prevent sell currently looted item
|
// prevent sell currently looted item
|
||||||
if(_player->GetLootGUID() == pItem->GetGUID())
|
if (_player->GetLootGuid() == pItem->GetObjectGuid())
|
||||||
{
|
{
|
||||||
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// special case at auto sell (sell all)
|
// special case at auto sell (sell all)
|
||||||
if(count == 0)
|
if (count == 0)
|
||||||
{
|
{
|
||||||
count = pItem->GetCount();
|
count = pItem->GetCount();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// prevent sell more items that exist in stack (possible only not from client)
|
// prevent sell more items that exist in stack (possible only not from client)
|
||||||
if(count > pItem->GetCount())
|
if (count > pItem->GetCount())
|
||||||
{
|
{
|
||||||
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ItemPrototype const *pProto = pItem->GetProto();
|
ItemPrototype const *pProto = pItem->GetProto();
|
||||||
if( pProto )
|
if (pProto)
|
||||||
{
|
{
|
||||||
if( pProto->SellPrice > 0 )
|
if (pProto->SellPrice > 0)
|
||||||
{
|
{
|
||||||
if(count < pItem->GetCount()) // need split items
|
if (count < pItem->GetCount()) // need split items
|
||||||
{
|
{
|
||||||
Item *pNewItem = pItem->CloneItem( count, _player );
|
Item *pNewItem = pItem->CloneItem( count, _player );
|
||||||
if (!pNewItem)
|
if (!pNewItem)
|
||||||
{
|
{
|
||||||
sLog.outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count );
|
sLog.outError("WORLD: HandleSellItemOpcode - could not create clone of item %u; count = %u", pItem->GetEntry(), count );
|
||||||
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
pItem->SetCount( pItem->GetCount() - count );
|
pItem->SetCount(pItem->GetCount() - count);
|
||||||
_player->ItemRemovedQuestCheck( pItem->GetEntry(), count );
|
_player->ItemRemovedQuestCheck(pItem->GetEntry(), count);
|
||||||
if( _player->IsInWorld() )
|
if (_player->IsInWorld())
|
||||||
pItem->SendCreateUpdateToPlayer( _player );
|
pItem->SendCreateUpdateToPlayer(_player);
|
||||||
pItem->SetState(ITEM_CHANGED, _player);
|
pItem->SetState(ITEM_CHANGED, _player);
|
||||||
|
|
||||||
_player->AddItemToBuyBackSlot( pNewItem );
|
_player->AddItemToBuyBackSlot(pNewItem);
|
||||||
if( _player->IsInWorld() )
|
if (_player->IsInWorld())
|
||||||
pNewItem->SendCreateUpdateToPlayer( _player );
|
pNewItem->SendCreateUpdateToPlayer(_player);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_player->ItemRemovedQuestCheck( pItem->GetEntry(), pItem->GetCount());
|
_player->ItemRemovedQuestCheck(pItem->GetEntry(), pItem->GetCount());
|
||||||
_player->RemoveItem( pItem->GetBagSlot(), pItem->GetSlot(), true);
|
_player->RemoveItem(pItem->GetBagSlot(), pItem->GetSlot(), true);
|
||||||
pItem->RemoveFromUpdateQueueOf(_player);
|
pItem->RemoveFromUpdateQueueOf(_player);
|
||||||
_player->AddItemToBuyBackSlot( pItem );
|
_player->AddItemToBuyBackSlot(pItem);
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 money = pProto->SellPrice * count;
|
uint32 money = pProto->SellPrice * count;
|
||||||
|
|
||||||
_player->ModifyMoney( money );
|
_player->ModifyMoney(money);
|
||||||
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money);
|
_player->GetAchievementMgr().UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_MONEY_FROM_VENDORS, money);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_player->SendSellError( SELL_ERR_CANT_SELL_ITEM, pCreature, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_SELL_ITEM, pCreature, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_player->SendSellError( SELL_ERR_CANT_FIND_ITEM, pCreature, itemguid, 0);
|
_player->SendSellError(SELL_ERR_CANT_FIND_ITEM, pCreature, itemGuid, 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -610,7 +610,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||||
if (!pCreature)
|
if (!pCreature)
|
||||||
{
|
{
|
||||||
DEBUG_LOG("WORLD: HandleBuybackItem - %s not found or you can't interact with him.", vendorGuid.GetString().c_str());
|
DEBUG_LOG("WORLD: HandleBuybackItem - %s not found or you can't interact with him.", vendorGuid.GetString().c_str());
|
||||||
_player->SendSellError( SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
|
_player->SendSellError( SELL_ERR_CANT_FIND_VENDOR, NULL, ObjectGuid(), 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -619,10 +619,10 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||||
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
GetPlayer()->RemoveSpellsCausingAura(SPELL_AURA_FEIGN_DEATH);
|
||||||
|
|
||||||
Item *pItem = _player->GetItemFromBuyBackSlot( slot );
|
Item *pItem = _player->GetItemFromBuyBackSlot( slot );
|
||||||
if( pItem )
|
if (pItem)
|
||||||
{
|
{
|
||||||
uint32 price = _player->GetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START );
|
uint32 price = _player->GetUInt32Value( PLAYER_FIELD_BUYBACK_PRICE_1 + slot - BUYBACK_SLOT_START );
|
||||||
if( _player->GetMoney() < price )
|
if (_player->GetMoney() < price)
|
||||||
{
|
{
|
||||||
_player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, pItem->GetEntry(), 0);
|
_player->SendBuyError( BUY_ERR_NOT_ENOUGHT_MONEY, pCreature, pItem->GetEntry(), 0);
|
||||||
return;
|
return;
|
||||||
|
|
@ -630,7 +630,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||||
|
|
||||||
ItemPosCountVec dest;
|
ItemPosCountVec dest;
|
||||||
InventoryResult msg = _player->CanStoreItem( NULL_BAG, NULL_SLOT, dest, pItem, false );
|
InventoryResult msg = _player->CanStoreItem( NULL_BAG, NULL_SLOT, dest, pItem, false );
|
||||||
if( msg == EQUIP_ERR_OK )
|
if (msg == EQUIP_ERR_OK)
|
||||||
{
|
{
|
||||||
_player->ModifyMoney( -(int32)price );
|
_player->ModifyMoney( -(int32)price );
|
||||||
_player->RemoveItemFromBuyBackSlot( slot, false );
|
_player->RemoveItemFromBuyBackSlot( slot, false );
|
||||||
|
|
@ -643,7 +643,7 @@ void WorldSession::HandleBuybackItem(WorldPacket & recv_data)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_player->SendBuyError( BUY_ERR_CANT_FIND_ITEM, pCreature, 0, 0);
|
_player->SendBuyError(BUY_ERR_CANT_FIND_ITEM, pCreature, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
void WorldSession::HandleBuyItemInSlotOpcode( WorldPacket & recv_data )
|
||||||
|
|
@ -730,7 +730,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorguid)
|
||||||
if (!pCreature)
|
if (!pCreature)
|
||||||
{
|
{
|
||||||
DEBUG_LOG("WORLD: SendListInventory - %s not found or you can't interact with him.", vendorguid.GetString().c_str());
|
DEBUG_LOG("WORLD: SendListInventory - %s not found or you can't interact with him.", vendorguid.GetString().c_str());
|
||||||
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, 0, 0);
|
_player->SendSellError(SELL_ERR_CANT_FIND_VENDOR, NULL, ObjectGuid(), 0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ void WorldSession::HandleAutostoreLootItemOpcode( WorldPacket & recv_data )
|
||||||
{
|
{
|
||||||
DEBUG_LOG("WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
|
DEBUG_LOG("WORLD: CMSG_AUTOSTORE_LOOT_ITEM");
|
||||||
Player *player = GetPlayer();
|
Player *player = GetPlayer();
|
||||||
ObjectGuid lguid = player->GetLootGUID();
|
ObjectGuid lguid = player->GetLootGuid();
|
||||||
Loot *loot;
|
Loot *loot;
|
||||||
uint8 lootSlot;
|
uint8 lootSlot;
|
||||||
Item* pItem = NULL;
|
Item* pItem = NULL;
|
||||||
|
|
@ -179,7 +179,7 @@ void WorldSession::HandleLootMoneyOpcode( WorldPacket & /*recv_data*/ )
|
||||||
DEBUG_LOG("WORLD: CMSG_LOOT_MONEY");
|
DEBUG_LOG("WORLD: CMSG_LOOT_MONEY");
|
||||||
|
|
||||||
Player *player = GetPlayer();
|
Player *player = GetPlayer();
|
||||||
ObjectGuid guid = player->GetLootGUID();
|
ObjectGuid guid = player->GetLootGuid();
|
||||||
if (guid.IsEmpty())
|
if (guid.IsEmpty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -297,8 +297,9 @@ void WorldSession::HandleLootReleaseOpcode( WorldPacket & recv_data )
|
||||||
// use internal stored guid
|
// use internal stored guid
|
||||||
recv_data.read_skip<uint64>(); // guid;
|
recv_data.read_skip<uint64>(); // guid;
|
||||||
|
|
||||||
if(uint64 lguid = GetPlayer()->GetLootGUID())
|
ObjectGuid lootGuid = GetPlayer()->GetLootGuid();
|
||||||
DoLootRelease(lguid);
|
if (!lootGuid.IsEmpty())
|
||||||
|
DoLootRelease(lootGuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WorldSession::DoLootRelease(ObjectGuid lguid)
|
void WorldSession::DoLootRelease(ObjectGuid lguid)
|
||||||
|
|
@ -306,7 +307,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
|
||||||
Player *player = GetPlayer();
|
Player *player = GetPlayer();
|
||||||
Loot *loot;
|
Loot *loot;
|
||||||
|
|
||||||
player->SetLootGUID(ObjectGuid());
|
player->SetLootGuid(ObjectGuid());
|
||||||
player->SendLootRelease(lguid);
|
player->SendLootRelease(lguid);
|
||||||
|
|
||||||
player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOOTING);
|
player->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_LOOTING);
|
||||||
|
|
@ -508,7 +509,7 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
if (!_player->GetGroup() || _player->GetGroup()->GetLooterGuid() != _player->GetObjectGuid())
|
if (!_player->GetGroup() || _player->GetGroup()->GetLooterGuid() != _player->GetObjectGuid())
|
||||||
{
|
{
|
||||||
_player->SendLootRelease(GetPlayer()->GetLootGUID());
|
_player->SendLootRelease(GetPlayer()->GetLootGuid());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -518,7 +519,7 @@ void WorldSession::HandleLootMasterGiveOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
DEBUG_LOG("WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = %s [%s].", target_playerguid.GetString().c_str(), target->GetName());
|
DEBUG_LOG("WorldSession::HandleLootMasterGiveOpcode (CMSG_LOOT_MASTER_GIVE, 0x02A3) Target = %s [%s].", target_playerguid.GetString().c_str(), target->GetName());
|
||||||
|
|
||||||
if (_player->GetLootGUID() != lootguid.GetRawValue())
|
if (_player->GetLootGuid() != lootguid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Loot *pLoot = NULL;
|
Loot *pLoot = NULL;
|
||||||
|
|
|
||||||
|
|
@ -264,8 +264,9 @@ void WorldSession::HandleLogoutRequestOpcode( WorldPacket & /*recv_data*/ )
|
||||||
{
|
{
|
||||||
DEBUG_LOG( "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity() );
|
DEBUG_LOG( "WORLD: Recvd CMSG_LOGOUT_REQUEST Message, security - %u", GetSecurity() );
|
||||||
|
|
||||||
if (uint64 lguid = GetPlayer()->GetLootGUID())
|
ObjectGuid lootGuid = GetPlayer()->GetLootGuid();
|
||||||
DoLootRelease(lguid);
|
if (!lootGuid.IsEmpty())
|
||||||
|
DoLootRelease(lootGuid);
|
||||||
|
|
||||||
//Can not logout if...
|
//Can not logout if...
|
||||||
if( GetPlayer()->isInCombat() || //...is in combat
|
if( GetPlayer()->isInCombat() || //...is in combat
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,9 @@ Corpse* ObjectAccessor::GetCorpseInMap(ObjectGuid guid, uint32 mapid)
|
||||||
Player*
|
Player*
|
||||||
ObjectAccessor::FindPlayer(ObjectGuid guid)
|
ObjectAccessor::FindPlayer(ObjectGuid guid)
|
||||||
{
|
{
|
||||||
|
if (guid.IsEmpty())
|
||||||
|
return NULL;
|
||||||
|
|
||||||
Player * plr = HashMapHolder<Player>::Find(guid);;
|
Player * plr = HashMapHolder<Player>::Find(guid);;
|
||||||
if(!plr || !plr->IsInWorld())
|
if(!plr || !plr->IsInWorld())
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
|
|
@ -418,8 +418,6 @@ Player::Player (WorldSession *session): Unit(), m_mover(this), m_camera(this), m
|
||||||
|
|
||||||
m_session = session;
|
m_session = session;
|
||||||
|
|
||||||
m_divider = 0;
|
|
||||||
|
|
||||||
m_ExtraFlags = 0;
|
m_ExtraFlags = 0;
|
||||||
if(GetSession()->GetSecurity() >= SEC_GAMEMASTER)
|
if(GetSession()->GetSecurity() >= SEC_GAMEMASTER)
|
||||||
SetAcceptTicket(true);
|
SetAcceptTicket(true);
|
||||||
|
|
@ -6514,39 +6512,39 @@ void Player::UpdateHonorFields()
|
||||||
bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
|
bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
|
||||||
{
|
{
|
||||||
// do not reward honor in arenas, but enable onkill spellproc
|
// do not reward honor in arenas, but enable onkill spellproc
|
||||||
if(InArena())
|
if (InArena())
|
||||||
{
|
{
|
||||||
if(!uVictim || uVictim == this || uVictim->GetTypeId() != TYPEID_PLAYER)
|
if (!uVictim || uVictim == this || uVictim->GetTypeId() != TYPEID_PLAYER)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( GetBGTeam() == ((Player*)uVictim)->GetBGTeam() )
|
if (GetBGTeam() == ((Player*)uVictim)->GetBGTeam())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
|
// 'Inactive' this aura prevents the player from gaining honor points and battleground tokens
|
||||||
if(GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
|
if (GetDummyAura(SPELL_AURA_PLAYER_INACTIVE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint64 victim_guid = 0;
|
ObjectGuid victim_guid;
|
||||||
uint32 victim_rank = 0;
|
uint32 victim_rank = 0;
|
||||||
|
|
||||||
// need call before fields update to have chance move yesterday data to appropriate fields before today data change.
|
// need call before fields update to have chance move yesterday data to appropriate fields before today data change.
|
||||||
UpdateHonorFields();
|
UpdateHonorFields();
|
||||||
|
|
||||||
if(honor <= 0)
|
if (honor <= 0)
|
||||||
{
|
{
|
||||||
if(!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
|
if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
victim_guid = uVictim->GetGUID();
|
victim_guid = uVictim->GetObjectGuid();
|
||||||
|
|
||||||
if( uVictim->GetTypeId() == TYPEID_PLAYER )
|
if (uVictim->GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
Player *pVictim = (Player *)uVictim;
|
Player *pVictim = (Player *)uVictim;
|
||||||
|
|
||||||
if( GetTeam() == pVictim->GetTeam() && !sWorld.IsFFAPvPRealm() )
|
if (GetTeam() == pVictim->GetTeam() && !sWorld.IsFFAPvPRealm())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
float f = 1; //need for total kills (?? need more info)
|
float f = 1; //need for total kills (?? need more info)
|
||||||
|
|
@ -6568,18 +6566,18 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
|
||||||
// title[15..28] -> rank[5..18]
|
// title[15..28] -> rank[5..18]
|
||||||
// title[other] -> 0
|
// title[other] -> 0
|
||||||
if (victim_title == 0)
|
if (victim_title == 0)
|
||||||
victim_guid = 0; // Don't show HK: <rank> message, only log.
|
victim_guid.Clear(); // Don't show HK: <rank> message, only log.
|
||||||
else if (victim_title < 15)
|
else if (victim_title < 15)
|
||||||
victim_rank = victim_title + 4;
|
victim_rank = victim_title + 4;
|
||||||
else if (victim_title < 29)
|
else if (victim_title < 29)
|
||||||
victim_rank = victim_title - 14 + 4;
|
victim_rank = victim_title - 14 + 4;
|
||||||
else
|
else
|
||||||
victim_guid = 0; // Don't show HK: <rank> message, only log.
|
victim_guid.Clear(); // Don't show HK: <rank> message, only log.
|
||||||
}
|
}
|
||||||
|
|
||||||
k_grey = MaNGOS::XP::GetGrayLevel(k_level);
|
k_grey = MaNGOS::XP::GetGrayLevel(k_level);
|
||||||
|
|
||||||
if(v_level<=k_grey)
|
if (v_level<=k_grey)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
float diff_level = (k_level == k_grey) ? 1 : ((float(v_level) - float(k_grey)) / (float(k_level) - float(k_grey)));
|
float diff_level = (k_level == k_grey) ? 1 : ((float(v_level) - float(k_grey)) / (float(k_level) - float(k_grey)));
|
||||||
|
|
@ -6587,7 +6585,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
|
||||||
int32 v_rank =1; //need more info
|
int32 v_rank =1; //need more info
|
||||||
|
|
||||||
honor = ((f * diff_level * (190 + v_rank*10))/6);
|
honor = ((f * diff_level * (190 + v_rank*10))/6);
|
||||||
honor *= ((float)k_level) / 70.0f; //factor of dependence on levels of the killer
|
honor *= float(k_level) / 70.0f; //factor of dependence on levels of the killer
|
||||||
|
|
||||||
// count the number of playerkills in one day
|
// count the number of playerkills in one day
|
||||||
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
|
ApplyModUInt32Value(PLAYER_FIELD_KILLS, 1, true);
|
||||||
|
|
@ -6614,7 +6612,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
|
||||||
honor *= sWorld.getConfig(CONFIG_FLOAT_RATE_HONOR);
|
honor *= sWorld.getConfig(CONFIG_FLOAT_RATE_HONOR);
|
||||||
honor *= (GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN) + 100.0f)/100.0f;
|
honor *= (GetMaxPositiveAuraModifier(SPELL_AURA_MOD_HONOR_GAIN) + 100.0f)/100.0f;
|
||||||
|
|
||||||
if(groupsize > 1)
|
if (groupsize > 1)
|
||||||
honor /= groupsize;
|
honor /= groupsize;
|
||||||
|
|
||||||
honor *= (((float)urand(8,12))/10); // approx honor: 80% - 120% of real honor
|
honor *= (((float)urand(8,12))/10); // approx honor: 80% - 120% of real honor
|
||||||
|
|
@ -6625,11 +6623,10 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, float honor)
|
||||||
// victim_rank [1..4] HK: <dishonored rank>
|
// victim_rank [1..4] HK: <dishonored rank>
|
||||||
// victim_rank [5..19] HK: <alliance\horde rank>
|
// victim_rank [5..19] HK: <alliance\horde rank>
|
||||||
// victim_rank [0,20+] HK: <>
|
// victim_rank [0,20+] HK: <>
|
||||||
WorldPacket data(SMSG_PVP_CREDIT,4+8+4);
|
WorldPacket data(SMSG_PVP_CREDIT, 4 + 8 + 4);
|
||||||
data << (uint32) honor;
|
data << uint32(honor);
|
||||||
data << (uint64) victim_guid;
|
data << ObjectGuid(victim_guid);
|
||||||
data << (uint32) victim_rank;
|
data << uint32(victim_rank);
|
||||||
|
|
||||||
GetSession()->SendPacket(&data);
|
GetSession()->SendPacket(&data);
|
||||||
|
|
||||||
// add honor points
|
// add honor points
|
||||||
|
|
@ -7962,8 +7959,9 @@ void Player::SendLootRelease(ObjectGuid guid)
|
||||||
|
|
||||||
void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||||
{
|
{
|
||||||
if (uint64 lguid = GetLootGUID())
|
ObjectGuid lootGuid = GetLootGuid();
|
||||||
m_session->DoLootRelease(lguid);
|
if (!lootGuid.IsEmpty())
|
||||||
|
m_session->DoLootRelease(lootGuid);
|
||||||
|
|
||||||
Loot *loot = 0;
|
Loot *loot = 0;
|
||||||
PermissionTypes permission = ALL_PERMISSION;
|
PermissionTypes permission = ALL_PERMISSION;
|
||||||
|
|
@ -8226,7 +8224,7 @@ void Player::SendLoot(ObjectGuid guid, LootType loot_type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SetLootGUID(guid);
|
SetLootGuid(guid);
|
||||||
|
|
||||||
// LOOT_INSIGNIA and LOOT_FISHINGHOLE unsupported by client
|
// LOOT_INSIGNIA and LOOT_FISHINGHOLE unsupported by client
|
||||||
switch(loot_type)
|
switch(loot_type)
|
||||||
|
|
@ -12298,12 +12296,12 @@ void Player::SendBuyError( BuyResult msg, Creature* pCreature, uint32 item, uint
|
||||||
GetSession()->SendPacket(&data);
|
GetSession()->SendPacket(&data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SendSellError( SellResult msg, Creature* pCreature, uint64 guid, uint32 param )
|
void Player::SendSellError( SellResult msg, Creature* pCreature, ObjectGuid itemGuid, uint32 param )
|
||||||
{
|
{
|
||||||
DEBUG_LOG( "WORLD: Sent SMSG_SELL_ITEM" );
|
DEBUG_LOG( "WORLD: Sent SMSG_SELL_ITEM" );
|
||||||
WorldPacket data( SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10
|
WorldPacket data( SMSG_SELL_ITEM,(8+8+(param?4:0)+1)); // last check 2.0.10
|
||||||
data << (pCreature ? pCreature->GetObjectGuid() : ObjectGuid());
|
data << (pCreature ? pCreature->GetObjectGuid() : ObjectGuid());
|
||||||
data << uint64(guid);
|
data << ObjectGuid(itemGuid);
|
||||||
if (param > 0)
|
if (param > 0)
|
||||||
data << uint32(param);
|
data << uint32(param);
|
||||||
data << uint8(msg);
|
data << uint8(msg);
|
||||||
|
|
@ -18226,14 +18224,14 @@ void Player::RemovePet(PetSaveMode mode)
|
||||||
|
|
||||||
void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const
|
void Player::BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const
|
||||||
{
|
{
|
||||||
*data << (uint8)msgtype;
|
*data << uint8(msgtype);
|
||||||
*data << (uint32)language;
|
*data << uint32(language);
|
||||||
*data << (uint64)GetGUID();
|
*data << ObjectGuid(GetObjectGuid());
|
||||||
*data << (uint32)language; //language 2.1.0 ?
|
*data << uint32(language); //language 2.1.0 ?
|
||||||
*data << (uint64)GetGUID();
|
*data << ObjectGuid(GetObjectGuid());
|
||||||
*data << (uint32)(text.length()+1);
|
*data << uint32(text.length()+1);
|
||||||
*data << text;
|
*data << text;
|
||||||
*data << (uint8)chatTag();
|
*data << uint8(chatTag());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Say(const std::string& text, const uint32 language)
|
void Player::Say(const std::string& text, const uint32 language)
|
||||||
|
|
@ -18257,7 +18255,7 @@ void Player::TextEmote(const std::string& text)
|
||||||
SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) );
|
SendMessageToSetInRange(&data,sWorld.getConfig(CONFIG_FLOAT_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_BOOL_ALLOW_TWO_SIDE_INTERACTION_CHAT) );
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::Whisper(const std::string& text, uint32 language,uint64 receiver)
|
void Player::Whisper(const std::string& text, uint32 language, ObjectGuid receiver)
|
||||||
{
|
{
|
||||||
if (language != LANG_ADDON) // if not addon data
|
if (language != LANG_ADDON) // if not addon data
|
||||||
language = LANG_UNIVERSAL; // whispers should always be readable
|
language = LANG_UNIVERSAL; // whispers should always be readable
|
||||||
|
|
@ -20852,22 +20850,22 @@ void Player::RewardSinglePlayerAtKill(Unit* pVictim)
|
||||||
|
|
||||||
void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource)
|
void Player::RewardPlayerAndGroupAtEvent(uint32 creature_id, WorldObject* pRewardSource)
|
||||||
{
|
{
|
||||||
uint64 creature_guid = pRewardSource->GetTypeId()==TYPEID_UNIT ? pRewardSource->GetGUID() : uint64(0);
|
ObjectGuid creature_guid = pRewardSource->GetTypeId()==TYPEID_UNIT ? pRewardSource->GetObjectGuid() : ObjectGuid();
|
||||||
|
|
||||||
// prepare data for near group iteration
|
// prepare data for near group iteration
|
||||||
if(Group *pGroup = GetGroup())
|
if (Group *pGroup = GetGroup())
|
||||||
{
|
{
|
||||||
for(GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
for (GroupReference *itr = pGroup->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||||
{
|
{
|
||||||
Player* pGroupGuy = itr->getSource();
|
Player* pGroupGuy = itr->getSource();
|
||||||
if(!pGroupGuy)
|
if (!pGroupGuy)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if(!pGroupGuy->IsAtGroupRewardDistance(pRewardSource))
|
if (!pGroupGuy->IsAtGroupRewardDistance(pRewardSource))
|
||||||
continue; // member (alive or dead) or his corpse at req. distance
|
continue; // member (alive or dead) or his corpse at req. distance
|
||||||
|
|
||||||
// quest objectives updated only for alive group member or dead but with not released body
|
// quest objectives updated only for alive group member or dead but with not released body
|
||||||
if(pGroupGuy->isAlive()|| !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
if (pGroupGuy->isAlive()|| !pGroupGuy->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
|
||||||
pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
|
pGroupGuy->KilledMonsterCredit(creature_id, creature_guid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1161,7 +1161,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void Say(const std::string& text, const uint32 language);
|
void Say(const std::string& text, const uint32 language);
|
||||||
void Yell(const std::string& text, const uint32 language);
|
void Yell(const std::string& text, const uint32 language);
|
||||||
void TextEmote(const std::string& text);
|
void TextEmote(const std::string& text);
|
||||||
void Whisper(const std::string& text, const uint32 language,uint64 receiver);
|
void Whisper(const std::string& text, const uint32 language, ObjectGuid receiver);
|
||||||
void BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const;
|
void BuildPlayerChat(WorldPacket *data, uint8 msgtype, const std::string& text, uint32 language) const;
|
||||||
|
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
@ -1276,7 +1276,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; }
|
uint32 GetMaxKeyringSize() const { return KEYRING_SLOT_END-KEYRING_SLOT_START; }
|
||||||
void SendEquipError( InventoryResult msg, Item* pItem, Item *pItem2 = NULL, uint32 itemid = 0 ) const;
|
void SendEquipError( InventoryResult msg, Item* pItem, Item *pItem2 = NULL, uint32 itemid = 0 ) const;
|
||||||
void SendBuyError( BuyResult msg, Creature* pCreature, uint32 item, uint32 param );
|
void SendBuyError( BuyResult msg, Creature* pCreature, uint32 item, uint32 param );
|
||||||
void SendSellError( SellResult msg, Creature* pCreature, uint64 guid, uint32 param );
|
void SendSellError( SellResult msg, Creature* pCreature, ObjectGuid itemGuid, uint32 param );
|
||||||
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }
|
void AddWeaponProficiency(uint32 newflag) { m_WeaponProficiency |= newflag; }
|
||||||
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
|
void AddArmorProficiency(uint32 newflag) { m_ArmorProficiency |= newflag; }
|
||||||
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
|
uint32 GetWeaponProficiency() const { return m_WeaponProficiency; }
|
||||||
|
|
@ -1441,8 +1441,9 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void SendPushToPartyResponse( Player *pPlayer, uint32 msg );
|
void SendPushToPartyResponse( Player *pPlayer, uint32 msg );
|
||||||
void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, ObjectGuid guid, uint32 creatureOrGO_idx, uint32 count);
|
void SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, ObjectGuid guid, uint32 creatureOrGO_idx, uint32 count);
|
||||||
|
|
||||||
uint64 GetDivider() { return m_divider; }
|
ObjectGuid GetDividerGuid() const { return m_dividerGuid; }
|
||||||
void SetDivider( uint64 guid ) { m_divider = guid; }
|
void SetDividerGuid(ObjectGuid guid) { m_dividerGuid = guid; }
|
||||||
|
void ClearDividerGuid() { m_dividerGuid.Clear(); }
|
||||||
|
|
||||||
uint32 GetInGameTime() { return m_ingametime; }
|
uint32 GetInGameTime() { return m_ingametime; }
|
||||||
|
|
||||||
|
|
@ -1824,8 +1825,8 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
void ApplyManaRegenBonus(int32 amount, bool apply);
|
void ApplyManaRegenBonus(int32 amount, bool apply);
|
||||||
void UpdateManaRegen();
|
void UpdateManaRegen();
|
||||||
|
|
||||||
const uint64& GetLootGUID() const { return m_lootGuid.GetRawValue(); }
|
ObjectGuid const& GetLootGuid() const { return m_lootGuid; }
|
||||||
void SetLootGUID(ObjectGuid const& guid) { m_lootGuid = guid; }
|
void SetLootGuid(ObjectGuid const& guid) { m_lootGuid = guid; }
|
||||||
|
|
||||||
void RemovedInsignia(Player* looterPlr);
|
void RemovedInsignia(Player* looterPlr);
|
||||||
|
|
||||||
|
|
@ -2360,7 +2361,7 @@ class MANGOS_DLL_SPEC Player : public Unit
|
||||||
QuestSet m_weeklyquests;
|
QuestSet m_weeklyquests;
|
||||||
QuestSet m_monthlyquests;
|
QuestSet m_monthlyquests;
|
||||||
|
|
||||||
uint64 m_divider;
|
ObjectGuid m_dividerGuid;
|
||||||
uint32 m_ingametime;
|
uint32 m_ingametime;
|
||||||
|
|
||||||
/*********************************************************/
|
/*********************************************************/
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
_player->PlayerTalkClass->CloseGossip();
|
_player->PlayerTalkClass->CloseGossip();
|
||||||
_player->SetDivider( 0 );
|
_player->ClearDividerGuid();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -142,18 +142,14 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
||||||
if(!GetPlayer()->CanTakeQuest(qInfo,true) )
|
if(!GetPlayer()->CanTakeQuest(qInfo,true) )
|
||||||
{
|
{
|
||||||
_player->PlayerTalkClass->CloseGossip();
|
_player->PlayerTalkClass->CloseGossip();
|
||||||
_player->SetDivider( 0 );
|
_player->ClearDividerGuid();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( _player->GetDivider() != 0 )
|
if (Player *pPlayer = ObjectAccessor::FindPlayer(_player->GetDividerGuid()))
|
||||||
{
|
{
|
||||||
Player *pPlayer = ObjectAccessor::FindPlayer( _player->GetDivider() );
|
pPlayer->SendPushToPartyResponse(_player, QUEST_PARTY_MSG_ACCEPT_QUEST);
|
||||||
if( pPlayer )
|
_player->ClearDividerGuid();
|
||||||
{
|
|
||||||
pPlayer->SendPushToPartyResponse( _player, QUEST_PARTY_MSG_ACCEPT_QUEST );
|
|
||||||
_player->SetDivider( 0 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( _player->CanAddQuest( qInfo, true ) )
|
if( _player->CanAddQuest( qInfo, true ) )
|
||||||
|
|
@ -173,7 +169,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
||||||
|
|
||||||
if (pPlayer->CanTakeQuest(qInfo, true))
|
if (pPlayer->CanTakeQuest(qInfo, true))
|
||||||
{
|
{
|
||||||
pPlayer->SetDivider(_player->GetGUID());
|
pPlayer->SetDividerGuid(_player->GetObjectGuid());
|
||||||
|
|
||||||
//need confirmation that any gossip window will close
|
//need confirmation that any gossip window will close
|
||||||
pPlayer->PlayerTalkClass->CloseGossip();
|
pPlayer->PlayerTalkClass->CloseGossip();
|
||||||
|
|
@ -374,7 +370,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
|
||||||
if (!pQuest->HasQuestFlag(QUEST_FLAGS_PARTY_ACCEPT))
|
if (!pQuest->HasQuestFlag(QUEST_FLAGS_PARTY_ACCEPT))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Player* pOriginalPlayer = ObjectAccessor::FindPlayer(_player->GetDivider());
|
Player* pOriginalPlayer = ObjectAccessor::FindPlayer(_player->GetDividerGuid());
|
||||||
|
|
||||||
if (!pOriginalPlayer)
|
if (!pOriginalPlayer)
|
||||||
return;
|
return;
|
||||||
|
|
@ -393,7 +389,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recv_data)
|
||||||
if (_player->CanAddQuest(pQuest, true))
|
if (_player->CanAddQuest(pQuest, true))
|
||||||
_player->AddQuest(pQuest, NULL); // NULL, this prevent DB script from duplicate running
|
_player->AddQuest(pQuest, NULL); // NULL, this prevent DB script from duplicate running
|
||||||
|
|
||||||
_player->SetDivider(0);
|
_player->ClearDividerGuid();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -476,14 +472,14 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pPlayer->GetDivider() != 0)
|
if (!pPlayer->GetDividerGuid().IsEmpty())
|
||||||
{
|
{
|
||||||
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_BUSY);
|
_player->SendPushToPartyResponse(pPlayer, QUEST_PARTY_MSG_BUSY);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetObjectGuid(), true);
|
pPlayer->PlayerTalkClass->SendQuestGiverQuestDetails(pQuest, _player->GetObjectGuid(), true);
|
||||||
pPlayer->SetDivider(_player->GetGUID());
|
pPlayer->SetDividerGuid(_player->GetObjectGuid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -497,16 +493,13 @@ void WorldSession::HandleQuestPushResult(WorldPacket& recvPacket)
|
||||||
|
|
||||||
DEBUG_LOG("WORLD: Received MSG_QUEST_PUSH_RESULT");
|
DEBUG_LOG("WORLD: Received MSG_QUEST_PUSH_RESULT");
|
||||||
|
|
||||||
if (_player->GetDivider() != 0)
|
if (Player *pPlayer = ObjectAccessor::FindPlayer(_player->GetDividerGuid()))
|
||||||
{
|
{
|
||||||
if (Player *pPlayer = ObjectAccessor::FindPlayer(_player->GetDivider()))
|
WorldPacket data( MSG_QUEST_PUSH_RESULT, (8+1) );
|
||||||
{
|
data << ObjectGuid(guid);
|
||||||
WorldPacket data( MSG_QUEST_PUSH_RESULT, (8+1) );
|
data << uint8(msg); // valid values: 0-8
|
||||||
data << ObjectGuid(guid);
|
pPlayer->GetSession()->SendPacket(&data);
|
||||||
data << uint8(msg); // valid values: 0-8
|
_player->ClearDividerGuid();
|
||||||
pPlayer->GetSession()->SendPacket(&data);
|
|
||||||
_player->SetDivider( 0 );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -336,8 +336,9 @@ void WorldSession::LogoutPlayer(bool Save)
|
||||||
{
|
{
|
||||||
sLog.outChar("Account: %d (IP: %s) Logout Character:[%s] (guid: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName() ,_player->GetGUIDLow());
|
sLog.outChar("Account: %d (IP: %s) Logout Character:[%s] (guid: %u)", GetAccountId(), GetRemoteAddress().c_str(), _player->GetName() ,_player->GetGUIDLow());
|
||||||
|
|
||||||
if (uint64 lguid = GetPlayer()->GetLootGUID())
|
ObjectGuid lootGuid = GetPlayer()->GetLootGuid();
|
||||||
DoLootRelease(lguid);
|
if (!lootGuid.IsEmpty())
|
||||||
|
DoLootRelease(lootGuid);
|
||||||
|
|
||||||
///- If the player just died before logging out, make him appear as a ghost
|
///- If the player just died before logging out, make him appear as a ghost
|
||||||
//FIXME: logout must be delayed in case lost connection with client in time of combat
|
//FIXME: logout must be delayed in case lost connection with client in time of combat
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ bool ChatHandler::HandleDebugSendSellErrorCommand(char* args)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint8 msg = atoi(args);
|
uint8 msg = atoi(args);
|
||||||
m_session->GetPlayer()->SendSellError(SellResult(msg), 0, 0, 0);
|
m_session->GetPlayer()->SendSellError(SellResult(msg), 0, ObjectGuid(), 0);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11457"
|
#define REVISION_NR "11458"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue