aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Player/Player.cpp61
-rw-r--r--src/server/game/Entities/Player/Player.h2
-rw-r--r--src/server/game/Handlers/CharacterHandler.cpp71
-rw-r--r--src/server/game/Reputation/ReputationMgr.cpp17
-rw-r--r--src/server/game/Reputation/ReputationMgr.h1
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2
-rw-r--r--src/server/worldserver/worldserver.conf.dist2
7 files changed, 88 insertions, 68 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp
index c2094cf85b9..9a4cf075a98 100644
--- a/src/server/game/Entities/Player/Player.cpp
+++ b/src/server/game/Entities/Player/Player.cpp
@@ -704,56 +704,6 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
SetHonorPoints(sWorld->getIntConfig(CONFIG_START_HONOR_POINTS));
SetArenaPoints(sWorld->getIntConfig(CONFIG_START_ARENA_POINTS));
- // start with every map 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->getBoolConfig(CONFIG_START_ALL_REP))
- {
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(942), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(935), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(936), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1011), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(970), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(967), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(989), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(932), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(934), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1038), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(1077), 42999);
-
- // Factions depending on team, like cities and some more stuff
- switch (GetTeam())
- {
- case ALLIANCE:
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(72), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(47), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(69), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(930), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(730), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(978), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(54), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(946), 42999);
- break;
- case HORDE:
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(76), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(68), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(81), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(911), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(729), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(941), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(530), 42999);
- GetReputationMgr().SetReputation(sFactionStore.LookupEntry(947), 42999);
- break;
- default:
- break;
- }
- }
-
// Played time
m_Last_tick = time(nullptr);
m_Played_time[PLAYED_TIME_TOTAL] = 0;
@@ -2803,7 +2753,7 @@ void Player::GiveLevel(uint8 level)
UpdateAllStats();
if (sWorld->getBoolConfig(CONFIG_ALWAYS_MAXSKILL)) // Max weapon skill when leveling up
- UpdateSkillsToMaxSkillsForLevel();
+ UpdateWeaponsSkillsToMaxSkillsForLevel();
_ApplyAllLevelScaleItemMods(true);
@@ -3497,6 +3447,9 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
if (skill_max_value < new_skill_max_value)
skill_max_value = new_skill_max_value;
+ if (sWorld->getBoolConfig(CONFIG_ALWAYS_MAXSKILL) && !IsProfessionOrRidingSkill(spellLearnSkill->skill))
+ skill_value = skill_max_value;
+
SetSkill(spellLearnSkill->skill, spellLearnSkill->step, skill_value, skill_max_value);
}
}
@@ -6096,7 +6049,7 @@ void Player::UpdateSkillsForLevel()
}
}
-void Player::UpdateSkillsToMaxSkillsForLevel()
+void Player::UpdateWeaponsSkillsToMaxSkillsForLevel()
{
for (SkillStatusMap::iterator itr = mSkillStatus.begin(); itr != mSkillStatus.end(); ++itr)
{
@@ -22861,7 +22814,9 @@ void Player::LearnDefaultSkill(uint32 skillId, uint16 rank)
{
uint16 skillValue = 1;
uint16 maxValue = GetMaxSkillValueForLevel();
- if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE)
+ if (sWorld->getBoolConfig(CONFIG_ALWAYS_MAXSKILL) && !IsProfessionOrRidingSkill(skillId))
+ skillValue = maxValue;
+ else if (rcInfo->Flags & SKILL_FLAG_ALWAYS_MAX_VALUE)
skillValue = maxValue;
else if (getClass() == CLASS_DEATH_KNIGHT)
skillValue = std::min(std::max<uint16>({ 1, uint16((getLevel() - 1) * 5) }), maxValue);
diff --git a/src/server/game/Entities/Player/Player.h b/src/server/game/Entities/Player/Player.h
index f1a68827bbf..99e5f37ee7b 100644
--- a/src/server/game/Entities/Player/Player.h
+++ b/src/server/game/Entities/Player/Player.h
@@ -1908,7 +1908,7 @@ class TC_GAME_API Player : public Unit, public GridObject<Player>
int32 CalculateReputationGain(ReputationSource source, uint32 creatureOrQuestLevel, int32 rep, int32 faction, bool noQuestBonus = false);
void UpdateSkillsForLevel();
- void UpdateSkillsToMaxSkillsForLevel(); // for .levelup
+ void UpdateWeaponsSkillsToMaxSkillsForLevel(); // for .levelup
void ModifySkillBonus(uint32 skillid, int32 val, bool talent);
/*********************************************************/
diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp
index bd71f39a447..a8a1bb3e329 100644
--- a/src/server/game/Handlers/CharacterHandler.cpp
+++ b/src/server/game/Handlers/CharacterHandler.cpp
@@ -899,6 +899,75 @@ void WorldSession::HandlePlayerLogin(LoginQueryHolder* holder)
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(pCurrChar->getRace(), pCurrChar->getClass());
for (uint32 spellId : info->castSpells)
pCurrChar->CastSpell(pCurrChar, spellId, true);
+
+ // Start with all map areas explored if enabled
+ if (sWorld->getBoolConfig(CONFIG_START_ALL_EXPLORED))
+ for (uint8 i = 0; i < PLAYER_EXPLORED_ZONES_SIZE; ++i)
+ pCurrChar->SetFlag(PLAYER_EXPLORED_ZONES_1 + i, 0xFFFFFFFF);
+
+ // Max relevant reputations if "StartAllReputation" is enabled
+ if (sWorld->getBoolConfig(CONFIG_START_ALL_REP))
+ {
+ ReputationMgr& repMgr = pCurrChar->GetReputationMgr();
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 942), 42999, false); // Cenarion Expedition
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 935), 42999, false); // The Sha'tar
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 936), 42999, false); // Shattrath City
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1011), 42999, false); // Lower City
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 970), 42999, false); // Sporeggar
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 967), 42999, false); // The Violet Eye
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 989), 42999, false); // Keepers of Time
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 932), 42999, false); // The Aldor
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 934), 42999, false); // The Scryers
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1038), 42999, false); // Ogri'la
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1077), 42999, false); // Shattered Sun Offensive
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1106), 42999, false); // Argent Crusade
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1104), 42999, false); // Frenzyheart Tribe
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1090), 42999, false); // Kirin Tor
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1098), 42999, false); // Knights of the Ebon Blade
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1156), 42999, false); // The Ashen Verdict
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1073), 42999, false); // The Kalu'ak
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1105), 42999, false); // The Oracles
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1119), 42999, false); // The Sons of Hodir
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1091), 42999, false); // The Wyrmrest Accord
+
+ // Factions depending on team, like cities and some more stuff
+ switch (pCurrChar->GetTeam())
+ {
+ case ALLIANCE:
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 72), 42999, false); // Stormwind
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 47), 42999, false); // Ironforge
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 69), 42999, false); // Darnassus
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 930), 42999, false); // Exodar
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 730), 42999, false); // Stormpike Guard
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 978), 42999, false); // Kurenai
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 54), 42999, false); // Gnomeregan Exiles
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 946), 42999, false); // Honor Hold
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1037), 42999, false); // Alliance Vanguard
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1068), 42999, false); // Explorers' League
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1126), 42999, false); // The Frostborn
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1094), 42999, false); // The Silver Covenant
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1050), 42999, false); // Valiance Expedition
+ break;
+ case HORDE:
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 76), 42999, false); // Orgrimmar
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 68), 42999, false); // Undercity
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 81), 42999, false); // Thunder Bluff
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 911), 42999, false); // Silvermoon City
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 729), 42999, false); // Frostwolf Clan
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 941), 42999, false); // The Mag'har
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 530), 42999, false); // Darkspear Trolls
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry( 947), 42999, false); // Thrallmar
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1052), 42999, false); // Horde Expedition
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1067), 42999, false); // The Hand of Vengeance
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1124), 42999, false); // The Sunreavers
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1064), 42999, false); // The Taunka
+ repMgr.SetOneFactionReputation(sFactionStore.LookupEntry(1085), 42999, false); // Warsong Offensive
+ break;
+ default:
+ break;
+ }
+ repMgr.SendState(nullptr);
+ }
}
// show time before shutdown if shutdown planned.
@@ -947,7 +1016,7 @@ void WorldSession::HandleSetFactionAtWar(WorldPacket& recvData)
void WorldSession::HandleSetFactionCheat(WorldPacket& /*recvData*/)
{
TC_LOG_ERROR("network", "WORLD SESSION: HandleSetFactionCheat, not expected call, please report.");
- GetPlayer()->GetReputationMgr().SendStates();
+ GetPlayer()->GetReputationMgr().SendState(nullptr);
}
void WorldSession::HandleTutorialFlag(WorldPacket& recvData)
diff --git a/src/server/game/Reputation/ReputationMgr.cpp b/src/server/game/Reputation/ReputationMgr.cpp
index b0c7538da05..9b290df79ee 100644
--- a/src/server/game/Reputation/ReputationMgr.cpp
+++ b/src/server/game/Reputation/ReputationMgr.cpp
@@ -168,7 +168,7 @@ void ReputationMgr::SendForceReactions()
void ReputationMgr::SendState(FactionState const* faction)
{
- uint32 count = 1;
+ uint32 count = faction ? 1 : 0;
WorldPacket data(SMSG_SET_FACTION_STANDING, 17);
data << float(0);
@@ -178,15 +178,18 @@ void ReputationMgr::SendState(FactionState const* faction)
size_t p_count = data.wpos();
data << uint32(count);
- data << uint32(faction->ReputationListID);
- data << uint32(faction->Standing);
+ if (faction)
+ {
+ data << uint32(faction->ReputationListID);
+ data << uint32(faction->Standing);
+ }
for (FactionStateList::iterator itr = _factions.begin(); itr != _factions.end(); ++itr)
{
if (itr->second.needSend)
{
itr->second.needSend = false;
- if (itr->second.ReputationListID != faction->ReputationListID)
+ if (!faction || itr->second.ReputationListID != faction->ReputationListID)
{
data << uint32(itr->second.ReputationListID);
data << uint32(itr->second.Standing);
@@ -235,12 +238,6 @@ void ReputationMgr::SendInitialReputations()
_player->SendDirectMessage(&data);
}
-void ReputationMgr::SendStates()
-{
- for (FactionStateList::iterator itr = _factions.begin(); itr != _factions.end(); ++itr)
- SendState(&(itr->second));
-}
-
void ReputationMgr::SendVisible(FactionState const* faction) const
{
if (_player->GetSession()->PlayerLoading())
diff --git a/src/server/game/Reputation/ReputationMgr.h b/src/server/game/Reputation/ReputationMgr.h
index b3e71c3a0a7..b9241bbb10d 100644
--- a/src/server/game/Reputation/ReputationMgr.h
+++ b/src/server/game/Reputation/ReputationMgr.h
@@ -139,7 +139,6 @@ class TC_GAME_API ReputationMgr
void SendInitialReputations();
void SendForceReactions();
void SendState(FactionState const* faction);
- void SendStates();
private: // internal helper functions
void Initialize();
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 5eadcf0e07d..cc38cd50f7d 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1424,7 +1424,7 @@ public:
}
// each skills that have max skill value dependent from level seted to current level max skill value
- player->UpdateSkillsToMaxSkillsForLevel();
+ player->UpdateWeaponsSkillsToMaxSkillsForLevel();
return true;
}
diff --git a/src/server/worldserver/worldserver.conf.dist b/src/server/worldserver/worldserver.conf.dist
index a4943047a97..83dd87a487e 100644
--- a/src/server/worldserver/worldserver.conf.dist
+++ b/src/server/worldserver/worldserver.conf.dist
@@ -820,7 +820,7 @@ StartPlayerLevel = 1
#
# StartDeathKnightPlayerLevel
-# Description: Staring level for death knight characters after creation.
+# Description: Starting level for death knight characters after creation.
# Range: 1-MaxPlayerLevel
# Default: 55