From d6faa2de3bbac51944112ed2493a11e4d5777200 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sat, 7 Mar 2026 20:17:57 +0100 Subject: [PATCH] Core/Players: Add more Haranir data --- .../world/master/2026_03_07_01_world.sql | 4 ++ src/server/game/Handlers/CharacterHandler.cpp | 37 ++++++------------- src/server/scripts/Spells/spell_generic.cpp | 6 +++ 3 files changed, 22 insertions(+), 25 deletions(-) create mode 100644 sql/updates/world/master/2026_03_07_01_world.sql diff --git a/sql/updates/world/master/2026_03_07_01_world.sql b/sql/updates/world/master/2026_03_07_01_world.sql new file mode 100644 index 0000000000..f3e1e4c3d7 --- /dev/null +++ b/sql/updates/world/master/2026_03_07_01_world.sql @@ -0,0 +1,4 @@ +DELETE FROM `player_racestats` WHERE `race` IN (86,91); +INSERT INTO `player_racestats` (`race`,`str`,`agi`,`sta`,`inte`,`spi`) VALUES +(86,0,0,0,0,0), +(91,0,0,0,0,0); diff --git a/src/server/game/Handlers/CharacterHandler.cpp b/src/server/game/Handlers/CharacterHandler.cpp index dcca524b3d..842b6cb845 100644 --- a/src/server/game/Handlers/CharacterHandler.cpp +++ b/src/server/game/Handlers/CharacterHandler.cpp @@ -2323,8 +2323,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptrAppend(stmt); // Race specific languages - std::array const racesWithoutSpecificLanguages = { RACE_ORC, RACE_HUMAN, RACE_MAGHAR_ORC, RACE_KUL_TIRAN }; - if (std::find(racesWithoutSpecificLanguages.begin(), racesWithoutSpecificLanguages.end(), factionChangeInfo->RaceID) == racesWithoutSpecificLanguages.end()) + constexpr std::array racesWithoutSpecificLanguages = { RACE_ORC, RACE_HUMAN, RACE_MAGHAR_ORC, RACE_KUL_TIRAN }; + if (!advstd::ranges::contains(racesWithoutSpecificLanguages, factionChangeInfo->RaceID)) { stmt = CharacterDatabase.GetPreparedStatement(CHAR_INS_CHAR_SKILL_LANGUAGE); stmt->setUInt64(0, lowGuid); @@ -2386,6 +2386,10 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptrsetUInt16(1, 140); break; + case RACE_HARANIR_ALLIANCE: + case RACE_HARANIR_HORDE: + stmt->setUInt16(1, 2987); + break; default: TC_LOG_ERROR("entities.player", "Could not find language data for race ({}).", factionChangeInfo->RaceID); SendCharFactionChange(CHAR_CREATE_ERROR, factionChangeInfo.get()); @@ -2481,11 +2485,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptrGuid, trans); // Achievement conversion - for (std::map::const_iterator it = sObjectMgr->FactionChangeAchievements.begin(); it != sObjectMgr->FactionChangeAchievements.end(); ++it) + for (auto [achiev_alliance, achiev_horde] : sObjectMgr->FactionChangeAchievements) { - uint32 achiev_alliance = it->first; - uint32 achiev_horde = it->second; - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_BY_ACHIEVEMENT); stmt->setUInt16(0, uint16(newTeamId == TEAM_ALLIANCE ? achiev_alliance : achiev_horde)); stmt->setUInt64(1, lowGuid); @@ -2502,11 +2503,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptrFactionChangeItemsHordeToAlliance : sObjectMgr->FactionChangeItemsAllianceToHorde; - for (std::map::const_iterator it = itemConversionMap.begin(); it != itemConversionMap.end(); ++it) + for (auto [oldItemId, newItemId] : itemConversionMap) { - uint32 oldItemId = it->first; - uint32 newItemId = it->second; - stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHAR_INVENTORY_FACTION_CHANGE); stmt->setUInt32(0, newItemId); stmt->setUInt32(1, oldItemId); @@ -2520,11 +2518,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptrAppend(stmt); // Quest conversion - for (std::map::const_iterator it = sObjectMgr->FactionChangeQuests.begin(); it != sObjectMgr->FactionChangeQuests.end(); ++it) + for (auto [quest_alliance, quest_horde] : sObjectMgr->FactionChangeQuests) { - uint32 quest_alliance = it->first; - uint32 quest_horde = it->second; - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_QUESTSTATUS_REWARDED_BY_QUEST); stmt->setUInt64(0, lowGuid); stmt->setUInt32(1, (newTeamId == TEAM_ALLIANCE ? quest_alliance : quest_horde)); @@ -2559,11 +2554,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr::const_iterator it = sObjectMgr->FactionChangeSpells.begin(); it != sObjectMgr->FactionChangeSpells.end(); ++it) + for (auto [spell_alliance, spell_horde] : sObjectMgr->FactionChangeSpells) { - uint32 spell_alliance = it->first; - uint32 spell_horde = it->second; - stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_SPELL_BY_SPELL); stmt->setUInt32(0, (newTeamId == TEAM_ALLIANCE ? spell_alliance : spell_horde)); stmt->setUInt64(1, lowGuid); @@ -2577,10 +2569,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr::const_iterator it = sObjectMgr->FactionChangeReputation.begin(); it != sObjectMgr->FactionChangeReputation.end(); ++it) + for (auto [reputation_alliance, reputation_horde] : sObjectMgr->FactionChangeReputation) { - uint32 reputation_alliance = it->first; - uint32 reputation_horde = it->second; uint32 newReputation = (newTeamId == TEAM_ALLIANCE) ? reputation_alliance : reputation_horde; uint32 oldReputation = (newTeamId == TEAM_ALLIANCE) ? reputation_horde : reputation_alliance; @@ -2637,11 +2627,8 @@ void WorldSession::HandleCharRaceOrFactionChangeCallback(std::shared_ptr::const_iterator it = sObjectMgr->FactionChangeTitles.begin(); it != sObjectMgr->FactionChangeTitles.end(); ++it) + for (auto [title_alliance, title_horde] : sObjectMgr->FactionChangeTitles) { - uint32 title_alliance = it->first; - uint32 title_horde = it->second; - CharTitlesEntry const* atitleInfo = sCharTitlesStore.AssertEntry(title_alliance); CharTitlesEntry const* htitleInfo = sCharTitlesStore.AssertEntry(title_horde); // new team diff --git a/src/server/scripts/Spells/spell_generic.cpp b/src/server/scripts/Spells/spell_generic.cpp index 41dc0a2979..ac9d427ac1 100644 --- a/src/server/scripts/Spells/spell_generic.cpp +++ b/src/server/scripts/Spells/spell_generic.cpp @@ -440,6 +440,12 @@ class spell_gen_battleground_mercenary_shapeshift : public AuraScript { RACE_VULPERA, { 94999, 95001 } }, { RACE_MAGHAR_ORC, { 88420, 88410 } }, { RACE_MECHAGNOME, { 94998, 95000 } }, + { RACE_DRACTHYR_ALLIANCE, { 112794, 112793 } }, + { RACE_DRACTHYR_HORDE, { 112796, 112795 } }, + { RACE_EARTHEN_DWARF_HORDE, { 118113, 118114 } }, + { RACE_EARTHEN_DWARF_ALLIANCE, { 118111, 118112 } }, + { RACE_HARANIR_ALLIANCE, { 140501, 140500 } }, + { RACE_HARANIR_HORDE, { 140503, 140502 } }, }; inline static std::vector RacialSkills;