|
|
|
@@ -425,7 +425,7 @@ Player::Player (WorldSession *session): Unit(), m_achievementMgr(this), m_reputa
|
|
|
|
|
|
|
|
|
|
m_areaUpdateId = 0;
|
|
|
|
|
|
|
|
|
|
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
|
|
|
|
m_nextSave = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE);
|
|
|
|
|
|
|
|
|
|
clearResurrectRequestData();
|
|
|
|
|
|
|
|
|
@@ -701,7 +701,7 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
|
|
|
|
|
|
|
|
|
SetUInt32Value(UNIT_FIELD_BYTES_0, (RaceClassGender | (powertype << 24)));
|
|
|
|
|
InitDisplayIds();
|
|
|
|
|
if (sWorld.getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld.getConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
|
|
|
|
|
if (sWorld.getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld.getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
|
|
|
|
|
{
|
|
|
|
|
SetByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP);
|
|
|
|
|
SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PVP_ATTACKABLE);
|
|
|
|
@@ -733,12 +733,12 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
|
|
|
|
|
|
|
|
|
// set starting level
|
|
|
|
|
uint32 start_level = getClass() != CLASS_DEATH_KNIGHT
|
|
|
|
|
? sWorld.getConfig(CONFIG_START_PLAYER_LEVEL)
|
|
|
|
|
: sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
|
|
|
|
? sWorld.getIntConfig(CONFIG_START_PLAYER_LEVEL)
|
|
|
|
|
: sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL);
|
|
|
|
|
|
|
|
|
|
if (GetSession()->GetSecurity() >= SEC_MODERATOR)
|
|
|
|
|
{
|
|
|
|
|
uint32 gm_level = sWorld.getConfig(CONFIG_START_GM_LEVEL);
|
|
|
|
|
uint32 gm_level = sWorld.getIntConfig(CONFIG_START_GM_LEVEL);
|
|
|
|
|
if (gm_level > start_level)
|
|
|
|
|
start_level = gm_level;
|
|
|
|
|
}
|
|
|
|
@@ -747,19 +747,19 @@ bool Player::Create(uint32 guidlow, const std::string& name, uint8 race, uint8 c
|
|
|
|
|
|
|
|
|
|
InitRunes();
|
|
|
|
|
|
|
|
|
|
SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld.getConfig(CONFIG_START_PLAYER_MONEY));
|
|
|
|
|
SetHonorPoints(sWorld.getConfig(CONFIG_START_HONOR_POINTS));
|
|
|
|
|
SetArenaPoints(sWorld.getConfig(CONFIG_START_ARENA_POINTS));
|
|
|
|
|
SetUInt32Value(PLAYER_FIELD_COINAGE, sWorld.getIntConfig(CONFIG_START_PLAYER_MONEY));
|
|
|
|
|
SetHonorPoints(sWorld.getIntConfig(CONFIG_START_HONOR_POINTS));
|
|
|
|
|
SetArenaPoints(sWorld.getIntConfig(CONFIG_START_ARENA_POINTS));
|
|
|
|
|
|
|
|
|
|
// start with every map explored
|
|
|
|
|
if (sWorld.getConfig(CONFIG_START_ALL_EXPLORED))
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_START_ALL_EXPLORED))
|
|
|
|
|
{
|
|
|
|
|
for (uint8 i=0; i<PLAYER_EXPLORED_ZONES_SIZE; i++)
|
|
|
|
|
SetFlag(PLAYER_EXPLORED_ZONES_1+i,0xFFFFFFFF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//Reputations if "StartAllReputation" is enabled, -- TODO: Fix this in a better way
|
|
|
|
|
if (sWorld.getConfig(CONFIG_START_ALL_REP))
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_START_ALL_REP))
|
|
|
|
|
{
|
|
|
|
|
GetReputationMgr().SetReputation(sFactionStore.LookupEntry(942),42999);
|
|
|
|
|
GetReputationMgr().SetReputation(sFactionStore.LookupEntry(935),42999);
|
|
|
|
@@ -1041,7 +1041,7 @@ int32 Player::getMaxTimer(MirrorTimerType timer)
|
|
|
|
|
return MINUTE*IN_MILLISECONDS;
|
|
|
|
|
case BREATH_TIMER:
|
|
|
|
|
{
|
|
|
|
|
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld.getConfig(CONFIG_DISABLE_BREATHING)))
|
|
|
|
|
if (!isAlive() || HasAuraType(SPELL_AURA_WATER_BREATHING) || GetSession()->GetSecurity() >= AccountTypes(sWorld.getIntConfig(CONFIG_DISABLE_BREATHING)))
|
|
|
|
|
return DISABLED_MIRROR_TIMER;
|
|
|
|
|
int32 UnderWaterTime = 3*MINUTE*IN_MILLISECONDS;
|
|
|
|
|
AuraEffectList const& mModWaterBreathing = GetAuraEffectsByType(SPELL_AURA_MOD_WATER_BREATHING);
|
|
|
|
@@ -1636,7 +1636,7 @@ bool Player::BuildEnumData(QueryResult_AutoPtr result, WorldPacket * p_data)
|
|
|
|
|
char_flags |= CHARACTER_FLAG_GHOST;
|
|
|
|
|
if (atLoginFlags & AT_LOGIN_RENAME)
|
|
|
|
|
char_flags |= CHARACTER_FLAG_RENAME;
|
|
|
|
|
if (sWorld.getConfig(CONFIG_DECLINED_NAMES_USED))
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_DECLINED_NAMES_USED))
|
|
|
|
|
{
|
|
|
|
|
if (!fields[20].GetCppString().empty())
|
|
|
|
|
char_flags |= CHARACTER_FLAG_DECLINED;
|
|
|
|
@@ -2537,7 +2537,7 @@ void Player::SetGMVisible(bool on)
|
|
|
|
|
|
|
|
|
|
bool Player::IsGroupVisibleFor(Player* p) const
|
|
|
|
|
{
|
|
|
|
|
switch(sWorld.getConfig(CONFIG_GROUP_VISIBILITY))
|
|
|
|
|
switch(sWorld.getIntConfig(CONFIG_GROUP_VISIBILITY))
|
|
|
|
|
{
|
|
|
|
|
default: return IsInSameGroupWith(p);
|
|
|
|
|
case 1: return IsInSameRaidWith(p);
|
|
|
|
@@ -2633,7 +2633,7 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate)
|
|
|
|
|
// Favored experience increase END
|
|
|
|
|
|
|
|
|
|
// XP to money conversion processed in Player::RewardQuest
|
|
|
|
|
if (level >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
if (level >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
uint32 bonus_xp = 0;
|
|
|
|
@@ -2651,11 +2651,11 @@ void Player::GiveXP(uint32 xp, Unit *victim, float group_rate)
|
|
|
|
|
uint32 nextLvlXP = GetUInt32Value(PLAYER_NEXT_LEVEL_XP);
|
|
|
|
|
uint32 newXP = curXP + xp + bonus_xp;
|
|
|
|
|
|
|
|
|
|
while (newXP >= nextLvlXP && level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
while (newXP >= nextLvlXP && level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
{
|
|
|
|
|
newXP -= nextLvlXP;
|
|
|
|
|
|
|
|
|
|
if (level < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
if (level < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
GiveLevel(level + 1);
|
|
|
|
|
|
|
|
|
|
level = getLevel();
|
|
|
|
@@ -2722,7 +2722,7 @@ void Player::GiveLevel(uint8 level)
|
|
|
|
|
|
|
|
|
|
UpdateAllStats();
|
|
|
|
|
|
|
|
|
|
if (sWorld.getConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
|
|
|
|
|
UpdateSkillsToMaxSkillsForLevel();
|
|
|
|
|
|
|
|
|
|
// set current level health and mana/energy to maximum after applying all mods.
|
|
|
|
@@ -2766,7 +2766,7 @@ void Player::InitTalentForLevel()
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (level < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL) || m_specsCount == 0)
|
|
|
|
|
if (level < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL) || m_specsCount == 0)
|
|
|
|
|
{
|
|
|
|
|
m_specsCount = 1;
|
|
|
|
|
m_activeSpec = 0;
|
|
|
|
@@ -2802,7 +2802,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
|
|
|
|
PlayerLevelInfo info;
|
|
|
|
|
sObjectMgr.GetPlayerLevelInfo(getRace(),getClass(),getLevel(),&info);
|
|
|
|
|
|
|
|
|
|
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL));
|
|
|
|
|
SetUInt32Value(PLAYER_FIELD_MAX_LEVEL, sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL));
|
|
|
|
|
SetUInt32Value(PLAYER_NEXT_LEVEL_XP, sObjectMgr.GetXPForLevel(getLevel()));
|
|
|
|
|
|
|
|
|
|
// reset before any aura state sources (health set/aura apply)
|
|
|
|
@@ -3657,7 +3657,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
|
|
|
|
if (sSpellMgr.IsPrimaryProfessionFirstRankSpell(spell_id))
|
|
|
|
|
{
|
|
|
|
|
uint32 freeProfs = GetFreePrimaryProfessionPoints()+1;
|
|
|
|
|
if (freeProfs <= sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
|
|
|
|
|
if (freeProfs <= sWorld.getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL))
|
|
|
|
|
SetFreePrimaryProfessions(freeProfs);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -3788,7 +3788,7 @@ void Player::removeSpell(uint32 spell_id, bool disabled, bool learn_low_rank)
|
|
|
|
|
if (spell_id == 46917 && m_canTitanGrip)
|
|
|
|
|
SetCanTitanGrip(false);
|
|
|
|
|
|
|
|
|
|
if (sWorld.getConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_OFFHAND_CHECK_AT_SPELL_UNLEARN))
|
|
|
|
|
AutoUnequipOffhandIfNeed();
|
|
|
|
|
|
|
|
|
|
// remove from spell book if not replaced by lesser rank
|
|
|
|
@@ -4023,7 +4023,7 @@ bool Player::resetTalents(bool no_cost)
|
|
|
|
|
|
|
|
|
|
uint32 cost = 0;
|
|
|
|
|
|
|
|
|
|
if (!no_cost && !sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST))
|
|
|
|
|
if (!no_cost && !sWorld.getBoolConfig(CONFIG_NO_RESET_TALENT_COST))
|
|
|
|
|
{
|
|
|
|
|
cost = resetTalentsCost();
|
|
|
|
|
|
|
|
|
@@ -4393,8 +4393,8 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
|
|
|
|
if (accountId == 0)
|
|
|
|
|
updateRealmChars = false;
|
|
|
|
|
|
|
|
|
|
uint32 charDelete_method = sWorld.getConfig(CONFIG_CHARDELETE_METHOD);
|
|
|
|
|
uint32 charDelete_minLvl = sWorld.getConfig(CONFIG_CHARDELETE_MIN_LEVEL);
|
|
|
|
|
uint32 charDelete_method = sWorld.getIntConfig(CONFIG_CHARDELETE_METHOD);
|
|
|
|
|
uint32 charDelete_minLvl = sWorld.getIntConfig(CONFIG_CHARDELETE_MIN_LEVEL);
|
|
|
|
|
|
|
|
|
|
// if we want to finally delete the character or the character does not meet the level requirement,
|
|
|
|
|
// we set it to mode CHAR_DELETE_REMOVE
|
|
|
|
@@ -4576,7 +4576,7 @@ void Player::DeleteFromDB(uint64 playerguid, uint32 accountId, bool updateRealmC
|
|
|
|
|
*/
|
|
|
|
|
void Player::DeleteOldCharacters()
|
|
|
|
|
{
|
|
|
|
|
uint32 keepDays = sWorld.getConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
|
|
|
|
uint32 keepDays = sWorld.getIntConfig(CONFIG_CHARDELETE_KEEP_DAYS);
|
|
|
|
|
if (!keepDays)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@@ -4731,7 +4731,7 @@ void Player::ResurrectPlayer(float restore_percent, bool applySickness)
|
|
|
|
|
//Characters from level 11-19 will suffer from one minute of sickness
|
|
|
|
|
//for each level they are above 10.
|
|
|
|
|
//Characters level 20 and up suffer from ten minutes of sickness.
|
|
|
|
|
int32 startLevel = sWorld.getConfig(CONFIG_DEATH_SICKNESS_LEVEL);
|
|
|
|
|
int32 startLevel = sWorld.getIntConfig(CONFIG_DEATH_SICKNESS_LEVEL);
|
|
|
|
|
|
|
|
|
|
if (int32(getLevel()) >= startLevel)
|
|
|
|
|
{
|
|
|
|
@@ -5240,7 +5240,7 @@ void Player::LeaveLFGChannel()
|
|
|
|
|
|
|
|
|
|
void Player::UpdateDefense()
|
|
|
|
|
{
|
|
|
|
|
uint32 defense_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_DEFENSE);
|
|
|
|
|
uint32 defense_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_DEFENSE);
|
|
|
|
|
|
|
|
|
|
if (UpdateSkill(SKILL_DEFENSE,defense_skill_gain))
|
|
|
|
|
{
|
|
|
|
@@ -5660,12 +5660,12 @@ bool Player::UpdateSkill(uint32 skill_id, uint32 step)
|
|
|
|
|
inline int SkillGainChance(uint32 SkillValue, uint32 GrayLevel, uint32 GreenLevel, uint32 YellowLevel)
|
|
|
|
|
{
|
|
|
|
|
if (SkillValue >= GrayLevel)
|
|
|
|
|
return sWorld.getConfig(CONFIG_SKILL_CHANCE_GREY)*10;
|
|
|
|
|
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_GREY)*10;
|
|
|
|
|
if (SkillValue >= GreenLevel)
|
|
|
|
|
return sWorld.getConfig(CONFIG_SKILL_CHANCE_GREEN)*10;
|
|
|
|
|
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_GREEN)*10;
|
|
|
|
|
if (SkillValue >= YellowLevel)
|
|
|
|
|
return sWorld.getConfig(CONFIG_SKILL_CHANCE_YELLOW)*10;
|
|
|
|
|
return sWorld.getConfig(CONFIG_SKILL_CHANCE_ORANGE)*10;
|
|
|
|
|
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_YELLOW)*10;
|
|
|
|
|
return sWorld.getIntConfig(CONFIG_SKILL_CHANCE_ORANGE)*10;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Player::UpdateCraftSkill(uint32 spellid)
|
|
|
|
@@ -5688,7 +5688,7 @@ bool Player::UpdateCraftSkill(uint32 spellid)
|
|
|
|
|
learnSpell(discoveredSpell, false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32 craft_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_CRAFTING);
|
|
|
|
|
uint32 craft_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_CRAFTING);
|
|
|
|
|
|
|
|
|
|
return UpdateSkillPro(_spell_idx->second->skillId, SkillGainChance(SkillValue,
|
|
|
|
|
_spell_idx->second->max_value,
|
|
|
|
@@ -5704,7 +5704,7 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
|
|
|
|
|
{
|
|
|
|
|
sLog.outDebug("UpdateGatherSkill(SkillId %d SkillLevel %d RedLevel %d)", SkillId, SkillValue, RedLevel);
|
|
|
|
|
|
|
|
|
|
uint32 gathering_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_GATHERING);
|
|
|
|
|
uint32 gathering_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_GATHERING);
|
|
|
|
|
|
|
|
|
|
// For skinning and Mining chance decrease with level. 1-74 - no decrease, 75-149 - 2 times, 225-299 - 8 times
|
|
|
|
|
switch (SkillId)
|
|
|
|
@@ -5715,15 +5715,15 @@ bool Player::UpdateGatherSkill(uint32 SkillId, uint32 SkillValue, uint32 RedLeve
|
|
|
|
|
case SKILL_INSCRIPTION:
|
|
|
|
|
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
|
|
|
|
case SKILL_SKINNING:
|
|
|
|
|
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0)
|
|
|
|
|
if (sWorld.getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS) == 0)
|
|
|
|
|
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
|
|
|
|
else
|
|
|
|
|
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain);
|
|
|
|
|
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getIntConfig(CONFIG_SKILL_CHANCE_SKINNING_STEPS)), gathering_skill_gain);
|
|
|
|
|
case SKILL_MINING:
|
|
|
|
|
if (sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0)
|
|
|
|
|
if (sWorld.getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS) == 0)
|
|
|
|
|
return UpdateSkillPro(SkillId, SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator,gathering_skill_gain);
|
|
|
|
|
else
|
|
|
|
|
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain);
|
|
|
|
|
return UpdateSkillPro(SkillId, (SkillGainChance(SkillValue, RedLevel+100, RedLevel+50, RedLevel+25)*Multiplicator) >> (SkillValue/sWorld.getIntConfig(CONFIG_SKILL_CHANCE_MINING_STEPS)),gathering_skill_gain);
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@@ -5736,7 +5736,7 @@ bool Player::UpdateFishingSkill()
|
|
|
|
|
|
|
|
|
|
int32 chance = SkillValue < 75 ? 100 : 2500/(SkillValue-50);
|
|
|
|
|
|
|
|
|
|
uint32 gathering_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_GATHERING);
|
|
|
|
|
uint32 gathering_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_GATHERING);
|
|
|
|
|
|
|
|
|
|
return UpdateSkillPro(SKILL_FISHING,chance*10,gathering_skill_gain);
|
|
|
|
|
}
|
|
|
|
@@ -5816,7 +5816,7 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType)
|
|
|
|
|
if (pVictim && pVictim->GetTypeId() == TYPEID_UNIT && (pVictim->ToCreature()->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
uint32 weapon_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_WEAPON);
|
|
|
|
|
uint32 weapon_skill_gain = sWorld.getIntConfig(CONFIG_SKILL_GAIN_WEAPON);
|
|
|
|
|
|
|
|
|
|
switch(attType)
|
|
|
|
|
{
|
|
|
|
@@ -5904,7 +5904,7 @@ void Player::UpdateSkillsForLevel()
|
|
|
|
|
uint16 maxconfskill = sWorld.GetConfigMaxSkillValue();
|
|
|
|
|
uint32 maxSkill = GetMaxSkillValueForLevel();
|
|
|
|
|
|
|
|
|
|
bool alwaysMaxSkill = sWorld.getConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL);
|
|
|
|
|
bool alwaysMaxSkill = sWorld.getBoolConfig(CONFIG_ALWAYS_MAX_SKILL_FOR_LEVEL);
|
|
|
|
|
|
|
|
|
|
for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end(); ++itr)
|
|
|
|
|
{
|
|
|
|
@@ -6412,7 +6412,7 @@ void Player::CheckAreaExploreAndOutdoor()
|
|
|
|
|
bool isOutdoor;
|
|
|
|
|
uint16 areaFlag = GetBaseMap()->GetAreaFlag(GetPositionX(),GetPositionY(),GetPositionZ(), &isOutdoor);
|
|
|
|
|
|
|
|
|
|
if (sWorld.getConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor)
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_VMAP_INDOOR_CHECK) && !isOutdoor)
|
|
|
|
|
RemoveAurasWithAttribute(SPELL_ATTR_OUTDOORS_ONLY);
|
|
|
|
|
|
|
|
|
|
if (areaFlag==0xffff)
|
|
|
|
@@ -6442,7 +6442,7 @@ void Player::CheckAreaExploreAndOutdoor()
|
|
|
|
|
else if (p->area_level > 0)
|
|
|
|
|
{
|
|
|
|
|
uint32 area = p->ID;
|
|
|
|
|
if (getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
if (getLevel() >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
{
|
|
|
|
|
SendExplorationExperience(area,0);
|
|
|
|
|
}
|
|
|
|
@@ -6837,7 +6837,7 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (sWorld.getConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken)
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_PVP_TOKEN_ENABLE) && pvptoken)
|
|
|
|
|
{
|
|
|
|
|
if (!uVictim || uVictim == this || uVictim->HasAuraType(SPELL_AURA_NO_PVP_CREDIT))
|
|
|
|
|
return true;
|
|
|
|
@@ -6845,15 +6845,15 @@ bool Player::RewardHonor(Unit *uVictim, uint32 groupsize, int32 honor, bool pvpt
|
|
|
|
|
if (uVictim->GetTypeId() == TYPEID_PLAYER)
|
|
|
|
|
{
|
|
|
|
|
// Check if allowed to receive it in current map
|
|
|
|
|
uint8 MapType = sWorld.getConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
|
|
|
|
|
uint8 MapType = sWorld.getIntConfig(CONFIG_PVP_TOKEN_MAP_TYPE);
|
|
|
|
|
if ((MapType == 1 && !InBattleground() && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
|
|
|
|
|
|| (MapType == 2 && !HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP))
|
|
|
|
|
|| (MapType == 3 && !InBattleground()))
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
uint32 noSpaceForCount = 0;
|
|
|
|
|
uint32 itemId = sWorld.getConfig(CONFIG_PVP_TOKEN_ID);
|
|
|
|
|
int32 count = sWorld.getConfig(CONFIG_PVP_TOKEN_COUNT);
|
|
|
|
|
uint32 itemId = sWorld.getIntConfig(CONFIG_PVP_TOKEN_ID);
|
|
|
|
|
int32 count = sWorld.getIntConfig(CONFIG_PVP_TOKEN_COUNT);
|
|
|
|
|
|
|
|
|
|
// check space and find places
|
|
|
|
|
ItemPosCountVec dest;
|
|
|
|
@@ -6881,26 +6881,26 @@ void Player::ModifyHonorPoints(int32 value)
|
|
|
|
|
{
|
|
|
|
|
if (value < 0)
|
|
|
|
|
{
|
|
|
|
|
if (GetHonorPoints() > sWorld.getConfig(CONFIG_MAX_HONOR_POINTS))
|
|
|
|
|
SetHonorPoints(sWorld.getConfig(CONFIG_MAX_HONOR_POINTS) + value);
|
|
|
|
|
if (GetHonorPoints() > sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS))
|
|
|
|
|
SetHonorPoints(sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS) + value);
|
|
|
|
|
else
|
|
|
|
|
SetHonorPoints(GetHonorPoints() > uint32(-value) ? GetHonorPoints() + value : 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
SetHonorPoints(GetHonorPoints() < sWorld.getConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld.getConfig(CONFIG_MAX_HONOR_POINTS));
|
|
|
|
|
SetHonorPoints(GetHonorPoints() < sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS) - value ? GetHonorPoints() + value : sWorld.getIntConfig(CONFIG_MAX_HONOR_POINTS));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::ModifyArenaPoints(int32 value)
|
|
|
|
|
{
|
|
|
|
|
if (value < 0)
|
|
|
|
|
{
|
|
|
|
|
if (GetArenaPoints() > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))
|
|
|
|
|
SetArenaPoints(sWorld.getConfig(CONFIG_MAX_ARENA_POINTS) + value);
|
|
|
|
|
if (GetArenaPoints() > sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS))
|
|
|
|
|
SetArenaPoints(sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS) + value);
|
|
|
|
|
else
|
|
|
|
|
SetArenaPoints(GetArenaPoints() > uint32(-value) ? GetArenaPoints() + value : 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
SetArenaPoints(GetArenaPoints() < sWorld.getConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld.getConfig(CONFIG_MAX_ARENA_POINTS));
|
|
|
|
|
SetArenaPoints(GetArenaPoints() < sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS) - value ? GetArenaPoints() + value : sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32 Player::GetGuildIdFromDB(uint64 guid)
|
|
|
|
@@ -7009,7 +7009,7 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
|
|
|
|
if (!zone)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (sWorld.getConfig(CONFIG_WEATHER))
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_WEATHER))
|
|
|
|
|
{
|
|
|
|
|
Weather *wth = sWeatherMgr.FindWeather(zone->ID);
|
|
|
|
|
if (wth)
|
|
|
|
@@ -7238,7 +7238,7 @@ void Player::DuelComplete(DuelCompleteType type)
|
|
|
|
|
duel->opponent->ClearComboPoints();
|
|
|
|
|
|
|
|
|
|
// Honor points after duel (the winner) - ImpConfig
|
|
|
|
|
if (uint32 amount = sWorld.getConfig(CONFIG_HONOR_AFTER_DUEL))
|
|
|
|
|
if (uint32 amount = sWorld.getIntConfig(CONFIG_HONOR_AFTER_DUEL))
|
|
|
|
|
duel->opponent->RewardHonor(NULL,1,amount);
|
|
|
|
|
|
|
|
|
|
//cleanups
|
|
|
|
@@ -8664,9 +8664,9 @@ void Player::SendInitWorldStates(uint32 zoneid, uint32 areaid)
|
|
|
|
|
data << uint32(0x8d4) << uint32(0x0); // 5
|
|
|
|
|
data << uint32(0x8d3) << uint32(0x0); // 6
|
|
|
|
|
// 7 1 - Arena season in progress, 0 - end of season
|
|
|
|
|
data << uint32(0xC77) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_IN_PROGRESS));
|
|
|
|
|
data << uint32(0xC77) << uint32(sWorld.getBoolConfig(CONFIG_ARENA_SEASON_IN_PROGRESS));
|
|
|
|
|
// 8 Arena season id
|
|
|
|
|
data << uint32(0xF3D) << uint32(sWorld.getConfig(CONFIG_ARENA_SEASON_ID));
|
|
|
|
|
data << uint32(0xF3D) << uint32(sWorld.getIntConfig(CONFIG_ARENA_SEASON_ID));
|
|
|
|
|
|
|
|
|
|
if (mapid == 530) // Outland
|
|
|
|
|
{
|
|
|
|
@@ -9189,7 +9189,7 @@ void Player::SendTalentWipeConfirm(uint64 guid)
|
|
|
|
|
{
|
|
|
|
|
WorldPacket data(MSG_TALENT_WIPE_CONFIRM, (8+4));
|
|
|
|
|
data << uint64(guid);
|
|
|
|
|
uint32 cost = sWorld.getConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost();
|
|
|
|
|
uint32 cost = sWorld.getBoolConfig(CONFIG_NO_RESET_TALENT_COST) ? 0 : resetTalentsCost();
|
|
|
|
|
data << cost;
|
|
|
|
|
GetSession()->SendPacket(&data);
|
|
|
|
|
}
|
|
|
|
@@ -13485,7 +13485,7 @@ void Player::PrepareGossipMenu(WorldObject *pSource, uint32 menuId, bool showQue
|
|
|
|
|
bCanTalk = false;
|
|
|
|
|
break;
|
|
|
|
|
case GOSSIP_OPTION_LEARNDUALSPEC:
|
|
|
|
|
if (!(GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(this) && !(getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
|
|
|
|
if (!(GetSpecsCount() == 1 && pCreature->isCanTrainingAndResetTalentsOf(this) && !(getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL))))
|
|
|
|
|
bCanTalk = false;
|
|
|
|
|
break;
|
|
|
|
|
case GOSSIP_OPTION_UNLEARNTALENTS:
|
|
|
|
@@ -13697,7 +13697,7 @@ void Player::OnGossipSelect(WorldObject* pSource, uint32 gossipListId, uint32 me
|
|
|
|
|
GetSession()->SendTrainerList(guid);
|
|
|
|
|
break;
|
|
|
|
|
case GOSSIP_OPTION_LEARNDUALSPEC:
|
|
|
|
|
if (GetSpecsCount() == 1 && !(getLevel() < sWorld.getConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
|
|
|
|
|
if (GetSpecsCount() == 1 && !(getLevel() < sWorld.getIntConfig(CONFIG_MIN_DUALSPEC_LEVEL)))
|
|
|
|
|
{
|
|
|
|
|
if (!HasEnoughMoney(10000000))
|
|
|
|
|
{
|
|
|
|
@@ -14037,7 +14037,7 @@ bool Player::CanSeeStartQuest(Quest const *pQuest)
|
|
|
|
|
SatisfyQuestPrevChain(pQuest, false) && SatisfyQuestDay(pQuest, false) && SatisfyQuestWeek(pQuest, false) &&
|
|
|
|
|
!sDisableMgr.IsDisabledFor(DISABLE_TYPE_QUEST, pQuest->GetQuestId(), this))
|
|
|
|
|
{
|
|
|
|
|
return getLevel() + sWorld.getConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel();
|
|
|
|
|
return getLevel() + sWorld.getIntConfig(CONFIG_QUEST_HIGH_LEVEL_HIDE_DIFF) >= pQuest->GetMinLevel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
@@ -14420,7 +14420,7 @@ void Player::RewardQuest(Quest const *pQuest, uint32 reward, Object* questGiver,
|
|
|
|
|
for (Unit::AuraEffectList::const_iterator i = ModXPPctAuras.begin(); i != ModXPPctAuras.end(); ++i)
|
|
|
|
|
XP = uint32(XP*(1.0f + (*i)->GetAmount() / 100.0f));
|
|
|
|
|
|
|
|
|
|
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
if (getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
GiveXP(XP, NULL);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
@@ -15583,7 +15583,7 @@ void Player::SendQuestReward(Quest const *pQuest, uint32 XP, Object * questGiver
|
|
|
|
|
WorldPacket data(SMSG_QUESTGIVER_QUEST_COMPLETE, (4+4+4+4+4));
|
|
|
|
|
data << uint32(questid);
|
|
|
|
|
|
|
|
|
|
if (getLevel() < sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
if (getLevel() < sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
{
|
|
|
|
|
data << uint32(XP);
|
|
|
|
|
data << uint32(pQuest->GetRewOrReqMoney());
|
|
|
|
@@ -15992,8 +15992,8 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|
|
|
|
_LoadArenaTeamInfo(holder->GetResult(PLAYER_LOGIN_QUERY_LOADARENAINFO));
|
|
|
|
|
|
|
|
|
|
uint32 arena_currency = fields[39].GetUInt32();
|
|
|
|
|
if (arena_currency > sWorld.getConfig(CONFIG_MAX_ARENA_POINTS))
|
|
|
|
|
arena_currency = sWorld.getConfig(CONFIG_MAX_ARENA_POINTS);
|
|
|
|
|
if (arena_currency > sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS))
|
|
|
|
|
arena_currency = sWorld.getIntConfig(CONFIG_MAX_ARENA_POINTS);
|
|
|
|
|
|
|
|
|
|
SetArenaPoints(arena_currency);
|
|
|
|
|
|
|
|
|
@@ -16429,7 +16429,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|
|
|
|
// GM state
|
|
|
|
|
if (GetSession()->GetSecurity() > SEC_PLAYER)
|
|
|
|
|
{
|
|
|
|
|
switch (sWorld.getConfig(CONFIG_GM_LOGIN_STATE))
|
|
|
|
|
switch (sWorld.getIntConfig(CONFIG_GM_LOGIN_STATE))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case 0: break; // disable
|
|
|
|
@@ -16440,7 +16440,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (sWorld.getConfig(CONFIG_GM_VISIBLE_STATE))
|
|
|
|
|
switch (sWorld.getIntConfig(CONFIG_GM_VISIBLE_STATE))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case 0: SetGMVisible(false); break; // invisible
|
|
|
|
@@ -16451,7 +16451,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*switch(sWorld.getConfig(CONFIG_GM_ACCEPT_TICKETS))
|
|
|
|
|
/*switch(sWorld.getIntConfig(CONFIG_GM_ACCEPT_TICKETS))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case 0: break; // disable
|
|
|
|
@@ -16462,7 +16462,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|
|
|
|
break;
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
switch (sWorld.getConfig(CONFIG_GM_CHAT))
|
|
|
|
|
switch (sWorld.getIntConfig(CONFIG_GM_CHAT))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case 0: break; // disable
|
|
|
|
@@ -16473,7 +16473,7 @@ bool Player::LoadFromDB(uint32 guid, SQLQueryHolder *holder)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (sWorld.getConfig(CONFIG_GM_WHISPERING_TO))
|
|
|
|
|
switch (sWorld.getIntConfig(CONFIG_GM_WHISPERING_TO))
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case 0: break; // disable
|
|
|
|
@@ -17485,7 +17485,7 @@ bool Player::Satisfy(AccessRequirement const* ar, uint32 target_map, bool report
|
|
|
|
|
if (!mapEntry)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
if (!sWorld.getConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
|
|
|
|
if (!sWorld.getBoolConfig(CONFIG_INSTANCE_IGNORE_LEVEL))
|
|
|
|
|
{
|
|
|
|
|
if (ar->levelMin && getLevel() < ar->levelMin)
|
|
|
|
|
LevelMin = ar->levelMin;
|
|
|
|
@@ -17620,7 +17620,7 @@ bool Player::_LoadHomeBind(QueryResult_AutoPtr result)
|
|
|
|
|
void Player::SaveToDB()
|
|
|
|
|
{
|
|
|
|
|
// delay auto save at any saves (manual, in code, or autosave)
|
|
|
|
|
m_nextSave = sWorld.getConfig(CONFIG_INTERVAL_SAVE);
|
|
|
|
|
m_nextSave = sWorld.getIntConfig(CONFIG_INTERVAL_SAVE);
|
|
|
|
|
|
|
|
|
|
//lets allow only players in world to be saved
|
|
|
|
|
if (IsBeingTeleportedFar())
|
|
|
|
@@ -17800,7 +17800,7 @@ void Player::SaveToDB()
|
|
|
|
|
|
|
|
|
|
// check if stats should only be saved on logout
|
|
|
|
|
// save stats can be out of transaction
|
|
|
|
|
if (m_session->isLogingOut() || !sWorld.getConfig(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT))
|
|
|
|
|
if (m_session->isLogingOut() || !sWorld.getBoolConfig(CONFIG_STATS_SAVE_ONLY_ON_LOGOUT))
|
|
|
|
|
_SaveStats(trans);
|
|
|
|
|
|
|
|
|
|
CharacterDatabase.CommitTransaction(trans);
|
|
|
|
@@ -18173,7 +18173,7 @@ void Player::_SaveSpells(SQLTransaction& trans)
|
|
|
|
|
void Player::_SaveStats(SQLTransaction& trans)
|
|
|
|
|
{
|
|
|
|
|
// check if stat saving is enabled and if char level is high enough
|
|
|
|
|
if (!sWorld.getConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld.getConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
|
|
|
|
|
if (!sWorld.getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE) || getLevel() < sWorld.getIntConfig(CONFIG_MIN_LEVEL_STAT_SAVE))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
trans->PAppend("DELETE FROM character_stats WHERE guid = '%u'", GetGUIDLow());
|
|
|
|
@@ -18234,7 +18234,7 @@ void Player::UpdateSpeakTime()
|
|
|
|
|
time_t current = time (NULL);
|
|
|
|
|
if (m_speakTime > current)
|
|
|
|
|
{
|
|
|
|
|
uint32 max_count = sWorld.getConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT);
|
|
|
|
|
uint32 max_count = sWorld.getIntConfig(CONFIG_CHATFLOOD_MESSAGE_COUNT);
|
|
|
|
|
if (!max_count)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
@@ -18242,7 +18242,7 @@ void Player::UpdateSpeakTime()
|
|
|
|
|
if (m_speakCount >= max_count)
|
|
|
|
|
{
|
|
|
|
|
// prevent overwrite mute time, if message send just before mutes set, for example.
|
|
|
|
|
time_t new_mute = current + sWorld.getConfig(CONFIG_CHATFLOOD_MUTE_TIME);
|
|
|
|
|
time_t new_mute = current + sWorld.getIntConfig(CONFIG_CHATFLOOD_MUTE_TIME);
|
|
|
|
|
if (GetSession()->m_muteTime < new_mute)
|
|
|
|
|
GetSession()->m_muteTime = new_mute;
|
|
|
|
|
|
|
|
|
@@ -18252,7 +18252,7 @@ void Player::UpdateSpeakTime()
|
|
|
|
|
else
|
|
|
|
|
m_speakCount = 0;
|
|
|
|
|
|
|
|
|
|
m_speakTime = current + sWorld.getConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY);
|
|
|
|
|
m_speakTime = current + sWorld.getIntConfig(CONFIG_CHATFLOOD_MESSAGE_DELAY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Player::CanSpeak() const
|
|
|
|
@@ -18636,7 +18636,7 @@ void Player::Say(const std::string& text, const uint32 language)
|
|
|
|
|
|
|
|
|
|
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
|
|
|
|
BuildPlayerChat(&data, CHAT_MSG_SAY, text, language);
|
|
|
|
|
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_SAY),true);
|
|
|
|
|
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_SAY),true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::Yell(const std::string& text, const uint32 language)
|
|
|
|
@@ -18645,7 +18645,7 @@ void Player::Yell(const std::string& text, const uint32 language)
|
|
|
|
|
|
|
|
|
|
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
|
|
|
|
BuildPlayerChat(&data, CHAT_MSG_YELL, text, language);
|
|
|
|
|
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_YELL),true);
|
|
|
|
|
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_YELL),true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::TextEmote(const std::string& text)
|
|
|
|
@@ -18654,7 +18654,7 @@ void Player::TextEmote(const std::string& text)
|
|
|
|
|
|
|
|
|
|
WorldPacket data(SMSG_MESSAGECHAT, 200);
|
|
|
|
|
BuildPlayerChat(&data, CHAT_MSG_EMOTE, text, LANG_UNIVERSAL);
|
|
|
|
|
SendMessageToSetInRange(&data,(float)sWorld.getConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT));
|
|
|
|
|
SendMessageToSetInRange(&data,sWorld.getFloatConfig(CONFIG_LISTEN_RANGE_TEXTEMOTE),true, !sWorld.getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_CHAT));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::Whisper(const std::string& text, uint32 language,uint64 receiver)
|
|
|
|
@@ -19159,7 +19159,7 @@ void Player::LeaveAllArenaTeams(uint64 guid)
|
|
|
|
|
void Player::SetRestBonus (float rest_bonus_new)
|
|
|
|
|
{
|
|
|
|
|
// Prevent resting on max level
|
|
|
|
|
if (getLevel() >= sWorld.getConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
if (getLevel() >= sWorld.getIntConfig(CONFIG_MAX_PLAYER_LEVEL))
|
|
|
|
|
rest_bonus_new = 0;
|
|
|
|
|
|
|
|
|
|
if (rest_bonus_new < 0)
|
|
|
|
@@ -19414,7 +19414,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
|
|
|
|
|
// prevent stealth flight
|
|
|
|
|
//RemoveAurasWithInterruptFlags(AURA_INTERRUPT_FLAG_TALK);
|
|
|
|
|
|
|
|
|
|
if (sWorld.getConfig(CONFIG_INSTANT_TAXI))
|
|
|
|
|
if (sWorld.getBoolConfig(CONFIG_INSTANT_TAXI))
|
|
|
|
|
{
|
|
|
|
|
TaxiNodesEntry const* lastnode = sTaxiNodesStore.LookupEntry(nodes[nodes.size()-1]);
|
|
|
|
|
m_taxi.ClearTaxiDestinations();
|
|
|
|
@@ -20284,7 +20284,7 @@ void Player::LeaveBattleground(bool teleportToEntryPoint)
|
|
|
|
|
bg->RemovePlayerAtLeave(GetGUID(), teleportToEntryPoint, true);
|
|
|
|
|
|
|
|
|
|
// call after remove to be sure that player resurrected for correct cast
|
|
|
|
|
if (bg->isBattleground() && !isGameMaster() && sWorld.getConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
|
|
|
|
if (bg->isBattleground() && !isGameMaster() && sWorld.getBoolConfig(CONFIG_BATTLEGROUND_CAST_DESERTER))
|
|
|
|
|
{
|
|
|
|
|
if (bg->GetStatus() == STATUS_IN_PROGRESS || bg->GetStatus() == STATUS_WAIT_JOIN)
|
|
|
|
|
{
|
|
|
|
@@ -20720,7 +20720,7 @@ void Player::UpdateVisibilityForPlayer()
|
|
|
|
|
|
|
|
|
|
void Player::InitPrimaryProfessions()
|
|
|
|
|
{
|
|
|
|
|
SetFreePrimaryProfessions(sWorld.getConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL));
|
|
|
|
|
SetFreePrimaryProfessions(sWorld.getIntConfig(CONFIG_MAX_PRIMARY_TRADE_SKILL));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void Player::ModifyMoney(int32 d)
|
|
|
|
@@ -21724,7 +21724,7 @@ bool Player::isHonorOrXPTarget(Unit* pVictim)
|
|
|
|
|
bool Player::GetsRecruitAFriendBonus(bool forXP)
|
|
|
|
|
{
|
|
|
|
|
bool recruitAFriend = false;
|
|
|
|
|
if (getLevel() <= sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
|
|
|
|
|
if (getLevel() <= sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL) || !forXP)
|
|
|
|
|
{
|
|
|
|
|
if (Group *group = this->GetGroup())
|
|
|
|
|
{
|
|
|
|
@@ -21740,12 +21740,12 @@ bool Player::GetsRecruitAFriendBonus(bool forXP)
|
|
|
|
|
if (forXP)
|
|
|
|
|
{
|
|
|
|
|
// level must be allowed to get RaF bonus
|
|
|
|
|
if (pGroupGuy->getLevel() > sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
|
|
|
|
if (pGroupGuy->getLevel() > sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
// level difference must be small enough to get RaF bonus, UNLESS we are lower level
|
|
|
|
|
if (pGroupGuy->getLevel() < getLevel())
|
|
|
|
|
if (uint8(getLevel() - pGroupGuy->getLevel()) > sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
|
|
|
|
|
if (uint8(getLevel() - pGroupGuy->getLevel()) > sWorld.getIntConfig(CONFIG_MAX_RECRUIT_A_FRIEND_BONUS_PLAYER_LEVEL_DIFFERENCE))
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -21908,7 +21908,7 @@ bool Player::IsAtGroupRewardDistance(WorldObject const* pRewardSource) const
|
|
|
|
|
if (player->GetMapId() != pRewardSource->GetMapId() || player->GetInstanceId() != pRewardSource->GetInstanceId())
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return pRewardSource->GetDistance(player) <= sWorld.getConfig(CONFIG_GROUP_XP_DISTANCE);
|
|
|
|
|
return pRewardSource->GetDistance(player) <= sWorld.getFloatConfig(CONFIG_GROUP_XP_DISTANCE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
|
|
|
|
@@ -21922,7 +21922,7 @@ bool Player::IsAtRecruitAFriendDistance(WorldObject const* pOther) const
|
|
|
|
|
if (player->GetMapId() != pOther->GetMapId() || player->GetInstanceId() != pOther->GetInstanceId())
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
return pOther->GetDistance(player) <= sWorld.getConfig(CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE);
|
|
|
|
|
return pOther->GetDistance(player) <= sWorld.getFloatConfig(CONFIG_MAX_RECRUIT_A_FRIEND_DISTANCE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32 Player::GetBaseWeaponSkillValue (WeaponAttackType attType) const
|
|
|
|
@@ -22027,10 +22027,10 @@ uint32 Player::GetCorpseReclaimDelay(bool pvp) const
|
|
|
|
|
{
|
|
|
|
|
if (pvp)
|
|
|
|
|
{
|
|
|
|
|
if (!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP))
|
|
|
|
|
if (!sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP))
|
|
|
|
|
return copseReclaimDelay[0];
|
|
|
|
|
}
|
|
|
|
|
else if (!sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))
|
|
|
|
|
else if (!sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
time_t now = time(NULL);
|
|
|
|
@@ -22044,8 +22044,8 @@ void Player::UpdateCorpseReclaimDelay()
|
|
|
|
|
{
|
|
|
|
|
bool pvp = m_ExtraFlags & PLAYER_EXTRA_PVP_DEATH;
|
|
|
|
|
|
|
|
|
|
if ((pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
|
|
|
|
(!pvp && !sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
|
|
|
|
if ((pvp && !sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
|
|
|
|
(!pvp && !sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
time_t now = time(NULL);
|
|
|
|
@@ -22081,8 +22081,8 @@ void Player::SendCorpseReclaimDelay(bool load)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
uint32 count;
|
|
|
|
|
if ((pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
|
|
|
|
(!pvp && sWorld.getConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
|
|
|
|
if ((pvp && sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVP)) ||
|
|
|
|
|
(!pvp && sWorld.getBoolConfig(CONFIG_DEATH_CORPSE_RECLAIM_DELAY_PVE)))
|
|
|
|
|
{
|
|
|
|
|
count = (m_deathExpireTime-corpse->GetGhostTime())/DEATH_EXPIRE_STEP;
|
|
|
|
|
if (count >= MAX_DEATH_COUNT)
|
|
|
|
@@ -22824,7 +22824,7 @@ void Player::_LoadSkills(QueryResult_AutoPtr result)
|
|
|
|
|
// special settings
|
|
|
|
|
if (getClass() == CLASS_DEATH_KNIGHT)
|
|
|
|
|
{
|
|
|
|
|
uint8 base_level = std::min(getLevel(),uint8(sWorld.getConfig(CONFIG_START_HEROIC_PLAYER_LEVEL)));
|
|
|
|
|
uint8 base_level = std::min(getLevel(),uint8(sWorld.getIntConfig(CONFIG_START_HEROIC_PLAYER_LEVEL)));
|
|
|
|
|
if (base_level < 1)
|
|
|
|
|
base_level = 1;
|
|
|
|
|
uint16 base_skill = (base_level-1)*5; // 270 at starting level 55
|
|
|
|
|