mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 17:13:47 +00:00
Merge branch 'master' into Playerbot
# Conflicts: # src/server/game/World/World.h
This commit is contained in:
@@ -34,15 +34,28 @@ void WorldSession::HandleInspectArenaTeamsOpcode(WorldPacket& recvData)
|
||||
recvData >> guid;
|
||||
LOG_DEBUG("network", "Inspect Arena stats ({})", guid.ToString());
|
||||
|
||||
if (Player* player = ObjectAccessor::FindPlayer(guid))
|
||||
Player* player = ObjectAccessor::FindPlayer(guid);
|
||||
if (!player)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetPlayer()->IsWithinDistInMap(player, INSPECT_DISTANCE, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->IsValidAttackTarget(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < MAX_ARENA_SLOT; ++i)
|
||||
{
|
||||
if (uint32 a_id = player->GetArenaTeamId(i))
|
||||
{
|
||||
if (uint32 a_id = player->GetArenaTeamId(i))
|
||||
{
|
||||
if (ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(a_id))
|
||||
arenaTeam->Inspect(this, player->GetGUID());
|
||||
}
|
||||
if (ArenaTeam* arenaTeam = sArenaTeamMgr->GetArenaTeamById(a_id))
|
||||
arenaTeam->Inspect(this, player->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -97,7 +110,7 @@ void WorldSession::HandleArenaTeamInviteOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", invitedName, ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
|
||||
return;
|
||||
|
||||
@@ -53,7 +53,7 @@ void WorldSession::HandleAuctionHelloOpcode(WorldPacket& recvData)
|
||||
//this void causes that auction window is opened
|
||||
void WorldSession::SendAuctionHello(ObjectGuid guid, Creature* unit)
|
||||
{
|
||||
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ))
|
||||
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_AUCTION_REQ), sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
|
||||
return;
|
||||
|
||||
@@ -122,7 +122,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
|
||||
// expected bracket entry
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
@@ -464,7 +464,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
|
||||
GetPlayerInfo(), arenaType, unk2, bgTypeId_, action);
|
||||
|
||||
// expected bracket entry
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
@@ -481,10 +481,10 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPacket& recvData)
|
||||
LOG_DEBUG("bg.battleground", "Player {} {} has a deserter debuff, do not port him to battleground!", _player->GetName(), _player->GetGUID().ToString());
|
||||
}
|
||||
|
||||
if (_player->getLevel() > bg->GetMaxLevel())
|
||||
if (_player->GetLevel() > bg->GetMaxLevel())
|
||||
{
|
||||
LOG_ERROR("network", "Player {} {} has level ({}) higher than maxlevel ({}) of battleground ({})! Do not port him to battleground!",
|
||||
_player->GetName(), _player->GetGUID().ToString(), _player->getLevel(), bg->GetMaxLevel(), bg->GetBgTypeID());
|
||||
_player->GetName(), _player->GetGUID().ToString(), _player->GetLevel(), bg->GetMaxLevel(), bg->GetBgTypeID());
|
||||
action = 0;
|
||||
}
|
||||
}
|
||||
@@ -650,7 +650,7 @@ void WorldSession::HandleBattlefieldStatusOpcode(WorldPacket& /*recvData*/)
|
||||
continue;
|
||||
|
||||
// expected bracket entry
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgt->GetMapId(), _player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgt->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
continue;
|
||||
|
||||
@@ -726,7 +726,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPacket& recvData)
|
||||
BattlegroundTypeId bgTypeId = bgt->GetBgTypeID();
|
||||
|
||||
// expected bracket entry
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgt->GetMapId(), _player->getLevel());
|
||||
PvPDifficultyEntry const* bracketEntry = GetBattlegroundBracketByLevel(bgt->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
|
||||
@@ -576,7 +576,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
||||
{
|
||||
LOG_INFO("entities.player.character", "Account: {} (IP: {}) Create Character: {} {}", GetAccountId(), GetRemoteAddress(), newChar->GetName(), newChar->GetGUID().ToString());
|
||||
sScriptMgr->OnPlayerCreate(newChar.get());
|
||||
sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->getGender(), newChar->getRace(), newChar->getClass(), newChar->getLevel());
|
||||
sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->getGender(), newChar->getRace(), newChar->getClass(), newChar->GetLevel());
|
||||
SendCharCreate(CHAR_CREATE_SUCCESS);
|
||||
}
|
||||
else
|
||||
@@ -653,7 +653,8 @@ void WorldSession::HandleCharDeleteOpcode(WorldPacket& recvData)
|
||||
sCalendarMgr->RemoveAllPlayerEventsAndInvites(guid);
|
||||
Player::DeleteFromDB(guid.GetCounter(), GetAccountId(), true, false);
|
||||
|
||||
sCharacterCache->DeleteCharacterCacheEntry(guid, name);
|
||||
sWorld->UpdateRealmCharCount(GetAccountId());
|
||||
|
||||
SendCharDelete(CHAR_DELETE_SUCCESS);
|
||||
}
|
||||
|
||||
@@ -1040,7 +1041,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
||||
|
||||
std::string IP_str = GetRemoteAddress();
|
||||
LOG_INFO("entities.player", "Account: {} (IP: {}) Login Character:[{}] ({}) Level: {}",
|
||||
GetAccountId(), IP_str, pCurrChar->GetName(), pCurrChar->GetGUID().ToString(), pCurrChar->getLevel());
|
||||
GetAccountId(), IP_str, pCurrChar->GetName(), pCurrChar->GetGUID().ToString(), pCurrChar->GetLevel());
|
||||
|
||||
if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED))
|
||||
pCurrChar->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
@@ -351,7 +351,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
if (!sender->IsAlive())
|
||||
return;
|
||||
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ))
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
|
||||
return;
|
||||
@@ -367,7 +367,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
break;
|
||||
case CHAT_MSG_WHISPER:
|
||||
{
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||
return;
|
||||
@@ -590,7 +590,7 @@ void WorldSession::HandleMessagechatOpcode(WorldPacket& recvData)
|
||||
{
|
||||
if (AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||
{
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
||||
return;
|
||||
@@ -766,6 +766,9 @@ void WorldSession::HandleTextEmoteOpcode(WorldPacket& recvData)
|
||||
case EMOTE_STATE_KNEEL:
|
||||
case EMOTE_ONESHOT_NONE:
|
||||
break;
|
||||
case EMOTE_STATE_DANCE:
|
||||
GetPlayer()->SetUInt32Value(UNIT_NPC_EMOTESTATE, emote_anim);
|
||||
break;
|
||||
default:
|
||||
// Only allow text-emotes for "dead" entities (feign death included)
|
||||
if (GetPlayer()->HasUnitState(UNIT_STATE_DIED))
|
||||
|
||||
@@ -124,7 +124,7 @@ void WorldSession::HandleGroupInviteOpcode(WorldPacket& recvData)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player->GetSocial()->HasFriend(GetPlayer()->GetGUID()) && GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ))
|
||||
if (!player->GetSocial()->HasFriend(GetPlayer()->GetGUID()) && GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ))
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, player->GetName(), ERR_INVITE_RESTRICTED);
|
||||
return;
|
||||
@@ -567,6 +567,12 @@ void WorldSession::HandleRandomRollOpcode(WorldPackets::Misc::RandomRollClient&
|
||||
minimum = packet.Min;
|
||||
maximum = packet.Max;
|
||||
|
||||
/** error handling **/
|
||||
if (minimum > maximum || maximum > 10000) // < 32768 for urand call
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GetPlayer()->DoRandomRoll(minimum, maximum);
|
||||
}
|
||||
|
||||
@@ -853,7 +859,7 @@ void WorldSession::BuildPartyMemberStatsChangedPacket(Player* player, WorldPacke
|
||||
*data << uint16(player->GetMaxPower(powerType));
|
||||
|
||||
if (mask & GROUP_UPDATE_FLAG_LEVEL)
|
||||
*data << uint16(player->getLevel());
|
||||
*data << uint16(player->GetLevel());
|
||||
|
||||
if (mask & GROUP_UPDATE_FLAG_ZONE)
|
||||
*data << uint16(player->GetZoneId());
|
||||
@@ -1044,7 +1050,7 @@ void WorldSession::HandleRequestPartyMemberStatsOpcode(WorldPacket& recvData)
|
||||
|
||||
data << uint16(player->GetPower(powerType)); // GROUP_UPDATE_FLAG_CUR_POWER
|
||||
data << uint16(player->GetMaxPower(powerType)); // GROUP_UPDATE_FLAG_MAX_POWER
|
||||
data << uint16(player->getLevel()); // GROUP_UPDATE_FLAG_LEVEL
|
||||
data << uint16(player->GetLevel()); // GROUP_UPDATE_FLAG_LEVEL
|
||||
data << uint16(player->GetZoneId()); // GROUP_UPDATE_FLAG_ZONE
|
||||
data << uint16(player->GetPositionX()); // GROUP_UPDATE_FLAG_POSITION
|
||||
data << uint16(player->GetPositionY()); // GROUP_UPDATE_FLAG_POSITION
|
||||
|
||||
@@ -152,12 +152,12 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*
|
||||
LOG_DEBUG("network", "CMSG_LFG_PLAYER_LOCK_INFO_REQUEST [{}]", guid.ToString());
|
||||
|
||||
// Get Random dungeons that can be done at a certain level and expansion
|
||||
uint8 level = GetPlayer()->getLevel();
|
||||
uint8 level = GetPlayer()->GetLevel();
|
||||
lfg::LfgDungeonSet const& randomDungeons =
|
||||
sLFGMgr->GetRandomAndSeasonalDungeons(level, GetPlayer()->GetSession()->Expansion());
|
||||
|
||||
// Get player locked Dungeons
|
||||
sLFGMgr->InitializeLockedDungeons(GetPlayer()); // pussywizard
|
||||
sLFGMgr->InitializeLockedDungeons(GetPlayer(), GetPlayer()->GetGroup()); // pussywizard
|
||||
lfg::LfgLockMap const& lock = sLFGMgr->GetLockedDungeons(guid);
|
||||
uint32 rsize = uint32(randomDungeons.size());
|
||||
uint32 lsize = uint32(lock.size());
|
||||
@@ -185,7 +185,7 @@ void WorldSession::HandleLfgPlayerLockInfoRequestOpcode(WorldPacket& /*recvData*
|
||||
|
||||
if (quest)
|
||||
{
|
||||
uint8 playerLevel = GetPlayer() ? GetPlayer()->getLevel() : 0;
|
||||
uint8 playerLevel = GetPlayer() ? GetPlayer()->GetLevel() : 0;
|
||||
data << uint8(done);
|
||||
data << uint32(quest->GetRewOrReqMoney(playerLevel));
|
||||
data << uint32(quest->XPValue(playerLevel));
|
||||
@@ -239,7 +239,7 @@ void WorldSession::HandleLfgPartyLockInfoRequestOpcode(WorldPacket& /*recvData*
|
||||
if (pguid == guid)
|
||||
continue;
|
||||
|
||||
sLFGMgr->InitializeLockedDungeons(plrg); // pussywizard
|
||||
sLFGMgr->InitializeLockedDungeons(plrg, group); // pussywizard
|
||||
lockMap[pguid] = sLFGMgr->GetLockedDungeons(pguid);
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck)
|
||||
data << uint8(roles > 0); // Ready
|
||||
data << uint32(roles); // Roles
|
||||
Player* player = ObjectAccessor::FindConnectedPlayer(guid);
|
||||
data << uint8(player ? player->getLevel() : 0); // Level
|
||||
data << uint8(player ? player->GetLevel() : 0); // Level
|
||||
|
||||
for (lfg::LfgRolesMap::const_iterator it = roleCheck.roles.begin(); it != roleCheck.roles.end(); ++it)
|
||||
{
|
||||
@@ -423,7 +423,7 @@ void WorldSession::SendLfgRoleCheckUpdate(lfg::LfgRoleCheck const& roleCheck)
|
||||
data << uint8(roles > 0); // Ready
|
||||
data << uint32(roles); // Roles
|
||||
player = ObjectAccessor::FindConnectedPlayer(guid);
|
||||
data << uint8(player ? player->getLevel() : 0);// Level
|
||||
data << uint8(player ? player->GetLevel() : 0);// Level
|
||||
}
|
||||
}
|
||||
SendPacket(&data);
|
||||
@@ -473,7 +473,7 @@ void WorldSession::SendLfgPlayerReward(lfg::LfgPlayerRewardData const& rewardDat
|
||||
|
||||
uint8 itemNum = rewardData.quest->GetRewItemsCount();
|
||||
|
||||
uint8 playerLevel = GetPlayer() ? GetPlayer()->getLevel() : 0;
|
||||
uint8 playerLevel = GetPlayer() ? GetPlayer()->GetLevel() : 0;
|
||||
|
||||
WorldPacket data(SMSG_LFG_PLAYER_REWARD, 4 + 4 + 1 + 4 + 4 + 4 + 4 + 4 + 1 + itemNum * (4 + 4 + 4));
|
||||
data << uint32(rewardData.rdungeonEntry); // Random Dungeon Finished
|
||||
|
||||
@@ -93,7 +93,16 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPacket& recvData)
|
||||
loot = &creature->loot;
|
||||
}
|
||||
|
||||
player->StoreLootItem(lootSlot, loot);
|
||||
InventoryResult msg;
|
||||
LootItem* lootItem = player->StoreLootItem(lootSlot, loot, msg);
|
||||
if (msg != EQUIP_ERR_OK && lguid.IsItem() && loot->loot_type != LOOT_CORPSE)
|
||||
{
|
||||
lootItem->is_looted = true;
|
||||
loot->NotifyItemRemoved(lootItem->itemIndex);
|
||||
loot->unlootedCount--;
|
||||
|
||||
player->SendItemRetrievalMail(lootItem->itemid, lootItem->count);
|
||||
}
|
||||
|
||||
// If player is removing the last LootItem, delete the empty container.
|
||||
if (loot->isLooted() && lguid.IsItem())
|
||||
|
||||
@@ -115,7 +115,7 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
Player* player = _player;
|
||||
|
||||
if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
if (player->GetLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_MAIL_SENDER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
return;
|
||||
@@ -269,12 +269,19 @@ void WorldSession::HandleSendMail(WorldPacket& recvData)
|
||||
|
||||
if (!sScriptMgr->CanSendMail(player, receiverGuid, mailbox, subject, body, money, COD, item))
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
items[i] = item;
|
||||
}
|
||||
|
||||
if (!items_count && !sScriptMgr->CanSendMail(player, receiverGuid, mailbox, subject, body, money, COD, nullptr))
|
||||
{
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_ERR_INTERNAL_ERROR);
|
||||
return;
|
||||
}
|
||||
|
||||
player->SendMailResult(0, MAIL_SEND, MAIL_OK);
|
||||
|
||||
player->ModifyMoney(-int32(reqmoney));
|
||||
|
||||
@@ -851,7 +851,7 @@ void WorldSession::HandleUpdateAccountData(WorldPacket& recv_data)
|
||||
|
||||
LOG_DEBUG("network", "UAD: type {}, time {}, decompressedSize {}", type, timestamp, decompressedSize);
|
||||
|
||||
if (type > NUM_ACCOUNT_DATA_TYPES)
|
||||
if (type >= NUM_ACCOUNT_DATA_TYPES)
|
||||
return;
|
||||
|
||||
if (decompressedSize == 0) // erase
|
||||
@@ -1042,6 +1042,16 @@ void WorldSession::HandleInspectOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetPlayer()->IsWithinDistInMap(player, INSPECT_DISTANCE, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->IsValidAttackTarget(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 talent_points = 0x47;
|
||||
uint32 guid_size = player->GetPackGUID().size();
|
||||
WorldPacket data(SMSG_INSPECT_TALENT, guid_size + 4 + talent_points);
|
||||
@@ -1074,6 +1084,16 @@ void WorldSession::HandleInspectHonorStatsOpcode(WorldPacket& recv_data)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetPlayer()->IsWithinDistInMap(player, INSPECT_DISTANCE, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->IsValidAttackTarget(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
WorldPacket data(MSG_INSPECT_HONOR_STATS, 8 + 1 + 4 * 4);
|
||||
data << player->GetGUID();
|
||||
data << uint8(player->GetHonorPoints());
|
||||
@@ -1608,7 +1628,19 @@ void WorldSession::HandleQueryInspectAchievements(WorldPacket& recv_data)
|
||||
|
||||
Player* player = ObjectAccessor::GetPlayer(*_player, guid);
|
||||
if (!player)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (!GetPlayer()->IsWithinDistInMap(player, INSPECT_DISTANCE, false))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->IsValidAttackTarget(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
player->SendRespondInspectAchievements(_player);
|
||||
}
|
||||
|
||||
@@ -370,6 +370,15 @@ void WorldSession::HandleMovementOpcodes(WorldPacket& recvData)
|
||||
movementInfo.guid = guid;
|
||||
ReadMovementInfo(recvData, &movementInfo);
|
||||
|
||||
// Stop emote on move
|
||||
if (Player* plrMover = mover->ToPlayer())
|
||||
{
|
||||
if (plrMover->GetUInt32Value(UNIT_NPC_EMOTESTATE) != EMOTE_ONESHOT_NONE)
|
||||
{
|
||||
plrMover->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
if (!movementInfo.pos.IsPositionValid())
|
||||
{
|
||||
if (plrMover)
|
||||
|
||||
@@ -92,7 +92,7 @@ void WorldSession::HandlePetitionBuyOpcode(WorldPacket& recvData)
|
||||
else
|
||||
{
|
||||
// TODO: find correct opcode
|
||||
if (_player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (_player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", _player->GetName(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
|
||||
return;
|
||||
@@ -426,7 +426,7 @@ void WorldSession::HandlePetitionSignOpcode(WorldPacket& recvData)
|
||||
|
||||
if (type != GUILD_CHARTER_TYPE)
|
||||
{
|
||||
if (_player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (_player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, "", _player->GetName().c_str(), ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
|
||||
return;
|
||||
@@ -578,7 +578,7 @@ void WorldSession::HandleOfferPetitionOpcode(WorldPacket& recvData)
|
||||
|
||||
if (petition->petitionType != GUILD_CHARTER_TYPE)
|
||||
{
|
||||
if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (player->GetLevel() < sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
{
|
||||
// player is too low level to join an arena team
|
||||
SendArenaTeamCommandResult(ERR_ARENA_TEAM_CREATE_S, player->GetName().c_str(), "", ERR_ARENA_TEAM_TARGET_TOO_LOW_S);
|
||||
|
||||
@@ -40,9 +40,9 @@ void WorldSession::HandleGrantLevel(WorldPacket& recvData)
|
||||
error = ERR_REFER_A_FRIEND_NOT_REFERRED_BY;
|
||||
else if (target->GetTeamId() != _player->GetTeamId())
|
||||
error = ERR_REFER_A_FRIEND_DIFFERENT_FACTION;
|
||||
else if (target->getLevel() >= _player->getLevel())
|
||||
else if (target->GetLevel() >= _player->GetLevel())
|
||||
error = ERR_REFER_A_FRIEND_TARGET_TOO_HIGH;
|
||||
else if (target->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
||||
else if (target->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
||||
error = ERR_REFER_A_FRIEND_GRANT_LEVEL_MAX_I;
|
||||
else if (target->GetGroup() != _player->GetGroup())
|
||||
error = ERR_REFER_A_FRIEND_NOT_IN_GROUP;
|
||||
@@ -82,5 +82,5 @@ void WorldSession::HandleAcceptGrantLevel(WorldPacket& recvData)
|
||||
else
|
||||
return;
|
||||
|
||||
_player->GiveLevel(_player->getLevel() + 1);
|
||||
_player->GiveLevel(_player->GetLevel() + 1);
|
||||
}
|
||||
|
||||
@@ -458,7 +458,7 @@ void WorldSession::HandleCastSpellOpcode(WorldPacket& recvPacket)
|
||||
// auto-selection buff level base at target level (in spellInfo)
|
||||
if (targets.GetUnitTarget())
|
||||
{
|
||||
SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(targets.GetUnitTarget()->getLevel());
|
||||
SpellInfo const* actualSpellInfo = spellInfo->GetAuraRankForLevel(targets.GetUnitTarget()->GetLevel());
|
||||
|
||||
// if rank not found then function return nullptr but in explicit cast case original spell can be casted and later failed with appropriate error message
|
||||
if (actualSpellInfo)
|
||||
|
||||
@@ -33,7 +33,7 @@ void WorldSession::HandleGMTicketCreateOpcode(WorldPacket& recvData)
|
||||
if (sTicketMgr->GetStatus() == GMTICKET_QUEUE_STATUS_DISABLED)
|
||||
return;
|
||||
|
||||
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ))
|
||||
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_TICKET_REQ), sWorld->getIntConfig(CONFIG_TICKET_LEVEL_REQ));
|
||||
return;
|
||||
|
||||
@@ -570,7 +570,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
@@ -635,7 +635,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPacket& recvPacket)
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
if (pOther->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetAcoreString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user