mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-24 14:16:31 +00:00
importing changes from callmephil repo
a special thanks to him
This commit is contained in:
@@ -4204,7 +4204,7 @@ void Player::removeSpell(uint32 spellId, uint8 removeSpecMask, bool onlyTemporar
|
||||
// not reset skills for professions and racial abilities
|
||||
if ((pSkill->categoryId == SKILL_CATEGORY_SECONDARY || pSkill->categoryId == SKILL_CATEGORY_PROFESSION) && (IsProfessionSkill(pSkill->id) || _spell_idx->second->racemask != 0))
|
||||
continue;
|
||||
|
||||
|
||||
// pussywizard: this is needed for weapon/armor/language skills to remove them when loosing spell
|
||||
SetSkill(pSkill->id, GetSkillStep(pSkill->id), 0, 0);
|
||||
}
|
||||
@@ -14584,8 +14584,8 @@ void Player::PrepareGossipMenu(WorldObject* source, uint32 menuId /*= 0*/, bool
|
||||
break;
|
||||
case GOSSIP_OPTION_VENDOR:
|
||||
{
|
||||
VendorItemData const* vendorItems = creature->GetVendorItems();
|
||||
if (!vendorItems || vendorItems->Empty())
|
||||
VendorItemData const* vendorItems = itr->second.ActionMenuId ? nullptr : creature->GetVendorItems();
|
||||
if (!itr->second.ActionMenuId && (!vendorItems || vendorItems->Empty()))
|
||||
{
|
||||
sLog->outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_VENDOR but have empty trading item list.", creature->GetGUIDLow(), creature->GetEntry());
|
||||
canTalk = false;
|
||||
@@ -14759,7 +14759,7 @@ void Player::OnGossipSelect(WorldObject* source, uint32 gossipListId, uint32 men
|
||||
break;
|
||||
case GOSSIP_OPTION_VENDOR:
|
||||
case GOSSIP_OPTION_ARMORER:
|
||||
GetSession()->SendListInventory(guid);
|
||||
GetSession()->SendListInventory(guid, menuItemData->GossipActionMenuId);
|
||||
break;
|
||||
case GOSSIP_OPTION_STABLEPET:
|
||||
GetSession()->SendStablePet(guid);
|
||||
@@ -20407,7 +20407,7 @@ void Player::TextEmote(const std::string& text)
|
||||
{
|
||||
WorldPacket data;
|
||||
ChatHandler::BuildChatPacket(data, CHAT_MSG_EMOTE, LANG_UNIVERSAL, this, this, text);
|
||||
SendMessageToSetInRange_OwnTeam(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true);
|
||||
SendMessageToSetInRange(&data, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE), true, !sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT));
|
||||
}
|
||||
|
||||
void Player::Whisper(const std::string& text, uint32 language, uint64 receiver)
|
||||
@@ -20514,7 +20514,7 @@ void Player::PossessSpellInitialize()
|
||||
|
||||
if (!charmInfo)
|
||||
{
|
||||
sLog->outError("Player::PossessSpellInitialize(): charm (" UI64FMTD") has no charminfo!", charm->GetGUID());
|
||||
sLog->outError("Player::PossessSpellInitialize(): charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -20604,7 +20604,7 @@ void Player::CharmSpellInitialize()
|
||||
CharmInfo* charmInfo = charm->GetCharmInfo();
|
||||
if (!charmInfo)
|
||||
{
|
||||
sLog->outError("Player::CharmSpellInitialize(): the player's charm (" UI64FMTD") has no charminfo!", charm->GetGUID());
|
||||
sLog->outError("Player::CharmSpellInitialize(): the player's charm ("UI64FMTD") has no charminfo!", charm->GetGUID());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -21533,8 +21533,9 @@ bool Player::BuyItemFromVendorSlot(uint64 vendorguid, uint32 vendorslot, uint32
|
||||
return false;
|
||||
}
|
||||
|
||||
VendorItemData const* vItems = creature->GetVendorItems();
|
||||
if (!vItems || vItems->Empty())
|
||||
|
||||
VendorItemData const* vItems = GetSession()->GetCurrentVendor() ? sObjectMgr->GetNpcVendorItemList(GetSession()->GetCurrentVendor()) : creature->GetVendorItems();
|
||||
if (!vItems || vItems->Empty())
|
||||
{
|
||||
SendBuyError(BUY_ERR_CANT_FIND_ITEM, creature, item, 0);
|
||||
return false;
|
||||
@@ -25555,7 +25556,7 @@ void Player::SetEquipmentSet(uint32 index, EquipmentSet eqset)
|
||||
|
||||
if (!found) // something wrong...
|
||||
{
|
||||
sLog->outError("Player %s tried to save equipment set " UI64FMTD" (index %u), but that equipment set not found!", GetName().c_str(), eqset.Guid, index);
|
||||
sLog->outError("Player %s tried to save equipment set "UI64FMTD" (index %u), but that equipment set not found!", GetName().c_str(), eqset.Guid, index);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,6 +222,7 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri
|
||||
|
||||
TeamId teamId = player->GetTeamId();
|
||||
AccountTypes security = player->GetSession()->GetSecurity();
|
||||
bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
AccountTypes gmLevelInWhoList = AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
|
||||
|
||||
PlayerSocialMap::iterator itr = player->GetSocial()->m_playerSocialMap.find(friendGUID);
|
||||
@@ -230,7 +231,7 @@ void SocialMgr::GetFriendInfo(Player* player, uint32 friendGUID, FriendInfo &fri
|
||||
|
||||
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||
if (pFriend && (!AccountMgr::IsPlayerAccount(security) || (pFriend->GetTeamId() == teamId && pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList)) && pFriend->IsVisibleGloballyFor(player))
|
||||
if (pFriend && (!AccountMgr::IsPlayerAccount(security) || ((pFriend->GetTeamId() == teamId || allowTwoSideWhoList) && pFriend->GetSession()->GetSecurity() <= gmLevelInWhoList)) && pFriend->IsVisibleGloballyFor(player))
|
||||
{
|
||||
friendInfo.Status = FRIEND_STATUS_ONLINE;
|
||||
if (pFriend->isAFK())
|
||||
@@ -293,7 +294,8 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
|
||||
|
||||
TeamId teamId = player->GetTeamId();
|
||||
AccountTypes security = player->GetSession()->GetSecurity();
|
||||
uint32 guid = player->GetGUIDLow();
|
||||
uint32 guid = player->GetGUIDLow();
|
||||
bool allowTwoSideWhoList = sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_WHO_LIST);
|
||||
AccountTypes gmLevelInWhoList = AccountTypes(sWorld->getIntConfig(CONFIG_GM_LEVEL_IN_WHO_LIST));
|
||||
|
||||
for (SocialMap::const_iterator itr = m_socialMap.begin(); itr != m_socialMap.end(); ++itr)
|
||||
@@ -305,7 +307,7 @@ void SocialMgr::BroadcastToFriendListers(Player* player, WorldPacket* packet)
|
||||
|
||||
// PLAYER see his team only and PLAYER can't see MODERATOR, GAME MASTER, ADMINISTRATOR characters
|
||||
// MODERATOR, GAME MASTER, ADMINISTRATOR can see all
|
||||
if (pFriend && (!AccountMgr::IsPlayerAccount(pFriend->GetSession()->GetSecurity()) || (pFriend->GetTeamId() == teamId && security <= gmLevelInWhoList)) && player->IsVisibleGloballyFor(pFriend))
|
||||
if (pFriend && (!AccountMgr::IsPlayerAccount(pFriend->GetSession()->GetSecurity()) || ((pFriend->GetTeamId() == teamId || allowTwoSideWhoList) && security <= gmLevelInWhoList)) && player->IsVisibleGloballyFor(pFriend))
|
||||
pFriend->GetSession()->SendPacket(packet);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user