mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-21 07:22:02 -04:00
Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
uint8 GetLevelForTarget(WorldObject const* /*target*/)
void SetLevel(uint8 lvl)
uint8 GetRace()
uint32 GetRaceMask()
uint8 GetClass()
uint32 GetClassMask()
uint8 GetGender()
(cherry picked from commit 5c09ff51f7)
This commit is contained in:
@@ -416,7 +416,7 @@ bool PlayerAI::IsPlayerHealer(Player const* who)
|
||||
if (!who)
|
||||
return false;
|
||||
|
||||
switch (who->getClass())
|
||||
switch (who->GetClass())
|
||||
{
|
||||
case CLASS_WARRIOR:
|
||||
case CLASS_HUNTER:
|
||||
@@ -445,7 +445,7 @@ bool PlayerAI::IsPlayerRangedAttacker(Player const* who)
|
||||
if (!who)
|
||||
return false;
|
||||
|
||||
switch (who->getClass())
|
||||
switch (who->GetClass())
|
||||
{
|
||||
case CLASS_WARRIOR:
|
||||
case CLASS_PALADIN:
|
||||
|
||||
@@ -845,7 +845,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
|
||||
if (e.action.fleeAssist.withEmote)
|
||||
{
|
||||
Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_FLEE_FOR_ASSIST, me->getGender());
|
||||
Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_FLEE_FOR_ASSIST, me->GetGender());
|
||||
CreatureTextMgr::SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE);
|
||||
}
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_FLEE_FOR_ASSIST: %s DoFleeToGetAssistance", me->GetGUID().ToString().c_str());
|
||||
@@ -1086,7 +1086,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
me->CallForHelp(float(e.action.callHelp.range));
|
||||
if (e.action.callHelp.withEmote)
|
||||
{
|
||||
Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_CALL_FOR_HELP, me->getGender());
|
||||
Trinity::BroadcastTextBuilder builder(me, CHAT_MSG_MONSTER_EMOTE, BROADCAST_TEXT_CALL_FOR_HELP, me->GetGender());
|
||||
sCreatureTextMgr->SendChatPacket(me, builder, CHAT_MSG_MONSTER_EMOTE);
|
||||
}
|
||||
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_CALL_FOR_HELP: Creature %s", me->GetGUID().ToString().c_str());
|
||||
|
||||
@@ -273,7 +273,7 @@ void PlayerAchievementMgr::LoadFromDB(PreparedQueryResult achievementResult, Pre
|
||||
|
||||
// title achievement rewards are retroactive
|
||||
if (AchievementReward const* reward = sAchievementMgr->GetAchievementReward(achievement))
|
||||
if (uint32 titleId = reward->TitleId[Player::TeamForRace(_owner->getRace()) == ALLIANCE ? 0 : 1])
|
||||
if (uint32 titleId = reward->TitleId[Player::TeamForRace(_owner->GetRace()) == ALLIANCE ? 0 : 1])
|
||||
if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId))
|
||||
_owner->SetTitle(titleEntry);
|
||||
|
||||
@@ -656,7 +656,7 @@ void PlayerAchievementMgr::SendAchievementEarned(AchievementEntry const* achieve
|
||||
{
|
||||
if (Guild* guild = sGuildMgr->GetGuildById(_owner->GetGuildId()))
|
||||
{
|
||||
Trinity::BroadcastTextBuilder _builder(_owner, CHAT_MSG_GUILD_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, _owner->getGender(), _owner, achievement->ID);
|
||||
Trinity::BroadcastTextBuilder _builder(_owner, CHAT_MSG_GUILD_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, _owner->GetGender(), _owner, achievement->ID);
|
||||
Trinity::LocalizedDo<Trinity::BroadcastTextBuilder> _localizer(_builder);
|
||||
guild->BroadcastWorker(_localizer, _owner);
|
||||
}
|
||||
@@ -673,7 +673,7 @@ void PlayerAchievementMgr::SendAchievementEarned(AchievementEntry const* achieve
|
||||
// if player is in world he can tell his friends about new achievement
|
||||
else if (_owner->IsInWorld())
|
||||
{
|
||||
Trinity::BroadcastTextBuilder _builder(_owner, CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, _owner->getGender(), _owner, achievement->ID);
|
||||
Trinity::BroadcastTextBuilder _builder(_owner, CHAT_MSG_ACHIEVEMENT, BROADCAST_TEXT_ACHIEVEMENT_EARNED, _owner->GetGender(), _owner, achievement->ID);
|
||||
Trinity::LocalizedDo<Trinity::BroadcastTextBuilder> _localizer(_builder);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedDo<Trinity::BroadcastTextBuilder>> _worker(_owner, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY), _localizer);
|
||||
Cell::VisitWorldObjects(_owner, _worker, sWorld->getFloatConfig(CONFIG_LISTEN_RANGE_SAY));
|
||||
|
||||
@@ -308,17 +308,17 @@ bool CriteriaData::Meets(uint32 criteriaId, Player const* source, WorldObject co
|
||||
case CRITERIA_DATA_TYPE_T_PLAYER_CLASS_RACE:
|
||||
if (!target || target->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
if (ClassRace.Class && ClassRace.Class != target->ToPlayer()->getClass())
|
||||
if (ClassRace.Class && ClassRace.Class != target->ToPlayer()->GetClass())
|
||||
return false;
|
||||
if (ClassRace.Race && ClassRace.Race != target->ToPlayer()->getRace())
|
||||
if (ClassRace.Race && ClassRace.Race != target->ToPlayer()->GetRace())
|
||||
return false;
|
||||
return true;
|
||||
case CRITERIA_DATA_TYPE_S_PLAYER_CLASS_RACE:
|
||||
if (source->GetTypeId() != TYPEID_PLAYER)
|
||||
return false;
|
||||
if (ClassRace.Class && ClassRace.Class != source->ToPlayer()->getClass())
|
||||
if (ClassRace.Class && ClassRace.Class != source->ToPlayer()->GetClass())
|
||||
return false;
|
||||
if (ClassRace.Race && ClassRace.Race != source->ToPlayer()->getRace())
|
||||
if (ClassRace.Race && ClassRace.Race != source->ToPlayer()->GetRace())
|
||||
return false;
|
||||
return true;
|
||||
case CRITERIA_DATA_TYPE_T_PLAYER_LESS_HEALTH:
|
||||
@@ -349,7 +349,7 @@ bool CriteriaData::Meets(uint32 criteriaId, Player const* source, WorldObject co
|
||||
Unit const* unitTarget = target->ToUnit();
|
||||
if (!unitTarget)
|
||||
return false;
|
||||
return unitTarget->getGender() == Gender.Gender;
|
||||
return unitTarget->GetGender() == Gender.Gender;
|
||||
}
|
||||
case CRITERIA_DATA_TYPE_SCRIPT:
|
||||
{
|
||||
@@ -589,7 +589,7 @@ void CriteriaHandler::UpdateCriteria(CriteriaType type, uint64 miscValue1 /*= 0*
|
||||
SetCriteriaProgress(criteria, miscValue1, referencePlayer, PROGRESS_HIGHEST);
|
||||
break;
|
||||
case CriteriaType::ReachLevel:
|
||||
SetCriteriaProgress(criteria, referencePlayer->getLevel(), referencePlayer);
|
||||
SetCriteriaProgress(criteria, referencePlayer->GetLevel(), referencePlayer);
|
||||
break;
|
||||
case CriteriaType::SkillRaised:
|
||||
if (uint32 skillvalue = referencePlayer->GetBaseSkillValue(criteria->Entry->Asset.SkillID))
|
||||
@@ -1790,15 +1790,15 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
break;
|
||||
}
|
||||
case ModifierTreeType::PlayerToTargetLevelDeltaGreaterThan: // 21
|
||||
if (!ref || !ref->IsUnit() || referencePlayer->getLevel() < ref->ToUnit()->getLevel() + reqValue)
|
||||
if (!ref || !ref->IsUnit() || referencePlayer->GetLevel() < ref->ToUnit()->GetLevel() + reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TargetToPlayerLevelDeltaGreaterThan: // 22
|
||||
if (!ref || !ref->IsUnit() || referencePlayer->getLevel() + reqValue < ref->ToUnit()->getLevel())
|
||||
if (!ref || !ref->IsUnit() || referencePlayer->GetLevel() + reqValue < ref->ToUnit()->GetLevel())
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayerLevelEqualTargetLevel: // 23
|
||||
if (!ref || !ref->IsUnit() || referencePlayer->getLevel() != ref->ToUnit()->getLevel())
|
||||
if (!ref || !ref->IsUnit() || referencePlayer->GetLevel() != ref->ToUnit()->GetLevel())
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayerInArenaWithTeamSize: // 24
|
||||
@@ -1809,19 +1809,19 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
break;
|
||||
}
|
||||
case ModifierTreeType::PlayerRace: // 25
|
||||
if (referencePlayer->getRace() != reqValue)
|
||||
if (referencePlayer->GetRace() != reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayerClass: // 26
|
||||
if (referencePlayer->getClass() != reqValue)
|
||||
if (referencePlayer->GetClass() != reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TargetRace: // 27
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->getRace() != reqValue)
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->GetRace() != reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TargetClass: // 28
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->getClass() != reqValue)
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->GetClass() != reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::LessThanTappers: // 29
|
||||
@@ -1874,7 +1874,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayerLevelEqual: // 39
|
||||
if (referencePlayer->getLevel() != reqValue)
|
||||
if (referencePlayer->GetLevel() != reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TargetLevelEqual: // 40
|
||||
@@ -2013,19 +2013,19 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayerLevelEqualOrGreaterThan: // 69
|
||||
if (referencePlayer->getLevel() < reqValue)
|
||||
if (referencePlayer->GetLevel() < reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TargetLevelEqualOrGreaterThan: // 70
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->getLevel() < reqValue)
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->GetLevel() < reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayerLevelEqualOrLessThan: // 71
|
||||
if (referencePlayer->getLevel() > reqValue)
|
||||
if (referencePlayer->GetLevel() > reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TargetLevelEqualOrLessThan: // 72
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->getLevel() > reqValue)
|
||||
if (!ref || !ref->IsUnit() || ref->ToUnit()->GetLevel() > reqValue)
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::ModifierTree: // 73
|
||||
@@ -2166,7 +2166,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
break;
|
||||
}
|
||||
case ModifierTreeType::PlayerGender: // 97
|
||||
if (referencePlayer->getGender() != uint8(reqValue))
|
||||
if (referencePlayer->GetGender() != uint8(reqValue))
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::PlayerNativeGender: // 98
|
||||
@@ -2279,7 +2279,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
break;
|
||||
case ModifierTreeType::PlayerFaction: // 116
|
||||
{
|
||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(referencePlayer->getRace());
|
||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(referencePlayer->GetRace());
|
||||
if (!race)
|
||||
return false;
|
||||
FactionTemplateEntry const* faction = sFactionTemplateStore.LookupEntry(race->FactionID);
|
||||
@@ -3413,7 +3413,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
break;
|
||||
}
|
||||
case ModifierTreeType::PlayerIsAtMaxExpansionLevel: // 264
|
||||
if (referencePlayer->getLevel() != GetMaxLevelForExpansion(sWorld->getIntConfig(CONFIG_EXPANSION)))
|
||||
if (referencePlayer->GetLevel() != GetMaxLevelForExpansion(sWorld->getIntConfig(CONFIG_EXPANSION)))
|
||||
return false;
|
||||
break;
|
||||
case ModifierTreeType::TransmogSource: // 265
|
||||
@@ -3443,7 +3443,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
return false;
|
||||
case ModifierTreeType::PlayerLevelWithinContentTuning: // 268
|
||||
{
|
||||
uint8 level = referencePlayer->getLevel();
|
||||
uint8 level = referencePlayer->GetLevel();
|
||||
if (Optional<ContentTuningLevels> levels = sDB2Manager.GetContentTuningData(reqValue, 0))
|
||||
{
|
||||
if (secondaryAsset)
|
||||
@@ -3456,7 +3456,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
{
|
||||
if (!ref || !ref->IsUnit())
|
||||
return false;
|
||||
uint8 level = ref->ToUnit()->getLevel();
|
||||
uint8 level = ref->ToUnit()->GetLevel();
|
||||
if (Optional<ContentTuningLevels> levels = sDB2Manager.GetContentTuningData(reqValue, 0))
|
||||
{
|
||||
if (secondaryAsset)
|
||||
@@ -3476,7 +3476,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
}
|
||||
case ModifierTreeType::PlayerLevelWithinOrAboveContentTuning: // 272
|
||||
{
|
||||
uint8 level = referencePlayer->getLevel();
|
||||
uint8 level = referencePlayer->GetLevel();
|
||||
if (Optional<ContentTuningLevels> levels = sDB2Manager.GetContentTuningData(reqValue, 0))
|
||||
return secondaryAsset ? level >= levels->MinLevelWithDelta : level >= levels->MinLevel;
|
||||
return false;
|
||||
@@ -3485,7 +3485,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
{
|
||||
if (!ref || !ref->IsUnit())
|
||||
return false;
|
||||
uint8 level = ref->ToUnit()->getLevel();
|
||||
uint8 level = ref->ToUnit()->GetLevel();
|
||||
if (Optional<ContentTuningLevels> levels = sDB2Manager.GetContentTuningData(reqValue, 0))
|
||||
return secondaryAsset ? level >= levels->MinLevelWithDelta : level >= levels->MinLevel;
|
||||
return false;
|
||||
@@ -3649,7 +3649,7 @@ bool CriteriaHandler::ModifierSatisfied(ModifierTreeEntry const* modifier, uint6
|
||||
return false;
|
||||
case ModifierTreeType::PlayerSpellShapeshiftFormCreatureDisplayInfoSelection: // 308
|
||||
{
|
||||
ShapeshiftFormModelData const* formModelData = sDB2Manager.GetShapeshiftFormModelData(referencePlayer->getRace(), referencePlayer->GetNativeSex(), secondaryAsset);
|
||||
ShapeshiftFormModelData const* formModelData = sDB2Manager.GetShapeshiftFormModelData(referencePlayer->GetRace(), referencePlayer->GetNativeSex(), secondaryAsset);
|
||||
if (!formModelData)
|
||||
return false;
|
||||
uint32 formChoice = referencePlayer->GetCustomizationChoice(formModelData->OptionID);
|
||||
|
||||
@@ -1287,7 +1287,7 @@ void AuctionHouseObject::BuildListBuckets(WorldPackets::AuctionHouse::AuctionLis
|
||||
|
||||
if (filters.HasFlag(AuctionHouseFilterMask::UsableOnly))
|
||||
{
|
||||
if (bucketData->RequiredLevel && player->getLevel() < bucketData->RequiredLevel)
|
||||
if (bucketData->RequiredLevel && player->GetLevel() < bucketData->RequiredLevel)
|
||||
continue;
|
||||
|
||||
if (player->CanUseItem(sObjectMgr->GetItemTemplate(bucket.first.ItemId), true) != EQUIP_ERR_OK)
|
||||
|
||||
@@ -279,7 +279,7 @@ void Battlefield::InvitePlayerToWar(Player* player)
|
||||
}
|
||||
|
||||
// If the player does not match minimal level requirements for the battlefield, kick him
|
||||
if (player->getLevel() < m_MinLevel)
|
||||
if (player->GetLevel() < m_MinLevel)
|
||||
{
|
||||
if (m_PlayersWillBeKick[player->GetTeamId()].count(player->GetGUID()) == 0)
|
||||
m_PlayersWillBeKick[player->GetTeamId()][player->GetGUID()] = GameTime::GetGameTime() + 10;
|
||||
|
||||
@@ -1328,7 +1328,7 @@ void BattlefieldWG::UpdateTenacity()
|
||||
{
|
||||
for (auto itr = m_players[m_tenacityTeam].begin(); itr != m_players[m_tenacityTeam].end(); ++itr)
|
||||
if (Player* player = ObjectAccessor::FindPlayer(*itr))
|
||||
if (player->getLevel() >= m_MinLevel)
|
||||
if (player->GetLevel() >= m_MinLevel)
|
||||
player->RemoveAurasDueToSpell(SPELL_TENACITY);
|
||||
|
||||
for (auto itr = m_vehicles[m_tenacityTeam].begin(); itr != m_vehicles[m_tenacityTeam].end(); ++itr)
|
||||
|
||||
@@ -102,7 +102,7 @@ bool ArenaTeam::AddMember(ObjectGuid playerGuid)
|
||||
Player* player = ObjectAccessor::FindPlayer(playerGuid);
|
||||
if (player)
|
||||
{
|
||||
playerClass = player->getClass();
|
||||
playerClass = player->GetClass();
|
||||
playerName = player->GetName();
|
||||
}
|
||||
else if (CharacterCacheEntry const* characterInfo = sCharacterCache->GetCharacterCacheByGuid(playerGuid))
|
||||
|
||||
@@ -1311,9 +1311,9 @@ void Battleground::BuildPvPLogDataPacket(WorldPackets::Battleground::PVPMatchSta
|
||||
{
|
||||
playerData.IsInWorld = true;
|
||||
playerData.PrimaryTalentTree = player->GetPrimarySpecialization();
|
||||
playerData.Sex = player->getGender();
|
||||
playerData.Race = player->getRace();
|
||||
playerData.Class = player->getClass();
|
||||
playerData.Sex = player->GetGender();
|
||||
playerData.Race = player->GetRace();
|
||||
playerData.Class = player->GetClass();
|
||||
playerData.HonorLevel = player->GetHonorLevel();
|
||||
}
|
||||
|
||||
|
||||
@@ -440,7 +440,7 @@ void CalendarMgr::SendCalendarEventInvite(CalendarInvite const& invite)
|
||||
ObjectGuid invitee = invite.GetInviteeGUID();
|
||||
Player* player = ObjectAccessor::FindConnectedPlayer(invitee);
|
||||
|
||||
uint8 level = player ? player->getLevel() : sCharacterCache->GetCharacterLevelByGuid(invitee);
|
||||
uint8 level = player ? player->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(invitee);
|
||||
|
||||
WorldPackets::Calendar::CalendarInviteAdded packet;
|
||||
packet.EventID = calendarEvent ? calendarEvent->GetEventId() : 0;
|
||||
@@ -579,7 +579,7 @@ void CalendarMgr::SendCalendarEvent(ObjectGuid guid, CalendarEvent const& calend
|
||||
ObjectGuid inviteeGuid = calendarInvite->GetInviteeGUID();
|
||||
Player* invitee = ObjectAccessor::FindPlayer(inviteeGuid);
|
||||
|
||||
uint8 inviteeLevel = invitee ? invitee->getLevel() : sCharacterCache->GetCharacterLevelByGuid(inviteeGuid);
|
||||
uint8 inviteeLevel = invitee ? invitee->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(inviteeGuid);
|
||||
ObjectGuid::LowType inviteeGuildId = invitee ? invitee->GetGuildId() : sCharacterCache->GetCharacterGuildIdByGuid(inviteeGuid);
|
||||
|
||||
WorldPackets::Calendar::CalendarEventInviteInfo inviteInfo;
|
||||
|
||||
@@ -210,19 +210,19 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
|
||||
case CONDITION_CLASS:
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
condMeets = (unit->getClassMask() & ConditionValue1) != 0;
|
||||
condMeets = (unit->GetClassMask() & ConditionValue1) != 0;
|
||||
break;
|
||||
}
|
||||
case CONDITION_RACE:
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
condMeets = Trinity::RaceMask<uint32>{ ConditionValue1 }.HasRace(unit->getRace());
|
||||
condMeets = Trinity::RaceMask<uint32>{ ConditionValue1 }.HasRace(unit->GetRace());
|
||||
break;
|
||||
}
|
||||
case CONDITION_GENDER:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
condMeets = player->getGender() == ConditionValue1;
|
||||
condMeets = player->GetGender() == ConditionValue1;
|
||||
break;
|
||||
}
|
||||
case CONDITION_SKILL:
|
||||
@@ -308,7 +308,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const
|
||||
case CONDITION_LEVEL:
|
||||
{
|
||||
if (Unit* unit = object->ToUnit())
|
||||
condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), static_cast<uint32>(unit->getLevel()), ConditionValue1);
|
||||
condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), static_cast<uint32>(unit->GetLevel()), ConditionValue1);
|
||||
break;
|
||||
}
|
||||
case CONDITION_DRUNKENSTATE:
|
||||
@@ -2654,7 +2654,7 @@ uint32 ConditionMgr::GetPlayerConditionLfgValue(Player const* player, PlayerCond
|
||||
if (!selectedRandomDungeon)
|
||||
return 0;
|
||||
|
||||
if (lfg::LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(selectedRandomDungeon, player->getLevel()))
|
||||
if (lfg::LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(selectedRandomDungeon, player->GetLevel()))
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(reward->firstQuest))
|
||||
if (player->CanRewardQuest(quest, false))
|
||||
return 1;
|
||||
@@ -2688,29 +2688,29 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio
|
||||
|
||||
if (condition->Flags & 0x80)
|
||||
{
|
||||
if (minLevel && player->getLevel() >= minLevel && (!maxLevel || player->getLevel() <= maxLevel))
|
||||
if (minLevel && player->GetLevel() >= minLevel && (!maxLevel || player->GetLevel() <= maxLevel))
|
||||
return false;
|
||||
|
||||
if (maxLevel && player->getLevel() <= maxLevel && (!minLevel || player->getLevel() >= minLevel))
|
||||
if (maxLevel && player->GetLevel() <= maxLevel && (!minLevel || player->GetLevel() >= minLevel))
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (minLevel && player->getLevel() < minLevel)
|
||||
if (minLevel && player->GetLevel() < minLevel)
|
||||
return false;
|
||||
|
||||
if (maxLevel && player->getLevel() > maxLevel)
|
||||
if (maxLevel && player->GetLevel() > maxLevel)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (condition->RaceMask && !condition->RaceMask.HasRace(player->getRace()))
|
||||
if (condition->RaceMask && !condition->RaceMask.HasRace(player->GetRace()))
|
||||
return false;
|
||||
|
||||
if (condition->ClassMask && !(player->getClassMask() & condition->ClassMask))
|
||||
if (condition->ClassMask && !(player->GetClassMask() & condition->ClassMask))
|
||||
return false;
|
||||
|
||||
if (condition->Gender >= 0 && player->getGender() != condition->Gender)
|
||||
if (condition->Gender >= 0 && player->GetGender() != condition->Gender)
|
||||
return false;
|
||||
|
||||
if (condition->NativeGender >= 0 && player->GetNativeSex() != condition->NativeGender)
|
||||
|
||||
@@ -1490,7 +1490,7 @@ void LFGMgr::FinishDungeon(ObjectGuid gguid, const uint32 dungeonId, Map const*
|
||||
player->UpdateCriteria(CriteriaType::CompletedLFGDungeonWithStrangers, lfdRandomPlayers);
|
||||
}
|
||||
|
||||
LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->getLevel());
|
||||
LfgReward const* reward = GetRandomDungeonReward(rDungeonId, player->GetLevel());
|
||||
if (!reward)
|
||||
continue;
|
||||
|
||||
@@ -1677,7 +1677,7 @@ LfgLockMap LFGMgr::GetLockedDungeons(ObjectGuid guid)
|
||||
return lock;
|
||||
}
|
||||
|
||||
uint8 level = player->getLevel();
|
||||
uint8 level = player->GetLevel();
|
||||
uint8 expansion = player->GetSession()->GetExpansion();
|
||||
LfgDungeonSet const& dungeons = GetDungeonsByRandom(0);
|
||||
bool denyJoin = !player->GetSession()->HasPermission(rbac::RBAC_PERM_JOIN_DUNGEON_FINDER);
|
||||
|
||||
@@ -1289,8 +1289,8 @@ bool Creature::isCanInteractWithBattleMaster(Player* player, bool msg) const
|
||||
|
||||
bool Creature::CanResetTalents(Player* player) const
|
||||
{
|
||||
return player->getLevel() >= 15
|
||||
&& player->getClass() == GetCreatureTemplate()->trainer_class;
|
||||
return player->GetLevel() >= 15
|
||||
&& player->GetClass() == GetCreatureTemplate()->trainer_class;
|
||||
}
|
||||
|
||||
Player* Creature::GetLootRecipient() const
|
||||
@@ -1524,7 +1524,7 @@ void Creature::UpdateLevelDependantStats()
|
||||
{
|
||||
CreatureTemplate const* cInfo = GetCreatureTemplate();
|
||||
uint32 rank = IsPet() ? 0 : cInfo->rank;
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
CreatureBaseStats const* stats = sObjectMgr->GetCreatureBaseStats(level, cInfo->unit_class);
|
||||
|
||||
// health
|
||||
@@ -1542,7 +1542,7 @@ void Creature::UpdateLevelDependantStats()
|
||||
uint32 mana = stats->GenerateMana(cInfo);
|
||||
SetCreateMana(mana);
|
||||
|
||||
switch (getClass())
|
||||
switch (GetClass())
|
||||
{
|
||||
case CLASS_PALADIN:
|
||||
case CLASS_MAGE:
|
||||
@@ -2854,7 +2854,7 @@ float Creature::GetHealthMultiplierForTarget(WorldObject const* target) const
|
||||
return 1.0f;
|
||||
|
||||
uint8 levelForTarget = GetLevelForTarget(target);
|
||||
if (getLevel() < levelForTarget)
|
||||
if (GetLevel() < levelForTarget)
|
||||
return 1.0f;
|
||||
|
||||
return double(GetMaxHealthByLevel(levelForTarget)) / double(GetCreateHealth());
|
||||
@@ -2874,7 +2874,7 @@ float Creature::GetDamageMultiplierForTarget(WorldObject const* target) const
|
||||
|
||||
uint8 levelForTarget = GetLevelForTarget(target);
|
||||
|
||||
return GetBaseDamageForLevel(levelForTarget) / GetBaseDamageForLevel(getLevel());
|
||||
return GetBaseDamageForLevel(levelForTarget) / GetBaseDamageForLevel(GetLevel());
|
||||
}
|
||||
|
||||
float Creature::GetBaseArmorForLevel(uint8 level) const
|
||||
@@ -2892,7 +2892,7 @@ float Creature::GetArmorMultiplierForTarget(WorldObject const* target) const
|
||||
|
||||
uint8 levelForTarget = GetLevelForTarget(target);
|
||||
|
||||
return GetBaseArmorForLevel(levelForTarget) / GetBaseArmorForLevel(getLevel());
|
||||
return GetBaseArmorForLevel(levelForTarget) / GetBaseArmorForLevel(GetLevel());
|
||||
}
|
||||
|
||||
uint8 Creature::GetLevelForTarget(WorldObject const* target) const
|
||||
@@ -2901,7 +2901,7 @@ uint8 Creature::GetLevelForTarget(WorldObject const* target) const
|
||||
{
|
||||
if (isWorldBoss())
|
||||
{
|
||||
uint8 level = unitTarget->getLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
|
||||
uint8 level = unitTarget->GetLevel() + sWorld->getIntConfig(CONFIG_WORLD_BOSS_LEVEL_DIFF);
|
||||
return RoundToInterval<uint8>(level, 1u, 255u);
|
||||
}
|
||||
|
||||
@@ -2915,13 +2915,13 @@ uint8 Creature::GetLevelForTarget(WorldObject const* target) const
|
||||
int32 scalingFactionGroup = m_unitData->ScalingFactionGroup;
|
||||
int32 targetLevel = unitTarget->m_unitData->EffectiveLevel;
|
||||
if (!targetLevel)
|
||||
targetLevel = unitTarget->getLevel();
|
||||
targetLevel = unitTarget->GetLevel();
|
||||
|
||||
int32 targetLevelDelta = 0;
|
||||
|
||||
if (Player const* playerTarget = target->ToPlayer())
|
||||
{
|
||||
if (scalingFactionGroup && sFactionTemplateStore.AssertEntry(sChrRacesStore.AssertEntry(playerTarget->getRace())->FactionID)->FactionGroup != scalingFactionGroup)
|
||||
if (scalingFactionGroup && sFactionTemplateStore.AssertEntry(sChrRacesStore.AssertEntry(playerTarget->GetRace())->FactionID)->FactionGroup != scalingFactionGroup)
|
||||
scalingLevelMin = scalingLevelMax;
|
||||
|
||||
int32 maxCreatureScalingLevel = playerTarget->m_activePlayerData->MaxCreatureScalingLevel;
|
||||
|
||||
@@ -188,7 +188,7 @@ void TempSummon::InitStats(uint32 duration)
|
||||
|
||||
if (owner && IsTrigger() && m_spells[0])
|
||||
{
|
||||
SetLevel(owner->getLevel());
|
||||
SetLevel(owner->GetLevel());
|
||||
if (owner->GetTypeId() == TYPEID_PLAYER)
|
||||
m_ControlledByPlayer = true;
|
||||
}
|
||||
@@ -397,7 +397,7 @@ void Guardian::InitStats(uint32 duration)
|
||||
{
|
||||
Minion::InitStats(duration);
|
||||
|
||||
InitStatsForLevel(GetOwner()->getLevel());
|
||||
InitStatsForLevel(GetOwner()->GetLevel());
|
||||
|
||||
if (GetOwner()->GetTypeId() == TYPEID_PLAYER && HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
|
||||
m_charmInfo->InitCharmCreateSpells();
|
||||
@@ -434,7 +434,7 @@ Puppet::Puppet(SummonPropertiesEntry const* properties, Unit* owner)
|
||||
void Puppet::InitStats(uint32 duration)
|
||||
{
|
||||
Minion::InitStats(duration);
|
||||
SetLevel(GetOwner()->getLevel());
|
||||
SetLevel(GetOwner()->GetLevel());
|
||||
SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Trainer
|
||||
return SpellState::Unavailable;
|
||||
|
||||
// check level requirement
|
||||
if (player->getLevel() < trainerSpell->ReqLevel)
|
||||
if (player->GetLevel() < trainerSpell->ReqLevel)
|
||||
return SpellState::Unavailable;
|
||||
|
||||
// check ranks
|
||||
|
||||
@@ -2054,11 +2054,11 @@ void GameObject::Use(Unit* user)
|
||||
|
||||
//required lvl checks!
|
||||
if (Optional<ContentTuningLevels> userLevels = sDB2Manager.GetContentTuningData(info->ContentTuningId, player->m_playerData->CtrOptions->ContentTuningConditionMask))
|
||||
if (player->getLevel() < userLevels->MaxLevel)
|
||||
if (player->GetLevel() < userLevels->MaxLevel)
|
||||
return;
|
||||
|
||||
if (Optional<ContentTuningLevels> targetLevels = sDB2Manager.GetContentTuningData(info->ContentTuningId, targetPlayer->m_playerData->CtrOptions->ContentTuningConditionMask))
|
||||
if (targetPlayer->getLevel() < targetLevels->MaxLevel)
|
||||
if (targetPlayer->GetLevel() < targetLevels->MaxLevel)
|
||||
return;
|
||||
|
||||
if (info->entry == 194097)
|
||||
|
||||
@@ -75,7 +75,7 @@ void AzeriteEmpoweredItem::LoadAzeriteEmpoweredItemData(Player const* owner, Aze
|
||||
for (int32 i = MAX_AZERITE_EMPOWERED_TIER; --i >= 0; )
|
||||
{
|
||||
int32 selection = azeriteEmpoweredItem.SelectedAzeritePowers[i];
|
||||
if (GetTierForAzeritePower(Classes(owner->getClass()), selection) != i)
|
||||
if (GetTierForAzeritePower(Classes(owner->GetClass()), selection) != i)
|
||||
{
|
||||
needSave = true;
|
||||
break;
|
||||
|
||||
@@ -2181,7 +2181,7 @@ uint32 Item::GetItemLevel(Player const* owner) const
|
||||
uint32 azeriteLevel = 0;
|
||||
if (AzeriteItem const* azeriteItem = ToAzeriteItem())
|
||||
azeriteLevel = azeriteItem->GetEffectiveLevel();
|
||||
return Item::GetItemLevel(itemTemplate, _bonusData, owner->getLevel(), GetModifier(ITEM_MODIFIER_TIMEWALKER_LEVEL),
|
||||
return Item::GetItemLevel(itemTemplate, _bonusData, owner->GetLevel(), GetModifier(ITEM_MODIFIER_TIMEWALKER_LEVEL),
|
||||
minItemLevel, minItemLevelCutoff, maxItemLevel, pvpBonus, azeriteLevel);
|
||||
}
|
||||
|
||||
|
||||
@@ -264,9 +264,9 @@ bool ItemTemplate::IsUsableByLootSpecialization(Player const* player, bool alway
|
||||
return false;
|
||||
|
||||
std::size_t levelIndex = 0;
|
||||
if (player->getLevel() >= 110)
|
||||
if (player->GetLevel() >= 110)
|
||||
levelIndex = 2;
|
||||
else if (player->getLevel() > 40)
|
||||
else if (player->GetLevel() > 40)
|
||||
levelIndex = 1;
|
||||
|
||||
return Specializations[levelIndex].test(CalculateItemSpecBit(chrSpecialization));
|
||||
|
||||
@@ -1909,7 +1909,7 @@ Creature* WorldObject::SummonTrigger(float x, float y, float z, float ang, uint3
|
||||
if (GetTypeId() == TYPEID_PLAYER || GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
summon->SetFaction(((Unit*)this)->GetFaction());
|
||||
summon->SetLevel(((Unit*)this)->getLevel());
|
||||
summon->SetLevel(((Unit*)this)->GetLevel());
|
||||
}
|
||||
|
||||
if (GetAI)
|
||||
|
||||
@@ -221,7 +221,7 @@ bool Pet::LoadPetFromDB(Player* owner, uint32 petEntry, uint32 petnumber, bool c
|
||||
switch (getPetType())
|
||||
{
|
||||
case SUMMON_PET:
|
||||
petlevel = owner->getLevel();
|
||||
petlevel = owner->GetLevel();
|
||||
SetClass(CLASS_MAGE);
|
||||
SetUnitFlags(UNIT_FLAG_PLAYER_CONTROLLED); // this enables popup window (pet dismiss, cancel)
|
||||
break;
|
||||
@@ -464,7 +464,7 @@ void Pet::SavePetToDB(PetSaveMode mode)
|
||||
stmt->setUInt32(1, GetEntry());
|
||||
stmt->setUInt64(2, ownerLowGUID);
|
||||
stmt->setUInt32(3, GetNativeDisplayId());
|
||||
stmt->setUInt8(4, getLevel());
|
||||
stmt->setUInt8(4, GetLevel());
|
||||
stmt->setUInt32(5, m_unitData->PetExperience);
|
||||
stmt->setUInt8(6, GetReactState());
|
||||
stmt->setInt16(7, mode);
|
||||
@@ -654,8 +654,8 @@ void Pet::GivePetXP(uint32 xp)
|
||||
if (!IsAlive())
|
||||
return;
|
||||
|
||||
uint8 maxlevel = std::min((uint8)sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->getLevel());
|
||||
uint8 petlevel = getLevel();
|
||||
uint8 maxlevel = std::min((uint8)sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL), GetOwner()->GetLevel());
|
||||
uint8 petlevel = GetLevel();
|
||||
|
||||
// If pet is detected to be at, or above(?) the players level, don't hand out XP
|
||||
if (petlevel >= maxlevel)
|
||||
@@ -682,7 +682,7 @@ void Pet::GivePetXP(uint32 xp)
|
||||
|
||||
void Pet::GivePetLevel(uint8 level)
|
||||
{
|
||||
if (!level || level == getLevel())
|
||||
if (!level || level == GetLevel())
|
||||
return;
|
||||
|
||||
if (getPetType() == HUNTER_PET)
|
||||
@@ -749,7 +749,7 @@ bool Pet::CreateBaseAtTamed(CreatureTemplate const* cinfo, Map* map)
|
||||
|
||||
SetPetNameTimestamp(0);
|
||||
SetPetExperience(0);
|
||||
SetPetNextLevelExperience(uint32(sObjectMgr->GetXPForLevel(getLevel() + 1) * PET_XP_FACTOR));
|
||||
SetPetNextLevelExperience(uint32(sObjectMgr->GetXPForLevel(GetLevel() + 1) * PET_XP_FACTOR));
|
||||
SetNpcFlags(UNIT_NPC_FLAG_NONE);
|
||||
SetNpcFlags2(UNIT_NPC_FLAG_2_NONE);
|
||||
|
||||
@@ -777,13 +777,13 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
PetType petType = MAX_PET_TYPE;
|
||||
if (IsPet() && GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (GetOwner()->getClass() == CLASS_WARLOCK
|
||||
|| GetOwner()->getClass() == CLASS_SHAMAN // Fire Elemental
|
||||
|| GetOwner()->getClass() == CLASS_DEATH_KNIGHT) // Risen Ghoul
|
||||
if (GetOwner()->GetClass() == CLASS_WARLOCK
|
||||
|| GetOwner()->GetClass() == CLASS_SHAMAN // Fire Elemental
|
||||
|| GetOwner()->GetClass() == CLASS_DEATH_KNIGHT) // Risen Ghoul
|
||||
{
|
||||
petType = SUMMON_PET;
|
||||
}
|
||||
else if (GetOwner()->getClass() == CLASS_HUNTER)
|
||||
else if (GetOwner()->GetClass() == CLASS_HUNTER)
|
||||
{
|
||||
petType = HUNTER_PET;
|
||||
m_unitTypeMask |= UNIT_MASK_HUNTER_PET;
|
||||
@@ -791,7 +791,7 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
else
|
||||
{
|
||||
TC_LOG_ERROR("entities.pet", "Unknown type pet %u is summoned by player class %u",
|
||||
GetEntry(), GetOwner()->getClass());
|
||||
GetEntry(), GetOwner()->GetClass());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -810,12 +810,12 @@ bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
if (cFamily && cFamily->MinScale > 0.0f && petType == HUNTER_PET)
|
||||
{
|
||||
float scale;
|
||||
if (getLevel() >= cFamily->MaxScaleLevel)
|
||||
if (GetLevel() >= cFamily->MaxScaleLevel)
|
||||
scale = cFamily->MaxScale;
|
||||
else if (getLevel() <= cFamily->MinScaleLevel)
|
||||
else if (GetLevel() <= cFamily->MinScaleLevel)
|
||||
scale = cFamily->MinScale;
|
||||
else
|
||||
scale = cFamily->MinScale + float(getLevel() - cFamily->MinScaleLevel) / cFamily->MaxScaleLevel * (cFamily->MaxScale - cFamily->MinScale);
|
||||
scale = cFamily->MinScale + float(GetLevel() - cFamily->MinScaleLevel) / cFamily->MaxScaleLevel * (cFamily->MaxScale - cFamily->MinScale);
|
||||
|
||||
SetObjectScale(scale);
|
||||
}
|
||||
@@ -1431,7 +1431,7 @@ void Pet::learnSpells(std::vector<uint32> const& spellIds)
|
||||
|
||||
void Pet::InitLevelupSpellsForLevel()
|
||||
{
|
||||
uint8 level = getLevel();
|
||||
uint8 level = GetLevel();
|
||||
|
||||
if (PetLevelupSpellSet const* levelupSpells = GetCreatureTemplate()->family ? sSpellMgr->GetPetLevelupSpellList(GetCreatureTemplate()->family) : nullptr)
|
||||
{
|
||||
@@ -1606,7 +1606,7 @@ bool Pet::IsPermanentPetFor(Player* owner) const
|
||||
switch (getPetType())
|
||||
{
|
||||
case SUMMON_PET:
|
||||
switch (owner->getClass())
|
||||
switch (owner->GetClass())
|
||||
{
|
||||
case CLASS_WARLOCK:
|
||||
return GetCreatureTemplate()->type == CREATURE_TYPE_DEMON;
|
||||
@@ -1738,7 +1738,7 @@ void Pet::SynchronizeLevelWithOwner()
|
||||
// always same level
|
||||
case SUMMON_PET:
|
||||
case HUNTER_PET:
|
||||
GivePetLevel(owner->getLevel());
|
||||
GivePetLevel(owner->GetLevel());
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1786,7 +1786,7 @@ void Pet::LearnSpecializationSpells()
|
||||
{
|
||||
SpecializationSpellsEntry const* specSpell = specSpells->at(j);
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(specSpell->SpellID, DIFFICULTY_NONE);
|
||||
if (!spellInfo || spellInfo->SpellLevel > getLevel())
|
||||
if (!spellInfo || spellInfo->SpellLevel > GetLevel())
|
||||
continue;
|
||||
|
||||
learnedSpells.push_back(specSpell->SpellID);
|
||||
|
||||
@@ -754,7 +754,7 @@ bool CollectionMgr::CanAddAppearance(ItemModifiedAppearanceEntry const* itemModi
|
||||
return false;
|
||||
}
|
||||
if (itemTemplate->GetInventoryType() != INVTYPE_CLOAK)
|
||||
if (!(PlayerClassByArmorSubclass[itemTemplate->GetSubClass()] & _owner->GetPlayer()->getClassMask()))
|
||||
if (!(PlayerClassByArmorSubclass[itemTemplate->GetSubClass()] & _owner->GetPlayer()->GetClassMask()))
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ inline void KillRewarder::_InitGroupData()
|
||||
if (Player* member = itr->GetSource())
|
||||
if (_killer == member || (member->IsAtGroupRewardDistance(_victim) && member->IsAlive()))
|
||||
{
|
||||
const uint8 lvl = member->getLevel();
|
||||
const uint8 lvl = member->GetLevel();
|
||||
// 2.1. _count - number of alive group members within reward distance;
|
||||
++_count;
|
||||
// 2.2. _sumLevel - sum of levels of alive group members within reward distance;
|
||||
@@ -107,12 +107,12 @@ inline void KillRewarder::_InitGroupData()
|
||||
// 2.4. _maxNotGrayMember - maximum level of alive group member within reward distance,
|
||||
// for whom victim is not gray;
|
||||
uint32 grayLevel = Trinity::XP::GetGrayLevel(lvl);
|
||||
if (_victim->GetLevelForTarget(member) > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->getLevel() < lvl))
|
||||
if (_victim->GetLevelForTarget(member) > grayLevel && (!_maxNotGrayMember || _maxNotGrayMember->GetLevel() < lvl))
|
||||
_maxNotGrayMember = member;
|
||||
}
|
||||
// 2.5. _isFullXP - flag identifying that for all group members victim is not gray,
|
||||
// so 100% XP will be rewarded (50% otherwise).
|
||||
_isFullXP = _maxNotGrayMember && (_maxLevel == _maxNotGrayMember->getLevel());
|
||||
_isFullXP = _maxNotGrayMember && (_maxLevel == _maxNotGrayMember->GetLevel());
|
||||
}
|
||||
else
|
||||
_count = 1;
|
||||
@@ -145,7 +145,7 @@ inline void KillRewarder::_RewardXP(Player* player, float rate)
|
||||
// * set to 0 if player's level is more than maximum level of not gray member;
|
||||
// * cut XP in half if _isFullXP is false.
|
||||
if (_maxNotGrayMember && player->IsAlive() &&
|
||||
_maxNotGrayMember->getLevel() >= player->getLevel())
|
||||
_maxNotGrayMember->GetLevel() >= player->GetLevel())
|
||||
xp = _isFullXP ?
|
||||
uint32(xp * rate) : // Reward FULL XP if all group members are not gray.
|
||||
uint32(xp * rate / 2) + 1; // Reward only HALF of XP if some of group members are gray.
|
||||
@@ -200,7 +200,7 @@ void KillRewarder::_RewardPlayer(Player* player, bool isDungeon)
|
||||
if (!_isPvP || _isBattleGround)
|
||||
{
|
||||
float const rate = _group ?
|
||||
_groupRate * float(player->getLevel()) / _sumLevel : // Group rate depends on summary level.
|
||||
_groupRate * float(player->GetLevel()) / _sumLevel : // Group rate depends on summary level.
|
||||
1.0f; // Personal rate is 100%.
|
||||
if (_xp)
|
||||
// 4.2. Give XP.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1149,7 +1149,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
|
||||
void RemoveSocial();
|
||||
|
||||
PlayerTaxi m_taxi;
|
||||
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(getRace(), getClass(), getLevel()); }
|
||||
void InitTaxiNodesForLevel() { m_taxi.InitTaxiNodesForLevel(GetRace(), GetClass(), GetLevel()); }
|
||||
bool ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc = nullptr, uint32 spellid = 0, uint32 preferredMountDisplay = 0);
|
||||
bool ActivateTaxiPathTo(uint32 taxi_path_id, uint32 spellid = 0);
|
||||
void FinishTaxiFlight();
|
||||
|
||||
@@ -38,7 +38,7 @@ void RestMgr::SetRestBonus(RestTypes restType, float restBonus)
|
||||
{
|
||||
case REST_TYPE_XP:
|
||||
// Reset restBonus (XP only) for max level players
|
||||
if (_player->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (_player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
restBonus = 0;
|
||||
|
||||
next_level_xp = _player->m_activePlayerData->NextLevelXP;
|
||||
@@ -87,7 +87,7 @@ void RestMgr::SetRestBonus(RestTypes restType, float restBonus)
|
||||
void RestMgr::AddRestBonus(RestTypes restType, float restBonus)
|
||||
{
|
||||
// Don't add extra rest bonus to max level players. Note: Might need different condition in next expansion for honor XP (PLAYER_LEVEL_MIN_HONOR perhaps).
|
||||
if (_player->getLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
if (_player->GetLevel() >= sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
||||
restBonus = 0;
|
||||
|
||||
float totalRestBonus = GetRestBonus(restType) + restBonus;
|
||||
|
||||
@@ -241,8 +241,8 @@ void SocialMgr::GetFriendInfo(Player* player, ObjectGuid const& friendGUID, Frie
|
||||
}
|
||||
|
||||
friendInfo.Area = target->GetZoneId();
|
||||
friendInfo.Level = target->getLevel();
|
||||
friendInfo.Class = target->getClass();
|
||||
friendInfo.Level = target->GetLevel();
|
||||
friendInfo.Class = target->GetClass();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void Totem::InitStats(uint32 duration)
|
||||
}
|
||||
|
||||
// set display id depending on caster's race
|
||||
if (uint32 totemDisplayId = sSpellMgr->GetModelForTotem(m_unitData->CreatedBySpell, owner->getRace()))
|
||||
if (uint32 totemDisplayId = sSpellMgr->GetModelForTotem(m_unitData->CreatedBySpell, owner->GetRace()))
|
||||
SetDisplayId(totemDisplayId);
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ void Totem::InitStats(uint32 duration)
|
||||
|
||||
m_duration = duration;
|
||||
|
||||
SetLevel(GetOwner()->getLevel());
|
||||
SetLevel(GetOwner()->GetLevel());
|
||||
}
|
||||
|
||||
void Totem::InitSummon()
|
||||
|
||||
@@ -268,7 +268,7 @@ float Player::GetHealthBonusFromStamina() const
|
||||
{
|
||||
// Taken from PaperDollFrame.lua - 6.0.3.19085
|
||||
float ratio = 10.0f;
|
||||
if (GtHpPerStaEntry const* hpBase = sHpPerStaGameTable.GetRow(getLevel()))
|
||||
if (GtHpPerStaEntry const* hpBase = sHpPerStaGameTable.GetRow(GetLevel()))
|
||||
ratio = hpBase->Health;
|
||||
|
||||
float stamina = GetStat(STAT_STAMINA);
|
||||
@@ -283,7 +283,7 @@ Stats Player::GetPrimaryStat() const
|
||||
if (ChrSpecializationEntry const* specialization = sChrSpecializationStore.LookupEntry(GetPrimarySpecialization()))
|
||||
return specialization->PrimaryStatPriority;
|
||||
|
||||
return sChrClassesStore.AssertEntry(getClass())->PrimaryStatPriority;
|
||||
return sChrClassesStore.AssertEntry(GetClass())->PrimaryStatPriority;
|
||||
}();
|
||||
|
||||
if (primaryStatPriority >= 4)
|
||||
@@ -309,7 +309,7 @@ void Player::UpdateMaxHealth()
|
||||
|
||||
uint32 Player::GetPowerIndex(Powers power) const
|
||||
{
|
||||
return sDB2Manager.GetPowerIndexByClass(power, getClass());
|
||||
return sDB2Manager.GetPowerIndexByClass(power, GetClass());
|
||||
}
|
||||
|
||||
void Player::UpdateMaxPower(Powers power)
|
||||
@@ -331,9 +331,9 @@ void Player::UpdateMaxPower(Powers power)
|
||||
void Player::UpdateAttackPowerAndDamage(bool ranged)
|
||||
{
|
||||
float val2 = 0.0f;
|
||||
float level = float(getLevel());
|
||||
float level = float(GetLevel());
|
||||
|
||||
ChrClassesEntry const* entry = sChrClassesStore.AssertEntry(getClass());
|
||||
ChrClassesEntry const* entry = sChrClassesStore.AssertEntry(GetClass());
|
||||
UnitMods unitMod = ranged ? UNIT_MOD_ATTACK_POWER_RANGED : UNIT_MOD_ATTACK_POWER;
|
||||
|
||||
if (!HasAuraType(SPELL_AURA_OVERRIDE_ATTACK_POWER_BY_SP_PCT))
|
||||
@@ -562,7 +562,7 @@ void Player::UpdateVersatilityDamageDone()
|
||||
// No proof that CR_VERSATILITY_DAMAGE_DONE is allways = ActivePlayerData::Versatility
|
||||
SetUpdateFieldValue(m_values.ModifyValue(&Player::m_activePlayerData).ModifyValue(&UF::ActivePlayerData::Versatility), m_activePlayerData->CombatRatings[CR_VERSATILITY_DAMAGE_DONE]);
|
||||
|
||||
if (getClass() == CLASS_HUNTER)
|
||||
if (GetClass() == CLASS_HUNTER)
|
||||
UpdateDamagePhysical(RANGED_ATTACK);
|
||||
else
|
||||
UpdateDamagePhysical(BASE_ATTACK);
|
||||
@@ -640,7 +640,7 @@ void Player::UpdateParryPercentage()
|
||||
{
|
||||
// No parry
|
||||
float value = 0.0f;
|
||||
uint32 pclass = getClass() - 1;
|
||||
uint32 pclass = GetClass() - 1;
|
||||
if (CanParry() && parry_cap[pclass] > 0.0f)
|
||||
{
|
||||
float nondiminishing = 5.0f;
|
||||
@@ -650,7 +650,7 @@ void Player::UpdateParryPercentage()
|
||||
nondiminishing += GetTotalAuraModifier(SPELL_AURA_MOD_PARRY_PERCENT);
|
||||
|
||||
// apply diminishing formula to diminishing parry chance
|
||||
value = CalculateDiminishingReturns(parry_cap, getClass(), nondiminishing, diminishing);
|
||||
value = CalculateDiminishingReturns(parry_cap, GetClass(), nondiminishing, diminishing);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_PARRY) : value;
|
||||
@@ -685,7 +685,7 @@ void Player::UpdateDodgePercentage()
|
||||
diminishing += GetRatingBonusValue(CR_DODGE);
|
||||
|
||||
// apply diminishing formula to diminishing dodge chance
|
||||
float value = CalculateDiminishingReturns(dodge_cap, getClass(), nondiminishing, diminishing);
|
||||
float value = CalculateDiminishingReturns(dodge_cap, GetClass(), nondiminishing, diminishing);
|
||||
|
||||
if (sWorld->getBoolConfig(CONFIG_STATS_LIMITS_ENABLE))
|
||||
value = value > sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) ? sWorld->getFloatConfig(CONFIG_STATS_LIMITS_DODGE) : value;
|
||||
@@ -804,7 +804,7 @@ void Player::UpdateManaRegen()
|
||||
|
||||
// Get base of Mana Pool in sBaseMPGameTable
|
||||
uint32 basemana = 0;
|
||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), getLevel(), basemana);
|
||||
sObjectMgr->GetPlayerClassLevelInfo(GetClass(), GetLevel(), basemana);
|
||||
float base_regen = basemana / 100.f;
|
||||
|
||||
base_regen += GetTotalAuraModifierByMiscValue(SPELL_AURA_MOD_POWER_REGEN, POWER_MANA);
|
||||
@@ -821,7 +821,7 @@ void Player::UpdateManaRegen()
|
||||
|
||||
void Player::UpdateAllRunesRegen()
|
||||
{
|
||||
if (getClass() != CLASS_DEATH_KNIGHT)
|
||||
if (GetClass() != CLASS_DEATH_KNIGHT)
|
||||
return;
|
||||
|
||||
uint32 runeIndex = GetPowerIndex(POWER_RUNES);
|
||||
@@ -1047,7 +1047,7 @@ bool Guardian::UpdateStats(Stats stat)
|
||||
//warlock's and mage's pets gain 30% of owner's intellect
|
||||
else if (stat == STAT_INTELLECT)
|
||||
{
|
||||
if (owner->getClass() == CLASS_WARLOCK || owner->getClass() == CLASS_MAGE)
|
||||
if (owner->GetClass() == CLASS_WARLOCK || owner->GetClass() == CLASS_MAGE)
|
||||
{
|
||||
ownersBonus = CalculatePct(owner->GetStat(stat), 30);
|
||||
value += ownersBonus;
|
||||
|
||||
@@ -1075,7 +1075,7 @@ void Unit::CalculateSpellDamageTaken(SpellNonMeleeDamage* damageInfo, int32 dama
|
||||
if (blocked)
|
||||
{
|
||||
// double blocked amount if block is critical
|
||||
uint32 value = victim->GetBlockPercent(getLevel());
|
||||
uint32 value = victim->GetBlockPercent(GetLevel());
|
||||
if (victim->isBlockCritical())
|
||||
value *= 2; // double blocked percent
|
||||
damageInfo->blocked = CalculatePct(damage, value);
|
||||
@@ -1290,7 +1290,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, Weapon
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
damageInfo->HitInfo |= HITINFO_BLOCK;
|
||||
// 30% damage blocked, double blocked amount if block is critical
|
||||
damageInfo->Blocked = CalculatePct(damageInfo->Damage, damageInfo->Target->GetBlockPercent(getLevel()));
|
||||
damageInfo->Blocked = CalculatePct(damageInfo->Damage, damageInfo->Target->GetBlockPercent(GetLevel()));
|
||||
if (damageInfo->Target->isBlockCritical())
|
||||
damageInfo->Blocked *= 2;
|
||||
|
||||
@@ -1302,7 +1302,7 @@ void Unit::CalculateMeleeDamage(Unit* victim, CalcDamageInfo* damageInfo, Weapon
|
||||
{
|
||||
damageInfo->HitInfo |= HITINFO_GLANCING;
|
||||
damageInfo->TargetState = VICTIMSTATE_HIT;
|
||||
int32 leveldif = int32(victim->getLevel()) - int32(getLevel());
|
||||
int32 leveldif = int32(victim->GetLevel()) - int32(GetLevel());
|
||||
if (leveldif > 3)
|
||||
leveldif = 3;
|
||||
|
||||
@@ -1410,7 +1410,7 @@ void Unit::DealMeleeDamage(CalcDamageInfo* damageInfo, bool durabilityLoss)
|
||||
float chance = 20.0f;
|
||||
|
||||
// there is a newbie protection, at level 10 just 7% base chance; assuming linear function
|
||||
if (victim->getLevel() < 30)
|
||||
if (victim->GetLevel() < 30)
|
||||
chance = 0.65f * victim->GetLevelForTarget(this) + 0.5f;
|
||||
|
||||
uint32 const victimDefense = victim->GetMaxSkillValueForLevel(this);
|
||||
@@ -1568,7 +1568,7 @@ void Unit::HandleEmoteCommand(uint32 anim_id, Player* target /*=nullptr*/, Trini
|
||||
if (attacker)
|
||||
{
|
||||
attackerLevel = attacker->GetLevelForTarget(victim);
|
||||
attackerClass = Classes(attacker->getClass());
|
||||
attackerClass = Classes(attacker->GetClass());
|
||||
}
|
||||
|
||||
// Expansion and ContentTuningID necessary? Does Player get a ContentTuningID too ?
|
||||
@@ -1678,7 +1678,7 @@ void Unit::HandleEmoteCommand(uint32 anim_id, Player* target /*=nullptr*/, Trini
|
||||
|
||||
static uint32 const bossLevel = 83;
|
||||
static float const bossResistanceConstant = 510.0f;
|
||||
uint32 level = caster ? victim->GetLevelForTarget(caster) : victim->getLevel();
|
||||
uint32 level = caster ? victim->GetLevelForTarget(caster) : victim->GetLevel();
|
||||
float resistanceConstant = 0.0f;
|
||||
|
||||
if (level == bossLevel)
|
||||
@@ -5282,7 +5282,7 @@ void Unit::UpdateDisplayPower()
|
||||
}
|
||||
else if (GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(getClass());
|
||||
ChrClassesEntry const* cEntry = sChrClassesStore.LookupEntry(GetClass());
|
||||
if (cEntry && cEntry->DisplayPower < MAX_POWERS)
|
||||
displayPower = Powers(cEntry->DisplayPower);
|
||||
}
|
||||
@@ -5292,7 +5292,7 @@ void Unit::UpdateDisplayPower()
|
||||
{
|
||||
if (PowerDisplayEntry const* powerDisplay = sPowerDisplayStore.LookupEntry(vehicle->GetVehicleInfo()->PowerDisplayID[0]))
|
||||
displayPower = Powers(powerDisplay->ActualType);
|
||||
else if (getClass() == CLASS_ROGUE)
|
||||
else if (GetClass() == CLASS_ROGUE)
|
||||
displayPower = POWER_ENERGY;
|
||||
}
|
||||
else if (Pet* pet = ToPet())
|
||||
@@ -6667,7 +6667,7 @@ float Unit::SpellCritChanceTaken(Unit const* caster, Spell* spell, AuraEffect co
|
||||
// Spell crit suppression
|
||||
if (GetTypeId() == TYPEID_UNIT)
|
||||
{
|
||||
int32 const levelDiff = static_cast<int32>(GetLevelForTarget(caster)) - caster->getLevel();
|
||||
int32 const levelDiff = static_cast<int32>(GetLevelForTarget(caster)) - caster->GetLevel();
|
||||
crit_chance -= levelDiff * 1.0f;
|
||||
}
|
||||
}
|
||||
@@ -9581,7 +9581,7 @@ void Unit::ProcSkillsAndReactives(bool isVictim, Unit* procTarget, uint32 typeMa
|
||||
if (hitMask & PROC_HIT_DODGE)
|
||||
{
|
||||
// Update AURA_STATE on dodge
|
||||
if (getClass() != CLASS_ROGUE) // skip Rogue Riposte
|
||||
if (GetClass() != CLASS_ROGUE) // skip Rogue Riposte
|
||||
{
|
||||
ModifyAuraState(AURA_STATE_DEFENSIVE, true);
|
||||
StartReactiveTimer(REACTIVE_DEFENSE);
|
||||
@@ -10170,7 +10170,7 @@ Pet* Unit::CreateTamedPetFrom(Creature* creatureTarget, uint32 spell_id)
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
uint8 level = creatureTarget->GetLevelForTarget(this) + 5 < getLevel() ? (getLevel() - 5) : creatureTarget->GetLevelForTarget(this);
|
||||
uint8 level = creatureTarget->GetLevelForTarget(this) + 5 < GetLevel() ? (GetLevel() - 5) : creatureTarget->GetLevelForTarget(this);
|
||||
|
||||
InitTamedPet(pet, level, spell_id);
|
||||
|
||||
@@ -10188,7 +10188,7 @@ Pet* Unit::CreateTamedPetFrom(uint32 creatureEntry, uint32 spell_id)
|
||||
|
||||
Pet* pet = new Pet(ToPlayer(), HUNTER_PET);
|
||||
|
||||
if (!pet->CreateBaseAtCreatureInfo(creatureInfo, this) || !InitTamedPet(pet, getLevel(), spell_id))
|
||||
if (!pet->CreateBaseAtCreatureInfo(creatureInfo, this) || !InitTamedPet(pet, GetLevel(), spell_id))
|
||||
{
|
||||
delete pet;
|
||||
return nullptr;
|
||||
@@ -10932,7 +10932,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
AddUnitState(UNIT_STATE_POSSESSED);
|
||||
break;
|
||||
case CHARM_TYPE_CHARM:
|
||||
if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK)
|
||||
if (GetTypeId() == TYPEID_UNIT && charmer->GetClass() == CLASS_WARLOCK)
|
||||
{
|
||||
CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate();
|
||||
if (cinfo && cinfo->type == CREATURE_TYPE_DEMON)
|
||||
@@ -11030,7 +11030,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
RemoveUnitFlag(UNIT_FLAG_POSSESSED);
|
||||
break;
|
||||
case CHARM_TYPE_CHARM:
|
||||
if (GetTypeId() == TYPEID_UNIT && charmer->getClass() == CLASS_WARLOCK)
|
||||
if (GetTypeId() == TYPEID_UNIT && charmer->GetClass() == CLASS_WARLOCK)
|
||||
{
|
||||
CreatureTemplate const* cinfo = ToCreature()->GetCreatureTemplate();
|
||||
if (cinfo && cinfo->type == CREATURE_TYPE_DEMON)
|
||||
@@ -11073,7 +11073,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
void Unit::RestoreFaction()
|
||||
{
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
ToPlayer()->setFactionForRace(getRace());
|
||||
ToPlayer()->setFactionForRace(GetRace());
|
||||
else
|
||||
{
|
||||
if (HasUnitTypeMask(UNIT_MASK_MINION))
|
||||
@@ -11499,7 +11499,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const
|
||||
if (ShapeshiftForm(artifactAppearance->OverrideShapeshiftFormID) == form)
|
||||
return artifactAppearance->OverrideShapeshiftDisplayID;
|
||||
|
||||
if (ShapeshiftFormModelData const* formModelData = sDB2Manager.GetShapeshiftFormModelData(getRace(), thisPlayer->GetNativeSex(), form))
|
||||
if (ShapeshiftFormModelData const* formModelData = sDB2Manager.GetShapeshiftFormModelData(GetRace(), thisPlayer->GetNativeSex(), form))
|
||||
{
|
||||
bool useRandom = false;
|
||||
switch (form)
|
||||
@@ -11524,7 +11524,7 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const
|
||||
if (ChrCustomizationDisplayInfoEntry const* displayInfo = formModelData->Displays[i])
|
||||
{
|
||||
ChrCustomizationReqEntry const* choiceReq = sChrCustomizationReqStore.LookupEntry((*formModelData->Choices)[i]->ChrCustomizationReqID);
|
||||
if (!choiceReq || thisPlayer->GetSession()->MeetsChrCustomizationReq(choiceReq, Classes(getClass()), false,
|
||||
if (!choiceReq || thisPlayer->GetSession()->MeetsChrCustomizationReq(choiceReq, Classes(GetClass()), false,
|
||||
MakeChrCustomizationChoiceRange(thisPlayer->m_playerData->Customizations)))
|
||||
displayIds.push_back(displayInfo->DisplayID);
|
||||
}
|
||||
@@ -11569,13 +11569,13 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const
|
||||
return formEntry->CreatureDisplayID[0];
|
||||
else
|
||||
{
|
||||
if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
if (Player::TeamForRace(GetRace()) == ALLIANCE)
|
||||
modelid = formEntry->CreatureDisplayID[0];
|
||||
else
|
||||
modelid = formEntry->CreatureDisplayID[1];
|
||||
|
||||
// If the player is horde but there are no values for the horde modelid - take the alliance modelid
|
||||
if (!modelid && Player::TeamForRace(getRace()) == HORDE)
|
||||
if (!modelid && Player::TeamForRace(GetRace()) == HORDE)
|
||||
modelid = formEntry->CreatureDisplayID[0];
|
||||
}
|
||||
}
|
||||
@@ -13029,7 +13029,7 @@ void Unit::Talk(uint32 textId, ChatMsg msgType, float textRange, WorldObject con
|
||||
return;
|
||||
}
|
||||
|
||||
Trinity::BroadcastTextBuilder builder(this, msgType, textId, getGender(), target);
|
||||
Trinity::BroadcastTextBuilder builder(this, msgType, textId, GetGender(), target);
|
||||
Trinity::LocalizedDo<Trinity::BroadcastTextBuilder> localizer(builder);
|
||||
Trinity::PlayerDistWorker<Trinity::LocalizedDo<Trinity::BroadcastTextBuilder> > worker(this, textRange, localizer);
|
||||
Cell::VisitWorldObjects(this, worker, textRange);
|
||||
@@ -13064,7 +13064,7 @@ void Unit::Whisper(uint32 textId, Player* target, bool isBossWhisper /*= false*/
|
||||
|
||||
LocaleConstant locale = target->GetSession()->GetSessionDbLocaleIndex();
|
||||
WorldPackets::Chat::Chat packet;
|
||||
packet.Initialize(isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, DB2Manager::GetBroadcastTextValue(bct, locale, getGender()), 0, "", locale);
|
||||
packet.Initialize(isBossWhisper ? CHAT_MSG_RAID_BOSS_WHISPER : CHAT_MSG_MONSTER_WHISPER, LANG_UNIVERSAL, this, target, DB2Manager::GetBroadcastTextValue(bct, locale, GetGender()), 0, "", locale);
|
||||
target->SendDirectMessage(packet.Write());
|
||||
}
|
||||
|
||||
@@ -13149,6 +13149,6 @@ std::string Unit::GetDebugInfo() const
|
||||
<< std::boolalpha
|
||||
<< "IsAIEnabled: " << IsAIEnabled() << " DeathState: " << std::to_string(getDeathState())
|
||||
<< " UnitMovementFlags: " << GetUnitMovementFlags() << " ExtraUnitMovementFlags: " << GetExtraUnitMovementFlags()
|
||||
<< " Class: " << std::to_string(getClass());
|
||||
<< " Class: " << std::to_string(GetClass());
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
@@ -851,16 +851,16 @@ class TC_GAME_API Unit : public WorldObject
|
||||
bool IsTotem() const { return (m_unitTypeMask & UNIT_MASK_TOTEM) != 0; }
|
||||
bool IsVehicle() const { return (m_unitTypeMask & UNIT_MASK_VEHICLE) != 0; }
|
||||
|
||||
uint8 getLevel() const { return uint8(m_unitData->Level); }
|
||||
uint8 GetLevelForTarget(WorldObject const* /*target*/) const override { return getLevel(); }
|
||||
uint8 GetLevel() const { return uint8(m_unitData->Level); }
|
||||
uint8 GetLevelForTarget(WorldObject const* /*target*/) const override { return GetLevel(); }
|
||||
void SetLevel(uint8 lvl);
|
||||
uint8 getRace() const { return m_unitData->Race; }
|
||||
uint8 GetRace() const { return m_unitData->Race; }
|
||||
void SetRace(uint8 race) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Race), race); }
|
||||
uint64 getRaceMask() const { return UI64LIT(1) << (getRace() - 1); }
|
||||
uint8 getClass() const { return m_unitData->ClassId; }
|
||||
uint64 GetRaceMask() const { return UI64LIT(1) << (GetRace() - 1); }
|
||||
uint8 GetClass() const { return m_unitData->ClassId; }
|
||||
void SetClass(uint8 classId) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::ClassId), classId); }
|
||||
uint32 getClassMask() const { return 1 << (getClass()-1); }
|
||||
uint8 getGender() const { return m_unitData->Sex; }
|
||||
uint32 GetClassMask() const { return 1 << (GetClass()-1); }
|
||||
uint8 GetGender() const { return m_unitData->Sex; }
|
||||
void SetGender(uint8 sex) { SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Sex), sex); }
|
||||
|
||||
float GetStat(Stats stat) const { return float(m_unitData->Stats[stat]); }
|
||||
@@ -1011,7 +1011,7 @@ class TC_GAME_API Unit : public WorldObject
|
||||
void SetMeleeAnimKitId(uint16 animKitId);
|
||||
uint16 GetMeleeAnimKitId() const override { return _meleeAnimKitId; }
|
||||
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? GetLevelForTarget(target) : getLevel()) * 5; }
|
||||
uint16 GetMaxSkillValueForLevel(Unit const* target = nullptr) const { return (target ? GetLevelForTarget(target) : GetLevel()) * 5; }
|
||||
static void DealDamageMods(Unit const* attacker, Unit const* victim, uint32& damage, uint32* absorb);
|
||||
static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = nullptr, bool durabilityLoss = true);
|
||||
static void Kill(Unit* attacker, Unit* victim, bool durabilityLoss = true, bool skipSettingDeathState = false);
|
||||
|
||||
@@ -452,7 +452,7 @@ bool Group::AddMember(Player* player)
|
||||
MemberSlot member;
|
||||
member.guid = player->GetGUID();
|
||||
member.name = player->GetName();
|
||||
member._class = player->getClass();
|
||||
member._class = player->GetClass();
|
||||
member.group = subGroup;
|
||||
member.flags = 0;
|
||||
member.roles = 0;
|
||||
@@ -1591,7 +1591,7 @@ void Group::SendUpdateToPlayer(ObjectGuid playerGUID, MemberSlot* slot)
|
||||
partyUpdate.LfgInfos->MyPartialClear = 0;
|
||||
partyUpdate.LfgInfos->MyGearDiff = 0.0f;
|
||||
partyUpdate.LfgInfos->MyFirstReward = false;
|
||||
if (lfg::LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(partyUpdate.LfgInfos->MyRandomSlot, player->getLevel()))
|
||||
if (lfg::LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(partyUpdate.LfgInfos->MyRandomSlot, player->GetLevel()))
|
||||
if (Quest const* quest = sObjectMgr->GetQuestTemplate(reward->firstQuest))
|
||||
partyUpdate.LfgInfos->MyFirstReward = player->CanRewardQuest(quest, false);
|
||||
|
||||
@@ -1885,7 +1885,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
if (!reference)
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->getLevel());
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bgOrTemplate->GetMapId(), reference->GetLevel());
|
||||
if (!bracketEntry)
|
||||
return ERR_BATTLEGROUND_JOIN_FAILED;
|
||||
|
||||
@@ -1907,7 +1907,7 @@ GroupJoinBattlegroundResult Group::CanJoinBattlegroundQueue(Battleground const*
|
||||
return ERR_BATTLEGROUND_JOIN_TIMED_OUT;
|
||||
}
|
||||
// not in the same battleground level braket, don't let join
|
||||
PVPDifficultyEntry const* memberBracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bracketEntry->MapID, member->getLevel());
|
||||
PVPDifficultyEntry const* memberBracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bracketEntry->MapID, member->GetLevel());
|
||||
if (memberBracketEntry != bracketEntry)
|
||||
return ERR_BATTLEGROUND_JOIN_RANGE_INDEX;
|
||||
// don't let join rated matches if the arena team id doesn't match
|
||||
@@ -1980,7 +1980,7 @@ ItemDisenchantLootEntry const* Roll::GetItemDisenchantLoot(Player const* player)
|
||||
return nullptr;
|
||||
|
||||
ItemTemplate const* itemTemplate = sObjectMgr->GetItemTemplate(itemid);
|
||||
uint32 itemLevel = Item::GetItemLevel(itemTemplate, bonusData, player->getLevel(), 0, 0, 0, 0, false, 0);
|
||||
uint32 itemLevel = Item::GetItemLevel(itemTemplate, bonusData, player->GetLevel(), 0, 0, 0, 0, false, 0);
|
||||
return Item::GetDisenchantLoot(itemTemplate, bonusData.Quality, itemLevel);
|
||||
}
|
||||
|
||||
|
||||
@@ -535,8 +535,8 @@ Guild::Member::Member(ObjectGuid::LowType guildId, ObjectGuid guid, uint8 rankId
|
||||
void Guild::Member::SetStats(Player* player)
|
||||
{
|
||||
m_name = player->GetName();
|
||||
m_level = player->getLevel();
|
||||
m_class = player->getClass();
|
||||
m_level = player->GetLevel();
|
||||
m_class = player->GetClass();
|
||||
_gender = player->GetNativeSex();
|
||||
m_zoneId = player->GetZoneId();
|
||||
m_accountId = player->GetSession()->GetAccountId();
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
void WorldSession::HandleAdventureJournalOpenQuest(WorldPackets::AdventureJournal::AdventureJournalOpenQuest& openQuest)
|
||||
{
|
||||
if (ChrClassUIDisplayEntry const* uiDisplay = sDB2Manager.GetUiDisplayForClass(Classes(_player->getClass())))
|
||||
if (ChrClassUIDisplayEntry const* uiDisplay = sDB2Manager.GetUiDisplayForClass(Classes(_player->GetClass())))
|
||||
if (!_player->MeetPlayerCondition(uiDisplay->AdvGuidePlayerConditionID))
|
||||
return;
|
||||
|
||||
@@ -45,7 +45,7 @@ void WorldSession::HandleAdventureJournalOpenQuest(WorldPackets::AdventureJourna
|
||||
|
||||
void WorldSession::HandleAdventureJournalUpdateSuggestions(WorldPackets::AdventureJournal::AdventureJournalUpdateSuggestions& updateSuggestions)
|
||||
{
|
||||
if (ChrClassUIDisplayEntry const* uiDisplay = sDB2Manager.GetUiDisplayForClass(Classes(_player->getClass())))
|
||||
if (ChrClassUIDisplayEntry const* uiDisplay = sDB2Manager.GetUiDisplayForClass(Classes(_player->GetClass())))
|
||||
if (!_player->MeetPlayerCondition(uiDisplay->AdvGuidePlayerConditionID))
|
||||
return;
|
||||
|
||||
|
||||
@@ -966,7 +966,7 @@ void WorldSession::HandleAuctionSetFavoriteItem(WorldPackets::AuctionHouse::Auct
|
||||
//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(GetTrinityString(LANG_AUCTION_REQ), sWorld->getIntConfig(CONFIG_AUCTION_LEVEL_REQ));
|
||||
return;
|
||||
|
||||
@@ -195,7 +195,7 @@ void WorldSession::HandleAzeriteEmpoweredItemSelectPower(WorldPackets::Azerite::
|
||||
return;
|
||||
|
||||
// Validate tier
|
||||
int32 actualTier = azeriteEmpoweredItem->GetTierForAzeritePower(Classes(_player->getClass()), azeriteEmpoweredItemSelectPower.AzeritePowerID);
|
||||
int32 actualTier = azeriteEmpoweredItem->GetTierForAzeritePower(Classes(_player->GetClass()), azeriteEmpoweredItemSelectPower.AzeritePowerID);
|
||||
if (azeriteEmpoweredItemSelectPower.Tier > MAX_AZERITE_EMPOWERED_TIER || azeriteEmpoweredItemSelectPower.Tier != actualTier)
|
||||
return;
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ void WorldSession::HandleBattlemasterJoinOpcode(WorldPackets::Battleground::Batt
|
||||
return;
|
||||
|
||||
// expected bracket entry
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
@@ -318,7 +318,7 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
|
||||
bgTypeId = bg->GetTypeID();
|
||||
|
||||
// expected bracket entry
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
@@ -336,10 +336,10 @@ void WorldSession::HandleBattleFieldPortOpcode(WorldPackets::Battleground::Battl
|
||||
TC_LOG_DEBUG("bg.battleground", "Player %s (%s) has a deserter debuff, do not port him to battleground!", _player->GetName().c_str(), _player->GetGUID().ToString().c_str());
|
||||
}
|
||||
//if player don't match battleground max level, then do not allow him to enter! (this might happen when player leveled up during his waiting in queue
|
||||
if (_player->getLevel() > bg->GetMaxLevel())
|
||||
if (_player->GetLevel() > bg->GetMaxLevel())
|
||||
{
|
||||
TC_LOG_DEBUG("network", "Player %s (%s) has level (%u) higher than maxlevel (%u) of battleground (%u)! Do not port him to battleground!",
|
||||
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->getLevel(), bg->GetMaxLevel(), bg->GetTypeID());
|
||||
_player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->GetLevel(), bg->GetMaxLevel(), bg->GetTypeID());
|
||||
battlefieldPort.AcceptedInvite = false;
|
||||
}
|
||||
}
|
||||
@@ -476,7 +476,7 @@ void WorldSession::HandleRequestBattlefieldStatusOpcode(WorldPackets::Battlegrou
|
||||
continue;
|
||||
|
||||
// expected bracket entry
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
continue;
|
||||
|
||||
@@ -512,7 +512,7 @@ void WorldSession::HandleBattlemasterJoinArena(WorldPackets::Battleground::Battl
|
||||
|
||||
BattlegroundTypeId bgTypeId = bg->GetTypeID();
|
||||
BattlegroundQueueTypeId bgQueueTypeId = BattlegroundMgr::BGQueueTypeId(bgTypeId, BattlegroundQueueIdType::Arena, true, arenatype);
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->getLevel());
|
||||
PVPDifficultyEntry const* bracketEntry = DB2Manager::GetBattlegroundBracketByLevel(bg->GetMapId(), _player->GetLevel());
|
||||
if (!bracketEntry)
|
||||
return;
|
||||
|
||||
|
||||
@@ -880,7 +880,7 @@ void WorldSession::HandleCharCreateOpcode(WorldPackets::Character::CreateCharact
|
||||
{
|
||||
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Create Character: %s %s", GetAccountId(), GetRemoteAddress().c_str(), newChar->GetName().c_str(), newChar->GetGUID().ToString().c_str());
|
||||
sScriptMgr->OnPlayerCreate(newChar.get());
|
||||
sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->GetNativeSex(), newChar->getRace(), newChar->getClass(), newChar->getLevel(), false);
|
||||
sCharacterCache->AddCharacterCacheEntry(newChar->GetGUID(), GetAccountId(), newChar->GetName(), newChar->GetNativeSex(), newChar->GetRace(), newChar->GetClass(), newChar->GetLevel(), false);
|
||||
|
||||
SendCharCreate(CHAR_CREATE_SUCCESS, newChar->GetGUID());
|
||||
}
|
||||
@@ -1117,7 +1117,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
{
|
||||
pCurrChar->setCinematic(1);
|
||||
|
||||
if (PlayerInfo const* playerInfo = sObjectMgr->GetPlayerInfo(pCurrChar->getRace(), pCurrChar->getClass()))
|
||||
if (PlayerInfo const* playerInfo = sObjectMgr->GetPlayerInfo(pCurrChar->GetRace(), pCurrChar->GetClass()))
|
||||
{
|
||||
switch (pCurrChar->GetCreateMode())
|
||||
{
|
||||
@@ -1126,10 +1126,10 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
pCurrChar->SendMovieStart(playerInfo->introMovieId.get());
|
||||
else if (playerInfo->introSceneId)
|
||||
pCurrChar->GetSceneMgr().PlayScene(*playerInfo->introSceneId);
|
||||
else if (sChrClassesStore.AssertEntry(pCurrChar->getClass())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrClassesStore.AssertEntry(pCurrChar->getClass())->CinematicSequenceID);
|
||||
else if (sChrRacesStore.AssertEntry(pCurrChar->getRace())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrRacesStore.AssertEntry(pCurrChar->getRace())->CinematicSequenceID);
|
||||
else if (sChrClassesStore.AssertEntry(pCurrChar->GetClass())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrClassesStore.AssertEntry(pCurrChar->GetClass())->CinematicSequenceID);
|
||||
else if (sChrRacesStore.AssertEntry(pCurrChar->GetRace())->CinematicSequenceID)
|
||||
pCurrChar->SendCinematicStart(sChrRacesStore.AssertEntry(pCurrChar->GetRace())->CinematicSequenceID);
|
||||
break;
|
||||
case PlayerCreateMode::NPE:
|
||||
if (playerInfo->introSceneIdNPE)
|
||||
@@ -1232,7 +1232,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
if (pCurrChar->m_deathState == DEAD)
|
||||
{
|
||||
// not blizz like, we must correctly save and load player instead...
|
||||
if (pCurrChar->getRace() == RACE_NIGHTELF && !pCurrChar->HasAura(20584))
|
||||
if (pCurrChar->GetRace() == RACE_NIGHTELF && !pCurrChar->HasAura(20584))
|
||||
pCurrChar->CastSpell(pCurrChar, 20584, true);// auras SPELL_AURA_INCREASE_SPEED(+speed in wisp form), SPELL_AURA_INCREASE_SWIM_SPEED(+swim speed in wisp form), SPELL_AURA_TRANSFORM (to wisp form)
|
||||
|
||||
if (!pCurrChar->HasAura(8326))
|
||||
@@ -1287,7 +1287,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
{
|
||||
pCurrChar->RemoveAtLoginFlag(AT_LOGIN_FIRST);
|
||||
|
||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(pCurrChar->getRace(), pCurrChar->getClass());
|
||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(pCurrChar->GetRace(), pCurrChar->GetClass());
|
||||
for (uint32 spellId : info->castSpells)
|
||||
pCurrChar->CastSpell(pCurrChar, spellId, true);
|
||||
|
||||
@@ -1374,7 +1374,7 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
|
||||
SendNotification(LANG_GM_ON);
|
||||
|
||||
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Login Character: [%s] (%s) Level: %d, XP: %u/%u (%u left)",
|
||||
GetAccountId(), GetRemoteAddress().c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUID().ToString().c_str(), pCurrChar->getLevel(),
|
||||
GetAccountId(), GetRemoteAddress().c_str(), pCurrChar->GetName().c_str(), pCurrChar->GetGUID().ToString().c_str(), pCurrChar->GetLevel(),
|
||||
_player->GetXP(), _player->GetXPForNextLevel(), std::max(0, (int32)_player->GetXPForNextLevel() - (int32)_player->GetXP()));
|
||||
|
||||
if (!pCurrChar->IsStandState() && !pCurrChar->HasUnitState(UNIT_STATE_STUNNED))
|
||||
@@ -1682,7 +1682,7 @@ void WorldSession::HandleSetPlayerDeclinedNames(WorldPackets::Character::SetPlay
|
||||
|
||||
void WorldSession::HandleAlterAppearance(WorldPackets::Character::AlterApperance& packet)
|
||||
{
|
||||
if (!ValidateAppearance(Races(_player->getRace()), Classes(_player->getClass()), Gender(packet.NewSex), MakeChrCustomizationChoiceRange(packet.Customizations)))
|
||||
if (!ValidateAppearance(Races(_player->GetRace()), Classes(_player->GetClass()), Gender(packet.NewSex), MakeChrCustomizationChoiceRange(packet.Customizations)))
|
||||
return;
|
||||
|
||||
GameObject* go = _player->FindNearestGameObjectOfType(GAMEOBJECT_TYPE_BARBER_CHAIR, 5.0f);
|
||||
@@ -1927,7 +1927,7 @@ void WorldSession::HandleEquipmentSetSave(WorldPackets::EquipmentSet::SaveEquipm
|
||||
if (!sConditionMgr->IsPlayerMeetingCondition(_player, condition))
|
||||
return false;
|
||||
|
||||
if (illusion->ScalingClassRestricted > 0 && uint8(illusion->ScalingClassRestricted) != _player->getClass())
|
||||
if (illusion->ScalingClassRestricted > 0 && uint8(illusion->ScalingClassRestricted) != _player->GetClass())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -2579,11 +2579,11 @@ void WorldSession::HandleOpeningCinematic(WorldPackets::Misc::OpeningCinematic&
|
||||
if (*_player->m_activePlayerData->XP)
|
||||
return;
|
||||
|
||||
if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->getClass()))
|
||||
if (ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(_player->GetClass()))
|
||||
{
|
||||
if (classEntry->CinematicSequenceID)
|
||||
_player->SendCinematicStart(classEntry->CinematicSequenceID);
|
||||
else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->getRace()))
|
||||
else if (ChrRacesEntry const* raceEntry = sChrRacesStore.LookupEntry(_player->GetRace()))
|
||||
_player->SendCinematicStart(raceEntry->CinematicSequenceID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ void WorldSession::HandleChatMessage(ChatMsg type, Language lang, std::string ms
|
||||
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(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_SAY_LEVEL_REQ));
|
||||
return;
|
||||
@@ -264,7 +264,7 @@ void WorldSession::HandleChatMessage(ChatMsg type, Language lang, std::string ms
|
||||
if (!sender->IsAlive())
|
||||
return;
|
||||
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ))
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_EMOTE_LEVEL_REQ));
|
||||
return;
|
||||
@@ -279,7 +279,7 @@ void WorldSession::HandleChatMessage(ChatMsg type, Language lang, std::string ms
|
||||
if (!sender->IsAlive())
|
||||
return;
|
||||
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ))
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_SAY_REQ), sWorld->getIntConfig(CONFIG_CHAT_YELL_LEVEL_REQ));
|
||||
return;
|
||||
@@ -309,7 +309,7 @@ void WorldSession::HandleChatMessage(ChatMsg type, Language lang, std::string ms
|
||||
// Apply checks only if receiver is not already in whitelist and if receiver is not a GM with ".whisper on"
|
||||
if (!receiver->IsInWhisperWhiteList(sender->GetGUID()) && !receiver->IsGameMasterAcceptingWhispers())
|
||||
{
|
||||
if (!sender->IsGameMaster() && sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
|
||||
if (!sender->IsGameMaster() && sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_WHISPER_REQ), sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ));
|
||||
return;
|
||||
@@ -330,7 +330,7 @@ void WorldSession::HandleChatMessage(ChatMsg type, Language lang, std::string ms
|
||||
|
||||
// If player is a Gamemaster and doesn't accept whisper, we auto-whitelist every player that the Gamemaster is talking to
|
||||
// We also do that if a player is under the required level for whispers.
|
||||
if (receiver->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) ||
|
||||
if (receiver->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_WHISPER_LEVEL_REQ) ||
|
||||
(HasPermission(rbac::RBAC_PERM_CAN_FILTER_WHISPERS) && !sender->isAcceptWhispers() && !sender->IsInWhisperWhiteList(receiver->GetGUID())))
|
||||
sender->AddWhisperWhiteList(receiver->GetGUID());
|
||||
|
||||
@@ -418,7 +418,7 @@ void WorldSession::HandleChatMessage(ChatMsg type, Language lang, std::string ms
|
||||
{
|
||||
if (!HasPermission(rbac::RBAC_PERM_SKIP_CHECK_CHAT_CHANNEL_REQ))
|
||||
{
|
||||
if (sender->getLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
if (sender->GetLevel() < sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_CHANNEL_REQ), sWorld->getIntConfig(CONFIG_CHAT_CHANNEL_LEVEL_REQ));
|
||||
return;
|
||||
|
||||
@@ -107,7 +107,7 @@ void WorldSession::HandlePartyInviteOpcode(WorldPackets::Party::PartyInviteClien
|
||||
return;
|
||||
}
|
||||
|
||||
if (!invitedPlayer->GetSocial()->HasFriend(invitingPlayer->GetGUID()) && invitingPlayer->getLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ))
|
||||
if (!invitedPlayer->GetSocial()->HasFriend(invitingPlayer->GetGUID()) && invitingPlayer->GetLevel() < sWorld->getIntConfig(CONFIG_PARTY_LEVEL_REQ))
|
||||
{
|
||||
SendPartyResult(PARTY_OP_INVITE, invitedPlayer->GetName(), ERR_INVITE_RESTRICTED);
|
||||
return;
|
||||
|
||||
@@ -641,7 +641,7 @@ void WorldSession::SendListInventory(ObjectGuid vendorGuid)
|
||||
if (!_player->IsGameMaster()) // ignore conditions if GM on
|
||||
{
|
||||
// Respect allowed class
|
||||
if (!(itemTemplate->GetAllowableClass() & _player->getClassMask()) && itemTemplate->GetBonding() == BIND_ON_ACQUIRE)
|
||||
if (!(itemTemplate->GetAllowableClass() & _player->GetClassMask()) && itemTemplate->GetBonding() == BIND_ON_ACQUIRE)
|
||||
continue;
|
||||
|
||||
// Only display items in vendor lists for the team the player is on
|
||||
@@ -1086,7 +1086,7 @@ void WorldSession::HandleSocketGems(WorldPackets::Item::SocketGems& socketGems)
|
||||
{
|
||||
if (gems[i])
|
||||
{
|
||||
uint32 gemScalingLevel = _player->getLevel();
|
||||
uint32 gemScalingLevel = _player->GetLevel();
|
||||
if (uint32 fixedLevel = gems[i]->GetModifier(ITEM_MODIFIER_TIMEWALKER_LEVEL))
|
||||
gemScalingLevel = fixedLevel;
|
||||
|
||||
|
||||
@@ -145,7 +145,7 @@ void WorldSession::SendLfgPlayerLockInfo()
|
||||
TC_LOG_DEBUG("lfg", "SMSG_LFG_PLAYER_INFO %s", GetPlayerInfo().c_str());
|
||||
|
||||
// Get Random dungeons that can be done at a certain level and expansion
|
||||
uint8 level = GetPlayer()->getLevel();
|
||||
uint8 level = GetPlayer()->GetLevel();
|
||||
uint32 contentTuningReplacementConditionMask = GetPlayer()->m_playerData->CtrOptions->ContentTuningConditionMask;
|
||||
lfg::LfgDungeonSet const& randomDungeons = sLFGMgr->GetRandomAndSeasonalDungeons(level, GetExpansion(), contentTuningReplacementConditionMask);
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ void WorldSession::HandleAutostoreLootItemOpcode(WorldPackets::Loot::LootItem& p
|
||||
{
|
||||
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->GetClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
|
||||
if (!lootAllowed || !creature->IsWithinDistInMap(_player, AELootCreatureCheck::LootDistance))
|
||||
{
|
||||
player->SendLootError(req.Object, lguid, lootAllowed ? LOOT_ERROR_TOO_FAR : LOOT_ERROR_DIDNT_KILL);
|
||||
@@ -188,7 +188,7 @@ void WorldSession::HandleLootMoneyOpcode(WorldPackets::Loot::LootMoney& /*packet
|
||||
case HighGuid::Vehicle:
|
||||
{
|
||||
Creature* creature = player->GetMap()->GetCreature(guid);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->GetClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
|
||||
if (lootAllowed && creature->IsWithinDistInMap(player, AELootCreatureCheck::LootDistance))
|
||||
{
|
||||
loot = &creature->loot;
|
||||
@@ -411,7 +411,7 @@ void WorldSession::DoLootRelease(ObjectGuid lguid)
|
||||
{
|
||||
Creature* creature = GetPlayer()->GetMap()->GetCreature(lguid);
|
||||
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->getClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
|
||||
bool lootAllowed = creature && creature->IsAlive() == (player->GetClass() == CLASS_ROGUE && creature->loot.loot_type == LOOT_PICKPOCKETING);
|
||||
if (!lootAllowed || !creature->IsWithinDistInMap(_player, AELootCreatureCheck::LootDistance))
|
||||
return;
|
||||
|
||||
@@ -555,7 +555,7 @@ void WorldSession::HandleSetLootSpecialization(WorldPackets::Loot::SetLootSpecia
|
||||
if (packet.SpecID)
|
||||
{
|
||||
if (ChrSpecializationEntry const* chrSpec = sChrSpecializationStore.LookupEntry(packet.SpecID))
|
||||
if (chrSpec->ClassID == GetPlayer()->getClass())
|
||||
if (chrSpec->ClassID == GetPlayer()->GetClass())
|
||||
GetPlayer()->SetLootSpecId(packet.SpecID);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -79,7 +79,7 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& packet)
|
||||
|
||||
Player* player = _player;
|
||||
|
||||
if (player->getLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
if (player->GetLevel() < sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_MAIL_SENDER_REQ), sWorld->getIntConfig(CONFIG_MAIL_LEVEL_REQ));
|
||||
return;
|
||||
@@ -155,7 +155,7 @@ void WorldSession::HandleSendMail(WorldPackets::Mail::SendMail& packet)
|
||||
{
|
||||
receiverTeam = receiver->GetTeam();
|
||||
mailsCount = receiver->GetMailSize();
|
||||
receiverLevel = receiver->getLevel();
|
||||
receiverLevel = receiver->GetLevel();
|
||||
receiverAccountId = receiver->GetSession()->GetAccountId();
|
||||
receiverBnetAccountId = receiver->GetSession()->GetBattlenetAccountId();
|
||||
}
|
||||
|
||||
@@ -392,7 +392,7 @@ void WorldSession::SendStablePetCallback(ObjectGuid guid, PreparedQueryResult re
|
||||
stableEntry.PetNumber = pet->GetCharmInfo()->GetPetNumber();
|
||||
stableEntry.CreatureID = pet->GetEntry();
|
||||
stableEntry.DisplayID = pet->GetDisplayId();
|
||||
stableEntry.ExperienceLevel = pet->getLevel();
|
||||
stableEntry.ExperienceLevel = pet->GetLevel();
|
||||
stableEntry.PetFlags = PET_STABLE_ACTIVE;
|
||||
stableEntry.PetName = pet->GetName();
|
||||
++petSlot;
|
||||
|
||||
@@ -111,7 +111,7 @@ void WorldSession::HandleConfirmRespecWipeOpcode(WorldPackets::Talent::ConfirmRe
|
||||
|
||||
void WorldSession::HandleUnlearnSkillOpcode(WorldPackets::Spells::UnlearnSkill& packet)
|
||||
{
|
||||
SkillRaceClassInfoEntry const* rcEntry = sDB2Manager.GetSkillRaceClassInfo(packet.SkillLine, GetPlayer()->getRace(), GetPlayer()->getClass());
|
||||
SkillRaceClassInfoEntry const* rcEntry = sDB2Manager.GetSkillRaceClassInfo(packet.SkillLine, GetPlayer()->GetRace(), GetPlayer()->GetClass());
|
||||
if (!rcEntry || !(rcEntry->Flags & SKILL_FLAG_UNLEARNABLE))
|
||||
return;
|
||||
|
||||
|
||||
@@ -558,9 +558,9 @@ void WorldSession::HandleMirrorImageDataRequest(WorldPackets::Spells::GetMirrorI
|
||||
WorldPackets::Spells::MirrorImageComponentedData mirrorImageComponentedData;
|
||||
mirrorImageComponentedData.UnitGUID = guid;
|
||||
mirrorImageComponentedData.DisplayID = creator->GetDisplayId();
|
||||
mirrorImageComponentedData.RaceID = creator->getRace();
|
||||
mirrorImageComponentedData.Gender = creator->getGender();
|
||||
mirrorImageComponentedData.ClassID = creator->getClass();
|
||||
mirrorImageComponentedData.RaceID = creator->GetRace();
|
||||
mirrorImageComponentedData.Gender = creator->GetGender();
|
||||
mirrorImageComponentedData.ClassID = creator->GetClass();
|
||||
|
||||
|
||||
for (UF::ChrCustomizationChoice const& customization : player->m_playerData->Customizations)
|
||||
|
||||
@@ -610,7 +610,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade&
|
||||
return;
|
||||
}
|
||||
|
||||
if (GetPlayer()->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
if (GetPlayer()->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_TRADE_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
@@ -684,7 +684,7 @@ void WorldSession::HandleInitiateTradeOpcode(WorldPackets::Trade::InitiateTrade&
|
||||
return;
|
||||
}
|
||||
|
||||
if (pOther->getLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
if (pOther->GetLevel() < sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ))
|
||||
{
|
||||
SendNotification(GetTrinityString(LANG_TRADE_OTHER_REQ), sWorld->getIntConfig(CONFIG_TRADE_LEVEL_REQ));
|
||||
return;
|
||||
|
||||
@@ -150,7 +150,7 @@ void WorldSession::HandleTransmogrifyItems(WorldPackets::Transmogrification::Tra
|
||||
}
|
||||
}
|
||||
|
||||
if (illusion->ScalingClassRestricted > 0 && uint8(illusion->ScalingClassRestricted) != player->getClass())
|
||||
if (illusion->ScalingClassRestricted > 0 && uint8(illusion->ScalingClassRestricted) != player->GetClass())
|
||||
{
|
||||
TC_LOG_DEBUG("network", "WORLD: HandleTransmogrifyItems - %s, Name: %s tried to transmogrify illusion using not allowed class enchant (%d).", player->GetGUID().ToString().c_str(), player->GetName().c_str(), transmogItem.SpellItemEnchantmentID);
|
||||
return;
|
||||
|
||||
@@ -183,12 +183,12 @@ namespace Trinity
|
||||
{
|
||||
float xpMod = 1.0f;
|
||||
|
||||
gain = BaseGain(player->getLevel(), u->GetLevelForTarget(player));
|
||||
gain = BaseGain(player->GetLevel(), u->GetLevelForTarget(player));
|
||||
|
||||
if (gain && creature)
|
||||
{
|
||||
// Players get only 10% xp for killing creatures of lower expansion levels than himself
|
||||
if ((uint32(creature->GetCreatureTemplate()->GetHealthScalingExpansion()) < GetExpansionForLevel(player->getLevel())))
|
||||
if ((uint32(creature->GetCreatureTemplate()->GetHealthScalingExpansion()) < GetExpansionForLevel(player->GetLevel())))
|
||||
gain = uint32(round(gain / 10.0f));
|
||||
|
||||
if (creature->isElite())
|
||||
|
||||
@@ -284,14 +284,14 @@ uint32 Quest::XPValue(Player const* player) const
|
||||
if (!questXp || _rewardXPDifficulty >= 10)
|
||||
return 0;
|
||||
|
||||
int32 diffFactor = 2 * (questLevel - player->getLevel()) + 12;
|
||||
int32 diffFactor = 2 * (questLevel - player->GetLevel()) + 12;
|
||||
if (diffFactor < 1)
|
||||
diffFactor = 1;
|
||||
else if (diffFactor > 10)
|
||||
diffFactor = 10;
|
||||
|
||||
uint32 xp = diffFactor * questXp->Difficulty[_rewardXPDifficulty] * _rewardXPMultiplier / 10;
|
||||
if (player->getLevel() >= GetMaxLevelForExpansion(CURRENT_EXPANSION - 1) && player->GetSession()->GetExpansion() == CURRENT_EXPANSION && _expansion < CURRENT_EXPANSION)
|
||||
if (player->GetLevel() >= GetMaxLevelForExpansion(CURRENT_EXPANSION - 1) && player->GetSession()->GetExpansion() == CURRENT_EXPANSION && _expansion < CURRENT_EXPANSION)
|
||||
xp = uint32(xp / 9.0f);
|
||||
|
||||
xp = RoundXPValue(xp);
|
||||
|
||||
@@ -513,7 +513,7 @@ void ReputationMgr::SetVisible(FactionTemplateEntry const* factionTemplateEntry)
|
||||
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction))
|
||||
// Never show factions of the opposing team
|
||||
if (!(factionEntry->ReputationRaceMask[1].HasRace(_player->getRace()) && factionEntry->ReputationBase[1] == Reputation_Bottom))
|
||||
if (!(factionEntry->ReputationRaceMask[1].HasRace(_player->GetRace()) && factionEntry->ReputationBase[1] == Reputation_Bottom))
|
||||
SetVisible(factionEntry);
|
||||
}
|
||||
|
||||
@@ -722,8 +722,8 @@ int32 ReputationMgr::GetFactionDataIndexForRaceAndClass(FactionEntry const* fact
|
||||
if (!factionEntry)
|
||||
return -1;
|
||||
|
||||
uint8 race = _player->getRace();
|
||||
uint32 classMask = _player->getClassMask();
|
||||
uint8 race = _player->GetRace();
|
||||
uint32 classMask = _player->GetClassMask();
|
||||
for (int32 i = 0; i < 4; i++)
|
||||
{
|
||||
if ((factionEntry->ReputationRaceMask[i].HasRace(race) || (!factionEntry->ReputationRaceMask[i] && factionEntry->ReputationClassMask[i] != 0))
|
||||
@@ -751,5 +751,5 @@ bool ReputationMgr::CanGainParagonReputationForFaction(FactionEntry const* facti
|
||||
if (!quest)
|
||||
return false;
|
||||
|
||||
return _player->getLevel() >= _player->GetQuestMinLevel(quest);
|
||||
return _player->GetLevel() >= _player->GetQuestMinLevel(quest);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace Spells
|
||||
void SpellCastLogData::Initialize(Unit const* unit)
|
||||
{
|
||||
Health = unit->GetHealth();
|
||||
AttackPower = unit->GetTotalAttackPowerValue(unit->getClass() == CLASS_HUNTER ? RANGED_ATTACK : BASE_ATTACK);
|
||||
AttackPower = unit->GetTotalAttackPowerValue(unit->GetClass() == CLASS_HUNTER ? RANGED_ATTACK : BASE_ATTACK);
|
||||
SpellPower = unit->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SPELL);
|
||||
Armor = unit->GetArmor();
|
||||
PowerData.emplace_back(int32(unit->GetPowerType()), unit->GetPower(unit->GetPowerType()), int32(0));
|
||||
@@ -41,7 +41,7 @@ void SpellCastLogData::Initialize(Spell const* spell)
|
||||
if (Unit const* unitCaster = spell->GetCaster()->ToUnit())
|
||||
{
|
||||
Health = unitCaster->GetHealth();
|
||||
AttackPower = unitCaster->GetTotalAttackPowerValue(unitCaster->getClass() == CLASS_HUNTER ? RANGED_ATTACK : BASE_ATTACK);
|
||||
AttackPower = unitCaster->GetTotalAttackPowerValue(unitCaster->GetClass() == CLASS_HUNTER ? RANGED_ATTACK : BASE_ATTACK);
|
||||
SpellPower = unitCaster->SpellBaseDamageBonusDone(SPELL_SCHOOL_MASK_SPELL);
|
||||
Armor = unitCaster->GetArmor();
|
||||
Powers primaryPowerType = unitCaster->GetPowerType();
|
||||
@@ -75,7 +75,7 @@ bool ContentTuningParams::GenerateDataForUnits<Creature, Player>(Creature* attac
|
||||
PlayerItemLevel = target->GetAverageItemLevel();
|
||||
TargetItemLevel = 0;
|
||||
ScalingHealthItemLevelCurveID = target->m_unitData->ScalingHealthItemLevelCurveID;
|
||||
TargetLevel = target->getLevel();
|
||||
TargetLevel = target->GetLevel();
|
||||
Expansion = creatureTemplate->HealthScalingExpansion;
|
||||
TargetScalingLevelDelta = int8(attacker->m_unitData->ScalingLevelDelta);
|
||||
TargetContentTuningID = creatureScaling->ContentTuningID;
|
||||
@@ -93,7 +93,7 @@ bool ContentTuningParams::GenerateDataForUnits<Player, Creature>(Player* attacke
|
||||
PlayerItemLevel = attacker->GetAverageItemLevel();
|
||||
TargetItemLevel = 0;
|
||||
ScalingHealthItemLevelCurveID = target->m_unitData->ScalingHealthItemLevelCurveID;
|
||||
TargetLevel = target->getLevel();
|
||||
TargetLevel = target->GetLevel();
|
||||
Expansion = creatureTemplate->HealthScalingExpansion;
|
||||
TargetScalingLevelDelta = int8(target->m_unitData->ScalingLevelDelta);
|
||||
TargetContentTuningID = creatureScaling->ContentTuningID;
|
||||
@@ -110,7 +110,7 @@ bool ContentTuningParams::GenerateDataForUnits<Creature, Creature>(Creature* att
|
||||
Type = TYPE_CREATURE_TO_CREATURE_DAMAGE;
|
||||
PlayerLevelDelta = 0;
|
||||
PlayerItemLevel = 0;
|
||||
TargetLevel = target->getLevel();
|
||||
TargetLevel = target->GetLevel();
|
||||
Expansion = creatureTemplate->HealthScalingExpansion;
|
||||
TargetScalingLevelDelta = int8(accessor->m_unitData->ScalingLevelDelta);
|
||||
TargetContentTuningID = creatureScaling->ContentTuningID;
|
||||
|
||||
@@ -78,8 +78,8 @@ void WorldPackets::Inspect::PlayerModelDisplayInfo::Initialize(Player const* pla
|
||||
SpecializationID = player->GetPrimarySpecialization();
|
||||
Name = player->GetName();
|
||||
GenderID = player->GetNativeSex();
|
||||
Race = player->getRace();
|
||||
ClassID = player->getClass();
|
||||
Race = player->GetRace();
|
||||
ClassID = player->GetClass();
|
||||
|
||||
for (UF::ChrCustomizationChoice const& customization : player->m_playerData->Customizations)
|
||||
Customizations.push_back(customization);
|
||||
|
||||
@@ -580,7 +580,7 @@ void WorldPackets::Party::PartyMemberFullState::Initialize(Player const* player)
|
||||
MemberStats.Status |= MEMBER_STATUS_VEHICLE;
|
||||
|
||||
// Level
|
||||
MemberStats.Level = player->getLevel();
|
||||
MemberStats.Level = player->GetLevel();
|
||||
|
||||
// Health
|
||||
MemberStats.CurrentHealth = player->GetHealth();
|
||||
|
||||
@@ -133,10 +133,10 @@ bool WorldPackets::Query::PlayerGuidLookupData::Initialize(ObjectGuid const& gui
|
||||
AccountID = player->GetSession()->GetAccountGUID();
|
||||
BnetAccountID = player->GetSession()->GetBattlenetAccountGUID();
|
||||
Name = player->GetName();
|
||||
Race = player->getRace();
|
||||
Race = player->GetRace();
|
||||
Sex = player->GetNativeSex();
|
||||
ClassID = player->getClass();
|
||||
Level = player->getLevel();
|
||||
ClassID = player->GetClass();
|
||||
Level = player->GetLevel();
|
||||
|
||||
if (DeclinedName const* names = player->GetDeclinedNames())
|
||||
DeclinedNames = *names;
|
||||
|
||||
@@ -631,7 +631,7 @@ void WorldSession::LogoutPlayer(bool save)
|
||||
// calls to GetMap in this case may cause crashes
|
||||
_player->CleanupsBeforeDelete();
|
||||
TC_LOG_INFO("entities.player.character", "Account: %u (IP: %s) Logout Character:[%s] (%s) Level: %d, XP: %u/%u (%u left)",
|
||||
GetAccountId(), GetRemoteAddress().c_str(), _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->getLevel(),
|
||||
GetAccountId(), GetRemoteAddress().c_str(), _player->GetName().c_str(), _player->GetGUID().ToString().c_str(), _player->GetLevel(),
|
||||
_player->GetXP(), _player->GetXPForNextLevel(), std::max(0, (int32)_player->GetXPForNextLevel() - (int32)_player->GetXP()));
|
||||
|
||||
if (Map* _map = _player->FindMap())
|
||||
|
||||
@@ -1751,7 +1751,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
|
||||
if (!target->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
|
||||
{
|
||||
target->SetShapeshiftForm(FORM_NONE);
|
||||
if (target->getClass() == CLASS_DRUID)
|
||||
if (target->GetClass() == CLASS_DRUID)
|
||||
{
|
||||
// Remove movement impairing effects also when shifting out
|
||||
target->RemoveAurasByShapeShift();
|
||||
@@ -1790,7 +1790,7 @@ void AuraEffect::HandleAuraModShapeshift(AuraApplication const* aurApp, uint8 mo
|
||||
else
|
||||
target->UpdateDisplayPower();
|
||||
|
||||
if (target->getClass() == CLASS_DRUID)
|
||||
if (target->GetClass() == CLASS_DRUID)
|
||||
{
|
||||
// Dash
|
||||
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_AURA_MOD_INCREASE_SPEED, SPELLFAMILY_DRUID, flag128(0, 0, 0x8)))
|
||||
@@ -1850,47 +1850,47 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode,
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
switch (target->getRace())
|
||||
switch (target->GetRace())
|
||||
{
|
||||
// Blood Elf
|
||||
case RACE_BLOODELF:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 17830 : 17829);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 17830 : 17829);
|
||||
break;
|
||||
// Orc
|
||||
case RACE_ORC:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10140 : 10139);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10140 : 10139);
|
||||
break;
|
||||
// Troll
|
||||
case RACE_TROLL:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10134 : 10135);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10134 : 10135);
|
||||
break;
|
||||
// Tauren
|
||||
case RACE_TAUREN:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10147 : 10136);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10147 : 10136);
|
||||
break;
|
||||
// Undead
|
||||
case RACE_UNDEAD_PLAYER:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10145 : 10146);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10145 : 10146);
|
||||
break;
|
||||
// Draenei
|
||||
case RACE_DRAENEI:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 17828 : 17827);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 17828 : 17827);
|
||||
break;
|
||||
// Dwarf
|
||||
case RACE_DWARF:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10142 : 10141);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10142 : 10141);
|
||||
break;
|
||||
// Gnome
|
||||
case RACE_GNOME:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10149 : 10148);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10149 : 10148);
|
||||
break;
|
||||
// Human
|
||||
case RACE_HUMAN:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10138 : 10137);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10138 : 10137);
|
||||
break;
|
||||
// Night Elf
|
||||
case RACE_NIGHTELF:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 10144 : 10143);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 10144 : 10143);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1909,47 +1909,47 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode,
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
switch (target->getRace())
|
||||
switch (target->GetRace())
|
||||
{
|
||||
// Blood Elf
|
||||
case RACE_BLOODELF:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25043 : 25032);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25043 : 25032);
|
||||
break;
|
||||
// Orc
|
||||
case RACE_ORC:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25050 : 25039);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25050 : 25039);
|
||||
break;
|
||||
// Troll
|
||||
case RACE_TROLL:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25052 : 25041);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25052 : 25041);
|
||||
break;
|
||||
// Tauren
|
||||
case RACE_TAUREN:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25051 : 25040);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25051 : 25040);
|
||||
break;
|
||||
// Undead
|
||||
case RACE_UNDEAD_PLAYER:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25053 : 25042);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25053 : 25042);
|
||||
break;
|
||||
// Draenei
|
||||
case RACE_DRAENEI:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25044 : 25033);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25044 : 25033);
|
||||
break;
|
||||
// Dwarf
|
||||
case RACE_DWARF:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25045 : 25034);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25045 : 25034);
|
||||
break;
|
||||
// Gnome
|
||||
case RACE_GNOME:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25035 : 25046);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25035 : 25046);
|
||||
break;
|
||||
// Human
|
||||
case RACE_HUMAN:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25037 : 25048);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25037 : 25048);
|
||||
break;
|
||||
// Night Elf
|
||||
case RACE_NIGHTELF:
|
||||
target->SetDisplayId(target->getGender() == GENDER_FEMALE ? 25038 : 25049);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_FEMALE ? 25038 : 25049);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -1963,15 +1963,15 @@ void AuraEffect::HandleAuraTransform(AuraApplication const* aurApp, uint8 mode,
|
||||
// Honor the Dead
|
||||
case 65386:
|
||||
case 65495:
|
||||
target->SetDisplayId(target->getGender() == GENDER_MALE ? 29203 : 29204);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_MALE ? 29203 : 29204);
|
||||
break;
|
||||
// Darkspear Pride
|
||||
case 75532:
|
||||
target->SetDisplayId(target->getGender() == GENDER_MALE ? 31737 : 31738);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_MALE ? 31737 : 31738);
|
||||
break;
|
||||
// Gnomeregan Pride
|
||||
case 75531:
|
||||
target->SetDisplayId(target->getGender() == GENDER_MALE ? 31654 : 31655);
|
||||
target->SetDisplayId(target->GetGender() == GENDER_MALE ? 31654 : 31655);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -4184,7 +4184,7 @@ void AuraEffect::HandleAuraModRangedAttackPower(AuraApplication const* aurApp, u
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
|
||||
if ((target->GetClassMask() & CLASSMASK_WAND_USERS) != 0)
|
||||
return;
|
||||
|
||||
target->HandleStatFlatModifier(UNIT_MOD_ATTACK_POWER_RANGED, TOTAL_VALUE, float(GetAmount()), apply);
|
||||
@@ -4214,7 +4214,7 @@ void AuraEffect::HandleAuraModRangedAttackPowerPercent(AuraApplication const* au
|
||||
|
||||
Unit* target = aurApp->GetTarget();
|
||||
|
||||
if ((target->getClassMask() & CLASSMASK_WAND_USERS) != 0)
|
||||
if ((target->GetClassMask() & CLASSMASK_WAND_USERS) != 0)
|
||||
return;
|
||||
|
||||
//UNIT_FIELD_RANGED_ATTACK_POWER_MULTIPLIER = multiplier - 1
|
||||
@@ -4447,7 +4447,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
{
|
||||
if (caster)
|
||||
{
|
||||
if (caster->getGender() == GENDER_FEMALE)
|
||||
if (caster->GetGender() == GENDER_FEMALE)
|
||||
caster->CastSpell(target, 37095, this); // Blood Elf Disguise
|
||||
else
|
||||
caster->CastSpell(target, 37093, this);
|
||||
@@ -4464,7 +4464,7 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
||||
case 46354: // Blood Elf Illusion
|
||||
if (caster)
|
||||
{
|
||||
if (caster->getGender() == GENDER_FEMALE)
|
||||
if (caster->GetGender() == GENDER_FEMALE)
|
||||
caster->CastSpell(target, 46356, this);
|
||||
else
|
||||
caster->CastSpell(target, 46355, this);
|
||||
@@ -5819,7 +5819,7 @@ void AuraEffect::HandleOverridePetSpecs(AuraApplication const* aurApp, uint8 mod
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
if (player->getClass() != CLASS_HUNTER)
|
||||
if (player->GetClass() != CLASS_HUNTER)
|
||||
return;
|
||||
|
||||
Pet* pet = player->GetPet();
|
||||
|
||||
@@ -451,7 +451,7 @@ m_spellInfo(createInfo._spellInfo), m_castDifficulty(createInfo._castDifficulty)
|
||||
m_castItemGuid(createInfo.CastItemGUID), m_castItemId(createInfo.CastItemId),
|
||||
m_castItemLevel(createInfo.CastItemLevel), m_spellVisual({ createInfo.Caster ? createInfo.Caster->GetCastSpellXSpellVisualId(createInfo._spellInfo) : createInfo._spellInfo->GetSpellXSpellVisualId(), 0 }),
|
||||
m_applyTime(GameTime::GetGameTime()), m_owner(createInfo._owner), m_timeCla(0), m_updateTargetMapInterval(0),
|
||||
m_casterLevel(createInfo.Caster ? createInfo.Caster->getLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_casterLevel(createInfo.Caster ? createInfo.Caster->GetLevel() : m_spellInfo->SpellLevel), m_procCharges(0), m_stackAmount(1),
|
||||
m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false), m_dropEvent(nullptr),
|
||||
m_procCooldown(std::chrono::steady_clock::time_point::min()),
|
||||
m_lastProcAttemptTime(std::chrono::steady_clock::now() - Seconds(10)), m_lastProcSuccessTime(std::chrono::steady_clock::now() - Seconds(120))
|
||||
@@ -1889,8 +1889,8 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
|
||||
}
|
||||
|
||||
// proc chance is reduced by an additional 3.333% per level past 60
|
||||
if ((procEntry.AttributesMask & PROC_ATTR_REDUCE_PROC_60) && eventInfo.GetActor()->getLevel() > 60)
|
||||
chance = std::max(0.f, (1.f - ((eventInfo.GetActor()->getLevel() - 60) * 1.f / 30.f)) * chance);
|
||||
if ((procEntry.AttributesMask & PROC_ATTR_REDUCE_PROC_60) && eventInfo.GetActor()->GetLevel() > 60)
|
||||
chance = std::max(0.f, (1.f - ((eventInfo.GetActor()->GetLevel() - 60) * 1.f / 30.f)) * chance);
|
||||
|
||||
return chance;
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ m_spellValue(new SpellValue(m_spellInfo, caster)), _spellEvent(nullptr)
|
||||
{
|
||||
// wand case
|
||||
if (m_attackType == RANGED_ATTACK)
|
||||
if ((playerCaster->getClassMask() & CLASSMASK_WAND_USERS) != 0)
|
||||
if ((playerCaster->GetClassMask() & CLASSMASK_WAND_USERS) != 0)
|
||||
if (Item* pItem = playerCaster->GetWeaponForAttack(RANGED_ATTACK))
|
||||
m_spellSchoolMask = SpellSchoolMask(1 << pItem->GetTemplate()->GetDamageType());
|
||||
}
|
||||
@@ -4392,7 +4392,7 @@ void Spell::SendSpellGo()
|
||||
castFlags |= CAST_FLAG_POWER_LEFT_SELF;
|
||||
|
||||
if ((m_caster->GetTypeId() == TYPEID_PLAYER)
|
||||
&& (m_caster->ToPlayer()->getClass() == CLASS_DEATH_KNIGHT)
|
||||
&& (m_caster->ToPlayer()->GetClass() == CLASS_DEATH_KNIGHT)
|
||||
&& HasPowerTypeCost(POWER_RUNES)
|
||||
&& !(_triggeredCastFlags & TRIGGERED_IGNORE_POWER_AND_REAGENT_COST))
|
||||
{
|
||||
@@ -4957,7 +4957,7 @@ SpellCastResult Spell::CheckRuneCost() const
|
||||
if (!player)
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
if (player->getClass() != CLASS_DEATH_KNIGHT)
|
||||
if (player->GetClass() != CLASS_DEATH_KNIGHT)
|
||||
return SPELL_CAST_OK;
|
||||
|
||||
int32 readyRunes = 0;
|
||||
@@ -4973,7 +4973,7 @@ SpellCastResult Spell::CheckRuneCost() const
|
||||
|
||||
void Spell::TakeRunePower(bool didHit)
|
||||
{
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER || m_caster->ToPlayer()->getClass() != CLASS_DEATH_KNIGHT)
|
||||
if (m_caster->GetTypeId() != TYPEID_PLAYER || m_caster->ToPlayer()->GetClass() != CLASS_DEATH_KNIGHT)
|
||||
return;
|
||||
|
||||
Player* player = m_caster->ToPlayer();
|
||||
@@ -5156,12 +5156,12 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
&& !m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO)
|
||||
&& !m_spellInfo->HasEffect(SPELL_EFFECT_ATTACK)
|
||||
&& !m_spellInfo->HasAttribute(SPELL_ATTR12_IGNORE_CASTING_DISABLED)
|
||||
&& !playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->getClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags))
|
||||
&& !playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_CASTING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->GetClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags))
|
||||
return SPELL_FAILED_CANT_DO_THAT_RIGHT_NOW;
|
||||
|
||||
if (playerCaster->HasAuraType(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES))
|
||||
{
|
||||
if (!playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->getClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags))
|
||||
if (!playerCaster->HasAuraTypeWithFamilyFlags(SPELL_AURA_DISABLE_ATTACKING_EXCEPT_ABILITIES, sChrClassesStore.AssertEntry(playerCaster->GetClass())->SpellClassSet, m_spellInfo->SpellFamilyFlags))
|
||||
{
|
||||
if (m_spellInfo->HasAttribute(SPELL_ATTR0_REQ_AMMO)
|
||||
|| m_spellInfo->IsNextMeleeSwingSpell()
|
||||
@@ -5534,7 +5534,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
if (!learn_spellproto)
|
||||
return SPELL_FAILED_NOT_KNOWN;
|
||||
|
||||
if (m_spellInfo->SpellLevel > pet->getLevel())
|
||||
if (m_spellInfo->SpellLevel > pet->GetLevel())
|
||||
return SPELL_FAILED_LOWLEVEL;
|
||||
|
||||
break;
|
||||
@@ -5565,7 +5565,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
if (!learn_spellproto)
|
||||
return SPELL_FAILED_NOT_KNOWN;
|
||||
|
||||
if (m_spellInfo->SpellLevel > pet->getLevel())
|
||||
if (m_spellInfo->SpellLevel > pet->GetLevel())
|
||||
return SPELL_FAILED_LOWLEVEL;
|
||||
}
|
||||
break;
|
||||
@@ -5644,7 +5644,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
if (!pet->HaveInDiet(foodItem->GetTemplate()))
|
||||
return SPELL_FAILED_WRONG_PET_FOOD;
|
||||
|
||||
if (foodItem->GetTemplate()->GetBaseItemLevel() + 30 <= pet->getLevel())
|
||||
if (foodItem->GetTemplate()->GetBaseItemLevel() + 30 <= pet->GetLevel())
|
||||
return SPELL_FAILED_FOOD_LOWLEVEL;
|
||||
|
||||
if (m_caster->ToPlayer()->IsInCombat() || pet->IsInCombat())
|
||||
@@ -5943,7 +5943,7 @@ SpellCastResult Spell::CheckCast(bool strict, int32* param1 /*= nullptr*/, int32
|
||||
if (!player)
|
||||
return SPELL_FAILED_TARGET_NOT_PLAYER;
|
||||
|
||||
if (!spec || (spec->ClassID != player->getClass() && !spec->IsPetSpecialization()))
|
||||
if (!spec || (spec->ClassID != player->GetClass() && !spec->IsPetSpecialization()))
|
||||
return SPELL_FAILED_NO_SPEC;
|
||||
|
||||
if (spec->IsPetSpecialization())
|
||||
@@ -7794,7 +7794,7 @@ SpellCastResult Spell::CanOpenLock(SpellEffectInfo const& effect, uint32 lockId,
|
||||
if (!m_CastItem && unitCaster->GetTypeId() == TYPEID_PLAYER)
|
||||
skillValue = unitCaster->ToPlayer()->GetSkillValue(skillId);
|
||||
else if (lockInfo->Index[j] == LOCKTYPE_LOCKPICKING)
|
||||
skillValue = unitCaster->getLevel() * 5;
|
||||
skillValue = unitCaster->GetLevel() * 5;
|
||||
|
||||
// skill bonus provided by casting spell (mostly item spells)
|
||||
// add the effect base points modifier from the spell cast (cheat lock / skeleton key etc.)
|
||||
@@ -8308,7 +8308,7 @@ bool WorldObjectSpellTargetCheck::operator()(WorldObject* target) const
|
||||
case TARGET_CHECK_RAID_CLASS:
|
||||
if (!refUnit)
|
||||
return false;
|
||||
if (refUnit->getClass() != unitTarget->getClass())
|
||||
if (refUnit->GetClass() != unitTarget->GetClass())
|
||||
return false;
|
||||
/* fallthrough */
|
||||
case TARGET_CHECK_RAID:
|
||||
|
||||
@@ -1442,11 +1442,11 @@ void Spell::EffectEnergize()
|
||||
{
|
||||
case 24571: // Blood Fury
|
||||
// Instantly increases your rage by ${(300-10*$max(0,$PL-60))/10}.
|
||||
damage -= 10 * std::max(0, std::min(30, unitCaster->getLevel() - 60));
|
||||
damage -= 10 * std::max(0, std::min(30, unitCaster->GetLevel() - 60));
|
||||
break;
|
||||
case 24532: // Burst of Energy
|
||||
// Instantly increases your energy by ${60-4*$max(0,$min(15,$PL-60))}.
|
||||
damage -= 4 * std::max(0, std::min(15, unitCaster->getLevel() - 60));
|
||||
damage -= 4 * std::max(0, std::min(15, unitCaster->GetLevel() - 60));
|
||||
break;
|
||||
case 67490: // Runic Mana Injector (mana gain increased by 25% for engineers - 3.2.0 patch change)
|
||||
{
|
||||
@@ -2276,7 +2276,7 @@ void Spell::EffectLearnSkill()
|
||||
return;
|
||||
|
||||
uint32 skillid = effectInfo->MiscValue;
|
||||
SkillRaceClassInfoEntry const* rcEntry = sDB2Manager.GetSkillRaceClassInfo(skillid, unitTarget->getRace(), unitTarget->getClass());
|
||||
SkillRaceClassInfoEntry const* rcEntry = sDB2Manager.GetSkillRaceClassInfo(skillid, unitTarget->GetRace(), unitTarget->GetClass());
|
||||
if (!rcEntry)
|
||||
return;
|
||||
|
||||
@@ -2538,7 +2538,7 @@ void Spell::EffectTameCreature()
|
||||
if (creatureTarget->IsPet())
|
||||
return;
|
||||
|
||||
if (unitCaster->getClass() != CLASS_HUNTER)
|
||||
if (unitCaster->GetClass() != CLASS_HUNTER)
|
||||
return;
|
||||
|
||||
// cast finish successfully
|
||||
@@ -3213,7 +3213,7 @@ void Spell::EffectDuel()
|
||||
PhasingHandler::InheritPhaseShift(go, caster);
|
||||
|
||||
go->SetFaction(caster->GetFaction());
|
||||
go->SetLevel(caster->getLevel() + 1);
|
||||
go->SetLevel(caster->GetLevel() + 1);
|
||||
int32 duration = m_spellInfo->CalcDuration(caster);
|
||||
go->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
go->SetSpellId(m_spellInfo->Id);
|
||||
@@ -3474,7 +3474,7 @@ void Spell::EffectFeedPet()
|
||||
ExecuteLogEffectDestroyItem(SpellEffectName(effectInfo->Effect), foodItem->GetEntry());
|
||||
|
||||
int32 pct;
|
||||
int32 levelDiff = int32(pet->getLevel()) - int32(foodItem->GetTemplate()->GetBaseItemLevel());
|
||||
int32 levelDiff = int32(pet->GetLevel()) - int32(foodItem->GetTemplate()->GetBaseItemLevel());
|
||||
if (levelDiff >= 30)
|
||||
return;
|
||||
else if (levelDiff >= 20)
|
||||
@@ -3549,7 +3549,7 @@ void Spell::EffectSummonObject()
|
||||
PhasingHandler::InheritPhaseShift(go, m_caster);
|
||||
|
||||
go->SetFaction(unitCaster->GetFaction());
|
||||
go->SetLevel(unitCaster->getLevel());
|
||||
go->SetLevel(unitCaster->GetLevel());
|
||||
int32 duration = m_spellInfo->CalcDuration(m_caster);
|
||||
go->SetRespawnTime(duration > 0 ? duration / IN_MILLISECONDS : 0);
|
||||
go->SetSpellId(m_spellInfo->Id);
|
||||
@@ -4667,7 +4667,7 @@ void Spell::EffectCreateTamedPet()
|
||||
if (effectHandleMode != SPELL_EFFECT_HANDLE_HIT_TARGET)
|
||||
return;
|
||||
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || !unitTarget->GetPetGUID().IsEmpty() || unitTarget->getClass() != CLASS_HUNTER)
|
||||
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER || !unitTarget->GetPetGUID().IsEmpty() || unitTarget->GetClass() != CLASS_HUNTER)
|
||||
return;
|
||||
|
||||
uint32 creatureEntry = effectInfo->MiscValue;
|
||||
@@ -4772,7 +4772,7 @@ void Spell::SummonGuardian(SpellEffectInfo const* effect, uint32 entry, SummonPr
|
||||
unitCaster = unitCaster->ToTotem()->GetOwner();
|
||||
|
||||
// in another case summon new
|
||||
uint8 level = unitCaster->getLevel();
|
||||
uint8 level = unitCaster->GetLevel();
|
||||
|
||||
// level of pet summoned using engineering item based at engineering skill level
|
||||
if (m_CastItem && unitCaster->GetTypeId() == TYPEID_PLAYER)
|
||||
|
||||
@@ -485,7 +485,7 @@ int32 SpellEffectInfo::CalcValue(WorldObject const* caster /*= nullptr*/, int32
|
||||
{
|
||||
if (casterUnit && basePointsPerLevel != 0.0f)
|
||||
{
|
||||
int32 level = int32(casterUnit->getLevel());
|
||||
int32 level = int32(casterUnit->GetLevel());
|
||||
if (level > int32(_spellInfo->MaxLevel) && _spellInfo->MaxLevel > 0)
|
||||
level = int32(_spellInfo->MaxLevel);
|
||||
|
||||
@@ -518,9 +518,9 @@ int32 SpellEffectInfo::CalcBaseValue(WorldObject const* caster, Unit const* targ
|
||||
{
|
||||
uint32 level = _spellInfo->SpellLevel;
|
||||
if (target && _spellInfo->IsPositiveEffect(EffectIndex) && (Effect == SPELL_EFFECT_APPLY_AURA))
|
||||
level = target->getLevel();
|
||||
level = target->GetLevel();
|
||||
else if (caster && caster->IsUnit())
|
||||
level = caster->ToUnit()->getLevel();
|
||||
level = caster->ToUnit()->GetLevel();
|
||||
|
||||
if (_spellInfo->BaseLevel && !_spellInfo->HasAttribute(SPELL_ATTR11_SCALES_WITH_ITEM_LEVEL) && _spellInfo->HasAttribute(SPELL_ATTR10_USE_SPELL_BASE_LEVEL_FOR_SCALING))
|
||||
level = _spellInfo->BaseLevel;
|
||||
@@ -589,7 +589,7 @@ int32 SpellEffectInfo::CalcBaseValue(WorldObject const* caster, Unit const* targ
|
||||
if (ContentTuningEntry const* contentTuning = sContentTuningStore.LookupEntry(contentTuningId))
|
||||
expansion = contentTuning->ExpansionID;
|
||||
|
||||
int32 level = caster && caster->IsUnit() ? int32(caster->ToUnit()->getLevel()) : 1;
|
||||
int32 level = caster && caster->IsUnit() ? int32(caster->ToUnit()->GetLevel()) : 1;
|
||||
value = sDB2Manager.EvaluateExpectedStat(stat, level, expansion, 0, CLASS_NONE) * BasePoints / 100.0f;
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ float SpellEffectInfo::CalcRadius(WorldObject* caster /*= nullptr*/, Spell* spel
|
||||
if (caster)
|
||||
{
|
||||
if (Unit* casterUnit = caster->ToUnit())
|
||||
radius += entry->RadiusPerLevel * casterUnit->getLevel();
|
||||
radius += entry->RadiusPerLevel * casterUnit->GetLevel();
|
||||
|
||||
radius = std::min(radius, entry->RadiusMax);
|
||||
|
||||
@@ -3977,7 +3977,7 @@ Optional<SpellPowerCost> SpellInfo::CalcPowerCost(SpellPowerEntry const* power,
|
||||
if (HasAttribute(SPELL_ATTR0_LEVEL_DAMAGE_CALCULATION))
|
||||
{
|
||||
GtNpcManaCostScalerEntry const* spellScaler = sNpcManaCostScalerGameTable.GetRow(SpellLevel);
|
||||
GtNpcManaCostScalerEntry const* casterScaler = sNpcManaCostScalerGameTable.GetRow(unitCaster->getLevel());
|
||||
GtNpcManaCostScalerEntry const* casterScaler = sNpcManaCostScalerGameTable.GetRow(unitCaster->GetLevel());
|
||||
if (spellScaler && casterScaler)
|
||||
powerCost *= casterScaler->Scaler / spellScaler->Scaler;
|
||||
}
|
||||
@@ -4128,7 +4128,7 @@ float SpellInfo::CalcProcPPM(Unit* caster, int32 itemLevel) const
|
||||
}
|
||||
case SPELL_PPM_MOD_CLASS:
|
||||
{
|
||||
if (caster->getClassMask() & mod->Param)
|
||||
if (caster->GetClassMask() & mod->Param)
|
||||
ppm *= 1.0f + mod->Coeff;
|
||||
break;
|
||||
}
|
||||
@@ -4141,7 +4141,7 @@ float SpellInfo::CalcProcPPM(Unit* caster, int32 itemLevel) const
|
||||
}
|
||||
case SPELL_PPM_MOD_RACE:
|
||||
{
|
||||
if (caster->getRaceMask() & mod->Param)
|
||||
if (caster->GetRaceMask() & mod->Param)
|
||||
ppm *= 1.0f + mod->Coeff;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -731,11 +731,11 @@ void SpellMgr::ForEachSpellInfoDifficulty(uint32 spellId, std::function<void(Spe
|
||||
bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32 newArea) const
|
||||
{
|
||||
if (gender != GENDER_NONE) // is not expected gender
|
||||
if (!player || gender != player->getGender())
|
||||
if (!player || gender != player->GetGender())
|
||||
return false;
|
||||
|
||||
if (raceMask) // is not expected race
|
||||
if (!player || !raceMask.HasRace(player->getRace()))
|
||||
if (!player || !raceMask.HasRace(player->GetRace()))
|
||||
return false;
|
||||
|
||||
if (areaId) // is not in expected zone
|
||||
|
||||
@@ -61,8 +61,8 @@ void WhoListStorageMgr::Update()
|
||||
if (guild)
|
||||
guildGuid = guild->GetGUID();
|
||||
|
||||
_whoListStorage.emplace_back(itr->second->GetGUID(), itr->second->GetTeam(), itr->second->GetSession()->GetSecurity(), itr->second->getLevel(),
|
||||
itr->second->getClass(), itr->second->getRace(), itr->second->GetZoneId(), itr->second->GetNativeSex(), itr->second->IsVisible(),
|
||||
_whoListStorage.emplace_back(itr->second->GetGUID(), itr->second->GetTeam(), itr->second->GetSession()->GetSecurity(), itr->second->GetLevel(),
|
||||
itr->second->GetClass(), itr->second->GetRace(), itr->second->GetZoneId(), itr->second->GetNativeSex(), itr->second->IsVisible(),
|
||||
itr->second->IsGameMaster(), widePlayerName, wideGuildName, playerName, guildName, guildGuid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
|
||||
finalPlayType = playType;
|
||||
}
|
||||
else if (BroadcastTextEntry const* bct = sBroadcastTextStore.LookupEntry(iter->BroadcastTextId))
|
||||
if (uint32 broadcastTextSoundId = bct->SoundKitID[source->getGender() == GENDER_FEMALE ? 1 : 0])
|
||||
if (uint32 broadcastTextSoundId = bct->SoundKitID[source->GetGender() == GENDER_FEMALE ? 1 : 0])
|
||||
finalSound = broadcastTextSoundId;
|
||||
|
||||
if (range == TEXT_RANGE_NORMAL)
|
||||
@@ -233,12 +233,12 @@ uint32 CreatureTextMgr::SendChat(Creature* source, uint8 textGroup, WorldObject
|
||||
|
||||
if (srcPlr)
|
||||
{
|
||||
Trinity::CreatureTextTextBuilder builder(source, finalSource, finalSource->getGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget);
|
||||
Trinity::CreatureTextTextBuilder builder(source, finalSource, finalSource->GetGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget);
|
||||
SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
|
||||
}
|
||||
else
|
||||
{
|
||||
Trinity::CreatureTextTextBuilder builder(finalSource, finalSource, finalSource->getGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget);
|
||||
Trinity::CreatureTextTextBuilder builder(finalSource, finalSource, finalSource->GetGender(), finalType, iter->groupId, iter->id, finalLang, whisperTarget);
|
||||
SendChatPacket(finalSource, builder, finalType, whisperTarget, range, team, gmOnly);
|
||||
}
|
||||
|
||||
|
||||
@@ -279,7 +279,7 @@ public:
|
||||
|
||||
if (titleInfo && target->HasTitle(titleInfo))
|
||||
{
|
||||
std::string name = (target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()];
|
||||
std::string name = (target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()];
|
||||
if (name.empty())
|
||||
continue;
|
||||
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
|
||||
return false;
|
||||
|
||||
int32 oldlevel = target ? target->getLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid);
|
||||
int32 oldlevel = target ? target->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid);
|
||||
int32 newlevel = levelStr ? atoi(levelStr) : oldlevel;
|
||||
|
||||
if (newlevel < 1)
|
||||
@@ -903,7 +903,7 @@ public:
|
||||
if (!handler->extractPlayerTarget(nameStr, &target, &targetGuid, &targetName))
|
||||
return false;
|
||||
|
||||
int32 oldlevel = target ? target->getLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid);
|
||||
int32 oldlevel = target ? target->GetLevel() : sCharacterCache->GetCharacterLevelByGuid(targetGuid);
|
||||
int32 addlevel = levelStr ? atoi(levelStr) : 1;
|
||||
int32 newlevel = oldlevel + addlevel;
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
|
||||
static bool HandleLearnAllMySpellsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->getClass());
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(handler->GetSession()->GetPlayer()->GetClass());
|
||||
if (!classEntry)
|
||||
return true;
|
||||
uint32 family = classEntry->SpellClassSet;
|
||||
@@ -184,7 +184,7 @@ public:
|
||||
static bool HandleLearnAllMyTalentsCommand(ChatHandler* handler, char const* /*args*/)
|
||||
{
|
||||
Player* player = handler->GetSession()->GetPlayer();
|
||||
uint32 playerClass = player->getClass();
|
||||
uint32 playerClass = player->GetClass();
|
||||
|
||||
for (uint32 i = 0; i < sTalentStore.GetNumRows(); ++i)
|
||||
{
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
|
||||
static void HandleLearnSkillRecipesHelper(Player* player, uint32 skillId)
|
||||
{
|
||||
uint32 classmask = player->getClassMask();
|
||||
uint32 classmask = player->GetClassMask();
|
||||
|
||||
for (uint32 j = 0; j < sSkillLineAbilityStore.GetNumRows(); ++j)
|
||||
{
|
||||
|
||||
@@ -621,7 +621,7 @@ public:
|
||||
{
|
||||
uint32 color = ItemQualityColors[itemTemplate->GetQuality()];
|
||||
std::ostringstream itemStr;
|
||||
itemStr << "|c" << std::hex << color << "|Hitem:" << item_entry << ":0:0:0:0:0:0:0:" << handler->GetSession()->GetPlayer()->getLevel()
|
||||
itemStr << "|c" << std::hex << color << "|Hitem:" << item_entry << ":0:0:0:0:0:0:0:" << handler->GetSession()->GetPlayer()->GetLevel()
|
||||
<< ":0:0:0:0:0|h[" << itemTemplate->GetName(handler->GetSessionDbcLocale()) << "]|h|r";
|
||||
handler->PSendSysMessage(LANG_LIST_MAIL_INFO_ITEM, itemStr.str().c_str(), item_entry, item_guid, item_count);
|
||||
}
|
||||
|
||||
@@ -1263,7 +1263,7 @@ public:
|
||||
{
|
||||
for (uint8 gender = GENDER_MALE; gender <= GENDER_FEMALE; ++gender)
|
||||
{
|
||||
if (target && target->getGender() != gender)
|
||||
if (target && target->GetGender() != gender)
|
||||
continue;
|
||||
|
||||
LocaleConstant locale = handler->GetSessionDbcLocale();
|
||||
|
||||
@@ -1698,10 +1698,10 @@ public:
|
||||
accId = target->GetSession()->GetAccountId();
|
||||
money = target->GetMoney();
|
||||
totalPlayerTime = target->GetTotalPlayedTime();
|
||||
level = target->getLevel();
|
||||
level = target->GetLevel();
|
||||
latency = target->GetSession()->GetLatency();
|
||||
raceid = target->getRace();
|
||||
classid = target->getClass();
|
||||
raceid = target->GetRace();
|
||||
classid = target->GetClass();
|
||||
muteTime = target->GetSession()->m_muteTime;
|
||||
mapId = target->GetMapId();
|
||||
areaId = target->GetAreaId();
|
||||
|
||||
@@ -868,7 +868,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->getRace(), target->getClass());
|
||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(target->GetRace(), target->GetClass());
|
||||
if (!info)
|
||||
return false;
|
||||
|
||||
@@ -879,14 +879,14 @@ public:
|
||||
|
||||
if (!strncmp(gender_str, "male", gender_len)) // MALE
|
||||
{
|
||||
if (target->getGender() == GENDER_MALE)
|
||||
if (target->GetGender() == GENDER_MALE)
|
||||
return true;
|
||||
|
||||
gender = GENDER_MALE;
|
||||
}
|
||||
else if (!strncmp(gender_str, "female", gender_len)) // FEMALE
|
||||
{
|
||||
if (target->getGender() == GENDER_FEMALE)
|
||||
if (target->GetGender() == GENDER_FEMALE)
|
||||
return true;
|
||||
|
||||
gender = GENDER_FEMALE;
|
||||
@@ -911,8 +911,8 @@ public:
|
||||
// Generate random customizations
|
||||
std::vector<UF::ChrCustomizationChoice> customizations;
|
||||
|
||||
Classes playerClass = Classes(target->getClass());
|
||||
std::vector<ChrCustomizationOptionEntry const*> const* options = sDB2Manager.GetCustomiztionOptions(target->getRace(), gender);
|
||||
Classes playerClass = Classes(target->GetClass());
|
||||
std::vector<ChrCustomizationOptionEntry const*> const* options = sDB2Manager.GetCustomiztionOptions(target->GetRace(), gender);
|
||||
WorldSession const* worldSession = target->GetSession();
|
||||
for (ChrCustomizationOptionEntry const* option : *options)
|
||||
{
|
||||
|
||||
@@ -676,7 +676,7 @@ public:
|
||||
handler->PSendSysMessage(LANG_SPAWNINFO_GROUP_ID, groupData->name.c_str(), groupData->groupId, groupData->flags, target->GetMap()->IsSpawnGroupActive(groupData->groupId));
|
||||
}
|
||||
handler->PSendSysMessage(LANG_SPAWNINFO_COMPATIBILITY_MODE, target->GetRespawnCompatibilityMode());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->getLevel());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_LEVEL, target->GetLevel());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_EQUIPMENT, target->GetCurrentEquipmentId(), target->GetOriginalEquipmentId());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_HEALTH, target->GetCreateHealth(), std::to_string(target->GetMaxHealth()).c_str(), std::to_string(target->GetHealth()).c_str());
|
||||
handler->PSendSysMessage(LANG_NPCINFO_MOVEMENT_DATA, target->GetMovementTemplate().ToString().c_str());
|
||||
@@ -1401,7 +1401,7 @@ public:
|
||||
pet->SetReactState(REACT_DEFENSIVE);
|
||||
|
||||
// calculate proper level
|
||||
uint8 level = std::max<uint8>(player->getLevel()-5, creatureTarget->getLevel());
|
||||
uint8 level = std::max<uint8>(player->GetLevel()-5, creatureTarget->GetLevel());
|
||||
|
||||
// prepare visual effect for levelup
|
||||
pet->SetLevel(level - 1);
|
||||
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
pet->SetCreatorGUID(player->GetGUID());
|
||||
pet->SetFaction(player->GetFaction());
|
||||
|
||||
if (!pet->InitStatsForLevel(creatureTarget->getLevel()))
|
||||
if (!pet->InitStatsForLevel(creatureTarget->GetLevel()))
|
||||
{
|
||||
TC_LOG_ERROR("misc", "InitStatsForLevel() in EffectTameCreature failed! Pet deleted.");
|
||||
handler->PSendSysMessage("Error 2");
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
}
|
||||
|
||||
// prepare visual effect for levelup
|
||||
pet->SetLevel(creatureTarget->getLevel() - 1);
|
||||
pet->SetLevel(creatureTarget->GetLevel() - 1);
|
||||
|
||||
pet->GetCharmInfo()->SetPetNumber(sObjectMgr->GeneratePetNumber(), true);
|
||||
// this enables pet details window (Shift+P)
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
pet->GetMap()->AddToMap(pet->ToCreature());
|
||||
|
||||
// visual effect for levelup
|
||||
pet->SetLevel(creatureTarget->getLevel());
|
||||
pet->SetLevel(creatureTarget->GetLevel());
|
||||
|
||||
player->SetMinion(pet, true);
|
||||
pet->SavePetToDB(PET_SAVE_AS_CURRENT);
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
|
||||
int32 level = args ? atoi(args) : 0;
|
||||
if (level == 0)
|
||||
level = owner->getLevel() - pet->getLevel();
|
||||
level = owner->GetLevel() - pet->GetLevel();
|
||||
if (level == 0 || level < -STRONG_MAX_LEVEL || level > STRONG_MAX_LEVEL)
|
||||
{
|
||||
handler->SendSysMessage(LANG_BAD_VALUE);
|
||||
@@ -219,11 +219,11 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
int32 newLevel = pet->getLevel() + level;
|
||||
int32 newLevel = pet->GetLevel() + level;
|
||||
if (newLevel < 1)
|
||||
newLevel = 1;
|
||||
else if (newLevel > owner->getLevel())
|
||||
newLevel = owner->getLevel();
|
||||
else if (newLevel > owner->GetLevel())
|
||||
newLevel = owner->GetLevel();
|
||||
|
||||
pet->GivePetLevel(newLevel);
|
||||
return true;
|
||||
|
||||
@@ -91,10 +91,10 @@ public:
|
||||
|
||||
static bool HandleResetStatsOrLevelHelper(Player* player)
|
||||
{
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->getClass());
|
||||
ChrClassesEntry const* classEntry = sChrClassesStore.LookupEntry(player->GetClass());
|
||||
if (!classEntry)
|
||||
{
|
||||
TC_LOG_ERROR("misc", "Class %u not found in DBC (Wrong DBC files?)", player->getClass());
|
||||
TC_LOG_ERROR("misc", "Class %u not found in DBC (Wrong DBC files?)", player->GetClass());
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ public:
|
||||
if (!player->HasAuraType(SPELL_AURA_MOD_SHAPESHIFT))
|
||||
player->SetShapeshiftForm(FORM_NONE);
|
||||
|
||||
player->setFactionForRace(player->getRace());
|
||||
player->setFactionForRace(player->GetRace());
|
||||
player->SetPowerType(Powers(powerType));
|
||||
|
||||
// reset only if player not in some form;
|
||||
@@ -129,10 +129,10 @@ public:
|
||||
if (!HandleResetStatsOrLevelHelper(target))
|
||||
return false;
|
||||
|
||||
uint8 oldLevel = target->getLevel();
|
||||
uint8 oldLevel = target->GetLevel();
|
||||
|
||||
// set starting level
|
||||
uint8 startLevel = target->GetStartLevel(target->getRace(), target->getClass(), {});
|
||||
uint8 startLevel = target->GetStartLevel(target->GetRace(), target->GetClass(), {});
|
||||
|
||||
target->_ApplyAllLevelScaleItemMods(false);
|
||||
target->SetLevel(startLevel);
|
||||
|
||||
@@ -95,7 +95,7 @@ public:
|
||||
target->SetChosenTitle(titleInfo->MaskID);
|
||||
|
||||
handler->PSendSysMessage(LANG_TITLE_CURRENT_RES, id,
|
||||
(target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()],
|
||||
(target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()],
|
||||
tNameLink.c_str());
|
||||
return true;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ public:
|
||||
std::string tNameLink = handler->GetNameLink(target);
|
||||
|
||||
std::string titleNameStr = Trinity::StringFormat(
|
||||
(target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()],
|
||||
(target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()],
|
||||
target->GetName().c_str()
|
||||
);
|
||||
|
||||
@@ -188,7 +188,7 @@ public:
|
||||
std::string tNameLink = handler->GetNameLink(target);
|
||||
|
||||
std::string titleNameStr = Trinity::StringFormat(
|
||||
(target->getGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()],
|
||||
(target->GetGender() == GENDER_MALE ? titleInfo->Name : titleInfo->Name1)[handler->GetSessionDbcLocale()],
|
||||
target->GetName().c_str()
|
||||
);
|
||||
|
||||
|
||||
+1
-1
@@ -593,7 +593,7 @@ public:
|
||||
{
|
||||
if (Creature* infiltrator = ObjectAccessor::GetCreature(*player, instance->GetGuidData(DATA_SCARSHIELD_INFILTRATOR)))
|
||||
{
|
||||
if (player->getLevel() >= 57)
|
||||
if (player->GetLevel() >= 57)
|
||||
infiltrator->AI()->SetData(1, 1);
|
||||
else if (infiltrator->GetEntry() == NPC_SCARSHIELD_INFILTRATOR)
|
||||
infiltrator->AI()->Talk(0, player);
|
||||
|
||||
+1
-1
@@ -513,7 +513,7 @@ public:
|
||||
break;
|
||||
case EVENT_CLASSCALL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
switch (target->getClass())
|
||||
switch (target->GetClass())
|
||||
{
|
||||
case CLASS_MAGE:
|
||||
Talk(SAY_MAGE);
|
||||
|
||||
@@ -624,7 +624,7 @@ public:
|
||||
// summoned->SetVisibility(VISIBILITY_OFF); //with this we cant see the armageddon visuals
|
||||
}
|
||||
else
|
||||
summoned->SetLevel(me->getLevel());
|
||||
summoned->SetLevel(me->GetLevel());
|
||||
|
||||
summoned->SetFaction(me->GetFaction());
|
||||
summons.Summon(summoned);
|
||||
@@ -953,7 +953,7 @@ public:
|
||||
void JustSummoned(Creature* summoned) override
|
||||
{
|
||||
summoned->SetFaction(me->GetFaction());
|
||||
summoned->SetLevel(me->getLevel());
|
||||
summoned->SetLevel(me->GetLevel());
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
@@ -1046,7 +1046,7 @@ public:
|
||||
void JustSummoned(Creature* summoned) override
|
||||
{
|
||||
summoned->SetFaction(me->GetFaction());
|
||||
summoned->SetLevel(me->getLevel());
|
||||
summoned->SetLevel(me->GetLevel());
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
@@ -1327,7 +1327,7 @@ public:
|
||||
|
||||
if ((victimClass == 0) && me->GetVictim())
|
||||
{
|
||||
victimClass = me->EnsureVictim()->getClass();
|
||||
victimClass = me->EnsureVictim()->GetClass();
|
||||
switch (victimClass)
|
||||
{
|
||||
case CLASS_DRUID:
|
||||
|
||||
@@ -424,7 +424,7 @@ public:
|
||||
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
switch (victim->getClass())
|
||||
switch (victim->GetClass())
|
||||
{
|
||||
case CLASS_PRIEST:
|
||||
case CLASS_PALADIN:
|
||||
|
||||
@@ -283,7 +283,7 @@ public:
|
||||
|
||||
soulmodel = target->GetDisplayId();
|
||||
soulholder = target->GetGUID();
|
||||
soulclass = target->getClass();
|
||||
soulclass = target->GetClass();
|
||||
|
||||
DoCast(target, SPELL_STOLEN_SOUL);
|
||||
me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||
|
||||
+1
-1
@@ -97,7 +97,7 @@ public:
|
||||
{
|
||||
summoned->CastSpell(summoned, SPELL_FOCUS_FIRE_VISUAL, false);
|
||||
summoned->SetFaction(me->GetFaction());
|
||||
summoned->SetLevel(me->getLevel());
|
||||
summoned->SetLevel(me->GetLevel());
|
||||
summoned->AddUnitState(UNIT_STATE_ROOT);
|
||||
|
||||
if (Unit* pFocusedTarget = ObjectAccessor::GetUnit(*me, FocusedTargetGUID))
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ class boss_nazan : public CreatureScript
|
||||
{
|
||||
if (summoned && summoned->GetEntry() == NPC_LIQUID_FIRE)
|
||||
{
|
||||
summoned->SetLevel(me->getLevel());
|
||||
summoned->SetLevel(me->GetLevel());
|
||||
summoned->SetFaction(me->GetFaction());
|
||||
summoned->CastSpell(summoned, DUNGEON_MODE(SPELL_SUMMON_LIQUID_FIRE, SPELL_SUMMON_LIQUID_FIRE_H), true);
|
||||
summoned->CastSpell(summoned, SPELL_FIRE_NOVA_VISUAL, true);
|
||||
|
||||
@@ -440,7 +440,7 @@ class boss_alar : public CreatureScript
|
||||
Summoned->SetObjectScale(Summoned->GetObjectScale() * 2.5f);
|
||||
Summoned->SetDisplayId(11686);
|
||||
Summoned->SetFaction(me->GetFaction());
|
||||
Summoned->SetLevel(me->getLevel());
|
||||
Summoned->SetLevel(me->GetLevel());
|
||||
Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ class npc_pet_hunter_snake_trap : public CreatureScript
|
||||
{
|
||||
_isViper = me->GetEntry() == NPC_HUNTER_VIPER ? true : false;
|
||||
|
||||
me->SetMaxHealth(uint32(107 * (me->getLevel() - 40) * 0.025f));
|
||||
me->SetMaxHealth(uint32(107 * (me->GetLevel() - 40) * 0.025f));
|
||||
// Add delta to make them not all hit the same time
|
||||
me->SetBaseAttackTime(BASE_ATTACK, me->GetBaseAttackTime(BASE_ATTACK) + urandms(0,6));
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ class spell_dk_advantage_t10_4p : public AuraScript
|
||||
if (Unit* caster = eventInfo.GetActor())
|
||||
{
|
||||
Player* player = caster->ToPlayer();
|
||||
if (!player || caster->getClass() != CLASS_DEATH_KNIGHT)
|
||||
if (!player || caster->GetClass() != CLASS_DEATH_KNIGHT)
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < player->GetMaxPower(POWER_RUNES); ++i)
|
||||
@@ -367,7 +367,7 @@ class spell_dk_death_gate : public SpellScript
|
||||
|
||||
SpellCastResult CheckClass()
|
||||
{
|
||||
if (GetCaster()->getClass() != CLASS_DEATH_KNIGHT)
|
||||
if (GetCaster()->GetClass() != CLASS_DEATH_KNIGHT)
|
||||
{
|
||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_BE_DEATH_KNIGHT);
|
||||
return SPELL_FAILED_CUSTOM_ERROR;
|
||||
|
||||
@@ -415,7 +415,7 @@ class spell_gen_aura_service_uniform : public AuraScript
|
||||
Unit* target = GetTarget();
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
if (target->getGender() == GENDER_MALE)
|
||||
if (target->GetGender() == GENDER_MALE)
|
||||
target->SetDisplayId(MODEL_GOBLIN_MALE);
|
||||
else
|
||||
target->SetDisplayId(MODEL_GOBLIN_FEMALE);
|
||||
@@ -1154,7 +1154,7 @@ class spell_gen_dalaran_disguise : public SpellScriptLoader
|
||||
{
|
||||
if (Player* player = GetHitPlayer())
|
||||
{
|
||||
uint8 gender = player->getGender();
|
||||
uint8 gender = player->GetGender();
|
||||
|
||||
uint32 spellId = GetSpellInfo()->Id;
|
||||
|
||||
@@ -1567,7 +1567,7 @@ class spell_ethereal_pet_aura : public AuraScript
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
uint32 levelDiff = std::abs(GetTarget()->getLevel() - eventInfo.GetProcTarget()->getLevel());
|
||||
uint32 levelDiff = std::abs(GetTarget()->GetLevel() - eventInfo.GetProcTarget()->GetLevel());
|
||||
return levelDiff <= 9;
|
||||
}
|
||||
|
||||
@@ -2382,7 +2382,7 @@ class spell_gen_orc_disguise : public SpellScript
|
||||
Unit* caster = GetCaster();
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
uint8 gender = target->getGender();
|
||||
uint8 gender = target->GetGender();
|
||||
if (!gender)
|
||||
caster->CastSpell(target, SPELL_ORC_DISGUISE_MALE, true);
|
||||
else
|
||||
@@ -2532,7 +2532,7 @@ class spell_gen_pet_summoned : public SpellScript
|
||||
Player* player = GetCaster()->ToPlayer();
|
||||
if (player->GetLastPetNumber())
|
||||
{
|
||||
PetType newPetType = (player->getClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
||||
PetType newPetType = (player->GetClass() == CLASS_HUNTER) ? HUNTER_PET : SUMMON_PET;
|
||||
Pet* newPet = new Pet(player, newPetType);
|
||||
if (newPet->LoadPetFromDB(player, 0, player->GetLastPetNumber(), true))
|
||||
{
|
||||
@@ -3671,7 +3671,7 @@ class spell_gen_gm_freeze : public AuraScript
|
||||
player->AddUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
// if player class = hunter || warlock remove pet if alive
|
||||
if ((player->getClass() == CLASS_HUNTER) || (player->getClass() == CLASS_WARLOCK))
|
||||
if ((player->GetClass() == CLASS_HUNTER) || (player->GetClass() == CLASS_WARLOCK))
|
||||
{
|
||||
if (Pet* pet = player->GetPet())
|
||||
{
|
||||
@@ -3690,7 +3690,7 @@ class spell_gen_gm_freeze : public AuraScript
|
||||
if (Player* player = GetTarget()->ToPlayer())
|
||||
{
|
||||
// Reset player faction + allow combat + allow duels
|
||||
player->setFactionForRace(player->getRace());
|
||||
player->setFactionForRace(player->GetRace());
|
||||
player->RemoveUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
|
||||
// save player
|
||||
player->SaveToDB();
|
||||
|
||||
@@ -189,13 +189,13 @@ class spell_hallow_end_candy_pirate : public SpellScriptLoader
|
||||
|
||||
void HandleApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
uint32 spell = GetTarget()->getGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
|
||||
uint32 spell = GetTarget()->GetGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
|
||||
GetTarget()->CastSpell(GetTarget(), spell, true);
|
||||
}
|
||||
|
||||
void HandleRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
uint32 spell = GetTarget()->getGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
|
||||
uint32 spell = GetTarget()->GetGender() == GENDER_FEMALE ? SPELL_HALLOWS_END_CANDY_FEMALE_DEFIAS_PIRATE : SPELL_HALLOWS_END_CANDY_MALE_DEFIAS_PIRATE;
|
||||
GetTarget()->RemoveAurasDueToSpell(spell);
|
||||
}
|
||||
|
||||
@@ -258,7 +258,7 @@ class spell_hallow_end_trick : public SpellScriptLoader
|
||||
Unit* caster = GetCaster();
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
uint8 gender = target->getGender();
|
||||
uint8 gender = target->GetGender();
|
||||
uint32 spellId = SPELL_TRICK_BUFF;
|
||||
switch (urand(0, 5))
|
||||
{
|
||||
@@ -426,7 +426,7 @@ public:
|
||||
Unit* target = GetHitUnit();
|
||||
|
||||
uint32 spellId = 0;
|
||||
uint8 gender = target->getGender();
|
||||
uint8 gender = target->GetGender();
|
||||
|
||||
switch (GetSpellInfo()->Id)
|
||||
{
|
||||
|
||||
@@ -579,7 +579,7 @@ class spell_hun_tame_beast : public SpellScriptLoader
|
||||
|
||||
if (Creature* target = GetExplTargetUnit()->ToCreature())
|
||||
{
|
||||
if (target->getLevel() > caster->getLevel())
|
||||
if (target->GetLevel() > caster->GetLevel())
|
||||
return SPELL_FAILED_HIGHLEVEL;
|
||||
|
||||
// use SMSG_PET_TAME_FAILURE?
|
||||
|
||||
@@ -283,7 +283,7 @@ class spell_item_arcane_shroud : public AuraScript
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
int32 diff = GetUnitOwner()->getLevel() - 60;
|
||||
int32 diff = GetUnitOwner()->GetLevel() - 60;
|
||||
if (diff > 0)
|
||||
amount += 2 * diff;
|
||||
}
|
||||
@@ -366,7 +366,7 @@ class spell_item_aura_of_madness : public AuraScript
|
||||
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->getClass()]);
|
||||
uint32 spellId = Trinity::Containers::SelectRandomContainerElement(triggeredSpells[caster->GetClass()]);
|
||||
caster->CastSpell(caster, spellId, aurEff);
|
||||
|
||||
if (roll_chance_i(10))
|
||||
@@ -594,7 +594,7 @@ class spell_item_deathbringers_will : public SpellScriptLoader
|
||||
|
||||
PreventDefaultAction();
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
std::vector<uint32> const& randomSpells = triggeredSpells[caster->getClass()];
|
||||
std::vector<uint32> const& randomSpells = triggeredSpells[caster->GetClass()];
|
||||
if (randomSpells.empty())
|
||||
return;
|
||||
|
||||
@@ -932,7 +932,7 @@ class spell_item_flask_of_the_north : public SpellScript
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
std::vector<uint32> possibleSpells;
|
||||
switch (caster->getClass())
|
||||
switch (caster->GetClass())
|
||||
{
|
||||
case CLASS_WARLOCK:
|
||||
case CLASS_MAGE:
|
||||
@@ -960,7 +960,7 @@ class spell_item_flask_of_the_north : public SpellScript
|
||||
|
||||
if (possibleSpells.empty())
|
||||
{
|
||||
TC_LOG_WARN("spells", "Missing spells for class %u in script spell_item_flask_of_the_north", caster->getClass());
|
||||
TC_LOG_WARN("spells", "Missing spells for class %u in script spell_item_flask_of_the_north", caster->GetClass());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1636,9 +1636,9 @@ class spell_item_savory_deviate_delight : public SpellScript
|
||||
switch (urand(1, 2))
|
||||
{
|
||||
// Flip Out - ninja
|
||||
case 1: spellId = (caster->getGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
|
||||
case 1: spellId = (caster->GetGender() == GENDER_MALE ? SPELL_FLIP_OUT_MALE : SPELL_FLIP_OUT_FEMALE); break;
|
||||
// Yaaarrrr - pirate
|
||||
case 2: spellId = (caster->getGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
|
||||
case 2: spellId = (caster->GetGender() == GENDER_MALE ? SPELL_YAAARRRR_MALE : SPELL_YAAARRRR_FEMALE); break;
|
||||
}
|
||||
caster->CastSpell(caster, spellId, true);
|
||||
}
|
||||
@@ -1690,7 +1690,7 @@ class spell_item_scroll_of_recall : public SpellScript
|
||||
break;
|
||||
}
|
||||
|
||||
if (caster->getLevel() > maxSafeLevel)
|
||||
if (caster->GetLevel() > maxSafeLevel)
|
||||
{
|
||||
caster->CastSpell(caster, SPELL_LOST, true);
|
||||
|
||||
@@ -2157,7 +2157,7 @@ class spell_item_the_eye_of_diminution : public AuraScript
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
int32 diff = GetUnitOwner()->getLevel() - 60;
|
||||
int32 diff = GetUnitOwner()->GetLevel() - 60;
|
||||
if (diff > 0)
|
||||
amount += diff;
|
||||
}
|
||||
@@ -3401,7 +3401,7 @@ class spell_item_soul_preserver : public AuraScript
|
||||
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
|
||||
switch (caster->getClass())
|
||||
switch (caster->GetClass())
|
||||
{
|
||||
case CLASS_DRUID:
|
||||
caster->CastSpell(caster, SPELL_SOUL_PRESERVER_DRUID, aurEff);
|
||||
@@ -3516,7 +3516,7 @@ class spell_item_toy_train_set_pulse : public SpellScript
|
||||
if (Player* target = GetHitUnit()->ToPlayer())
|
||||
{
|
||||
target->HandleEmoteCommand(EMOTE_ONESHOT_TRAIN);
|
||||
if (EmotesTextSoundEntry const* soundEntry = sDB2Manager.GetTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->getRace(), target->getGender(), target->getClass()))
|
||||
if (EmotesTextSoundEntry const* soundEntry = sDB2Manager.GetTextSoundEmoteFor(TEXT_EMOTE_TRAIN, target->GetRace(), target->GetGender(), target->GetClass()))
|
||||
target->PlayDistanceSound(soundEntry->SoundID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -223,7 +223,7 @@ class spell_monk_stagger : public AuraScript
|
||||
Unit* target = GetTarget();
|
||||
float agility = target->GetStat(STAT_AGILITY);
|
||||
float base = CalculatePct(agility, float(effect->GetAmount()));
|
||||
float K = sDB2Manager.EvaluateExpectedStat(ExpectedStatType::ArmorConstant, target->getLevel(), -2, 0, Classes(target->getClass()));
|
||||
float K = sDB2Manager.EvaluateExpectedStat(ExpectedStatType::ArmorConstant, target->GetLevel(), -2, 0, Classes(target->GetClass()));
|
||||
|
||||
float newAmount = (base / (base + K));
|
||||
newAmount *= multiplier;
|
||||
|
||||
@@ -198,7 +198,7 @@ class spell_pal_blessing_of_faith : public SpellScript
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
{
|
||||
uint32 spell_id = 0;
|
||||
switch (unitTarget->getClass())
|
||||
switch (unitTarget->GetClass())
|
||||
{
|
||||
case CLASS_DRUID:
|
||||
spell_id = SPELL_PALADIN_BLESSING_OF_LOWER_CITY_DRUID;
|
||||
@@ -438,7 +438,7 @@ class spell_pal_divine_steed : public SpellScript
|
||||
Unit* caster = GetCaster();
|
||||
|
||||
uint32 spellId = SPELL_PALADIN_DIVINE_STEED_HUMAN;
|
||||
switch (caster->getRace())
|
||||
switch (caster->GetRace())
|
||||
{
|
||||
case RACE_HUMAN:
|
||||
spellId = SPELL_PALADIN_DIVINE_STEED_HUMAN;
|
||||
@@ -1073,7 +1073,7 @@ class spell_pal_t3_6p_bonus : public SpellScriptLoader
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
|
||||
switch (target->getClass())
|
||||
switch (target->GetClass())
|
||||
{
|
||||
case CLASS_PALADIN:
|
||||
case CLASS_PRIEST:
|
||||
|
||||
@@ -256,7 +256,7 @@ public:
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (_tempBonus)
|
||||
{
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel());
|
||||
uint32 healthMod = 0;
|
||||
uint32 baseHealth = pInfo->health;
|
||||
switch (pet->GetEntry())
|
||||
@@ -288,7 +288,7 @@ public:
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel());
|
||||
pet->ToPet()->SetCreateHealth(pInfo->health);
|
||||
}
|
||||
}
|
||||
@@ -400,7 +400,7 @@ public:
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (_tempBonus)
|
||||
{
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel());
|
||||
uint32 manaMod = 0;
|
||||
uint32 baseMana = pInfo->mana;
|
||||
switch (pet->GetEntry())
|
||||
@@ -428,7 +428,7 @@ public:
|
||||
if (Unit* pet = GetUnitOwner())
|
||||
if (pet->IsPet())
|
||||
{
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->getLevel());
|
||||
PetLevelInfo const* pInfo = sObjectMgr->GetPetLevelInfo(pet->GetEntry(), pet->GetLevel());
|
||||
pet->ToPet()->SetCreateMana(pInfo->mana);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -829,7 +829,7 @@ class spell_q10041_q10040_who_are_they : public SpellScriptLoader
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Player* target = GetHitPlayer())
|
||||
{
|
||||
target->CastSpell(target, target->getGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true);
|
||||
target->CastSpell(target, target->GetGender() == GENDER_MALE ? SPELL_MALE_DISGUISE : SPELL_FEMALE_DISGUISE, true);
|
||||
target->CastSpell(target, SPELL_GENERIC_DISGUISE, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1146,7 +1146,7 @@ class spell_sha_t3_6p_bonus : public SpellScriptLoader
|
||||
Unit* caster = eventInfo.GetActor();
|
||||
Unit* target = eventInfo.GetProcTarget();
|
||||
|
||||
switch (target->getClass())
|
||||
switch (target->GetClass())
|
||||
{
|
||||
case CLASS_PALADIN:
|
||||
case CLASS_PRIEST:
|
||||
|
||||
@@ -78,11 +78,11 @@ class DuelResetScript : public PlayerScript
|
||||
loser->RestoreHealthAfterDuel();
|
||||
|
||||
// check if player1 class uses mana
|
||||
if (winner->GetPowerType() == POWER_MANA || winner->getClass() == CLASS_DRUID)
|
||||
if (winner->GetPowerType() == POWER_MANA || winner->GetClass() == CLASS_DRUID)
|
||||
winner->RestoreManaAfterDuel();
|
||||
|
||||
// check if player2 class uses mana
|
||||
if (loser->GetPowerType() == POWER_MANA || loser->getClass() == CLASS_DRUID)
|
||||
if (loser->GetPowerType() == POWER_MANA || loser->GetClass() == CLASS_DRUID)
|
||||
loser->RestoreManaAfterDuel();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1170,7 +1170,7 @@ public:
|
||||
Creature* target = GetClosestCreatureWithEntry(player, NPC_OUTHOUSE_BUNNY, 3.0f);
|
||||
if (target)
|
||||
{
|
||||
target->AI()->SetData(1, player->getGender());
|
||||
target->AI()->SetData(1, player->GetGender());
|
||||
me->CastSpell(target, SPELL_INDISPOSED_III);
|
||||
}
|
||||
me->CastSpell(player, SPELL_INDISPOSED);
|
||||
|
||||
@@ -397,7 +397,7 @@ class item_generic_limit_chance_above_60 : public ItemScript
|
||||
bool OnCastItemCombatSpell(Player* player, Unit* victim, SpellInfo const* /*spellInfo*/, Item* /*item*/) override
|
||||
{
|
||||
// spell proc chance gets severely reduced on victims > 60 (formula unknown)
|
||||
if (victim->getLevel() > 60)
|
||||
if (victim->GetLevel() > 60)
|
||||
{
|
||||
// gives ~0.1% proc chance at lvl 70
|
||||
float const lvlPenaltyFactor = 9.93f;
|
||||
|
||||
@@ -246,7 +246,7 @@ int32 DoHighUnlearnCost(Player* /*player*/) //tailor, alchemy
|
||||
|
||||
int32 DoMedUnlearnCost(Player* player) //blacksmith, leatherwork
|
||||
{
|
||||
uint8 level = player->getLevel();
|
||||
uint8 level = player->GetLevel();
|
||||
if (level < 51)
|
||||
return 250000;
|
||||
else if (level < 66)
|
||||
@@ -257,7 +257,7 @@ int32 DoMedUnlearnCost(Player* player) //blacksmith, leather
|
||||
|
||||
int32 DoLowUnlearnCost(Player* player) //blacksmith
|
||||
{
|
||||
uint8 level = player->getLevel();
|
||||
uint8 level = player->GetLevel();
|
||||
if (level < 66)
|
||||
return 50000;
|
||||
else
|
||||
@@ -449,7 +449,7 @@ public:
|
||||
if (me->IsTrainer())
|
||||
AddGossipItemFor(player, GossipOptionIcon::Trainer, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
|
||||
|
||||
if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY) >= 350 && player->getLevel() > 67)
|
||||
if (player->HasSkill(SKILL_ALCHEMY) && player->GetBaseSkillValue(SKILL_ALCHEMY) >= 350 && player->GetLevel() > 67)
|
||||
{
|
||||
if (player->GetQuestRewardStatus(Q_MASTER_TRANSMUTE) || player->GetQuestRewardStatus(Q_MASTER_ELIXIR) || player->GetQuestRewardStatus(Q_MASTER_POTION))
|
||||
{
|
||||
@@ -652,7 +652,7 @@ public:
|
||||
}
|
||||
}
|
||||
//WEAPONSMITH SPEC
|
||||
if (player->HasSpell(S_WEAPON) && player->getLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250)
|
||||
if (player->HasSpell(S_WEAPON) && player->GetLevel() > 49 && player->GetBaseSkillValue(SKILL_BLACKSMITHING) >= 250)
|
||||
{
|
||||
switch (creatureId)
|
||||
{
|
||||
@@ -989,7 +989,7 @@ public:
|
||||
if (me->IsTrainer())
|
||||
AddGossipItemFor(player, GossipOptionIcon::Trainer, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
|
||||
|
||||
if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 250 && player->getLevel() > 49)
|
||||
if (player->HasSkill(SKILL_LEATHERWORKING) && player->GetBaseSkillValue(SKILL_LEATHERWORKING) >= 250 && player->GetLevel() > 49)
|
||||
{
|
||||
switch (me->GetEntry())
|
||||
{
|
||||
@@ -1125,7 +1125,7 @@ public:
|
||||
AddGossipItemFor(player, GossipOptionIcon::Trainer, GOSSIP_TEXT_TRAIN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRAIN);
|
||||
|
||||
//TAILORING SPEC
|
||||
if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 350 && player->getLevel() > 59)
|
||||
if (player->HasSkill(SKILL_TAILORING) && player->GetBaseSkillValue(SKILL_TAILORING) >= 350 && player->GetLevel() > 59)
|
||||
{
|
||||
if (player->GetQuestRewardStatus(10831) || player->GetQuestRewardStatus(10832) || player->GetQuestRewardStatus(10833))
|
||||
{
|
||||
|
||||
@@ -1699,11 +1699,11 @@ enum TournamentPennantSpells
|
||||
case NPC_ARGENT_WARHORSE:
|
||||
{
|
||||
if (player->HasAchieved(ACHIEVEMENT_CHAMPION_ALLIANCE) || player->HasAchieved(ACHIEVEMENT_CHAMPION_HORDE))
|
||||
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION;
|
||||
return player->GetClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_CHAMPION : SPELL_PENNANT_ARGENT_CRUSADE_CHAMPION;
|
||||
else if (player->HasAchieved(ACHIEVEMENT_ARGENT_VALOR))
|
||||
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT;
|
||||
return player->GetClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_VALIANT : SPELL_PENNANT_ARGENT_CRUSADE_VALIANT;
|
||||
else
|
||||
return player->getClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT;
|
||||
return player->GetClass() == CLASS_DEATH_KNIGHT ? SPELL_PENNANT_EBON_BLADE_ASPIRANT : SPELL_PENNANT_ARGENT_CRUSADE_ASPIRANT;
|
||||
}
|
||||
default:
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user