fix(core/dbc): improve ChrRace DBC handling (#14843)
Cherry pick of https://github.com/TrinityCore/TrinityCore/pull/24508 Co-authored-by: HelloKitty <5829095+HelloKitty@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
DROP TABLE IF EXISTS `chrraces_dbc`;
|
||||||
|
CREATE TABLE `chrraces_dbc` ( `ID` INT NOT NULL DEFAULT '0', `Flags` INT NOT NULL DEFAULT '0', `FactionID` INT NOT NULL DEFAULT '0', `ExplorationSoundID` INT NOT NULL DEFAULT '0', `MaleDisplayId` INT NOT NULL DEFAULT '0', `FemaleDisplayId` INT NOT NULL DEFAULT '0', `ClientPrefix` TEXT NULL, `BaseLanguage` INT NOT NULL DEFAULT '0', `CreatureType` INT NOT NULL DEFAULT '0', `ResSicknessSpellID` INT NOT NULL DEFAULT '0', `SplashSoundID` INT NOT NULL DEFAULT '0', `ClientFilestring` TEXT NULL, `CinematicSequenceID` INT NOT NULL DEFAULT '0', `Alliance` INT NOT NULL DEFAULT '0', `Name_Lang_enUS` TEXT NULL, `Name_Lang_enGB` TEXT NULL, `Name_Lang_koKR` TEXT NULL, `Name_Lang_frFR` TEXT NULL, `Name_Lang_deDE` TEXT NULL, `Name_Lang_enCN` TEXT NULL, `Name_Lang_zhCN` TEXT NULL, `Name_Lang_enTW` TEXT NULL, `Name_Lang_zhTW` TEXT NULL, `Name_Lang_esES` TEXT NULL, `Name_Lang_esMX` TEXT NULL, `Name_Lang_ruRU` TEXT NULL, `Name_Lang_ptPT` TEXT NULL, `Name_Lang_ptBR` TEXT NULL, `Name_Lang_itIT` TEXT NULL, `Name_Lang_Unk` TEXT NULL, `Name_Lang_Mask` INT UNSIGNED NOT NULL DEFAULT '0', `Name_Female_Lang_enUS` TEXT NULL, `Name_Female_Lang_enGB` TEXT NULL, `Name_Female_Lang_koKR` TEXT NULL, `Name_Female_Lang_frFR` TEXT NULL, `Name_Female_Lang_deDE` TEXT NULL, `Name_Female_Lang_enCN` TEXT NULL, `Name_Female_Lang_zhCN` TEXT NULL, `Name_Female_Lang_enTW` TEXT NULL, `Name_Female_Lang_zhTW` TEXT NULL, `Name_Female_Lang_esES` TEXT NULL, `Name_Female_Lang_esMX` TEXT NULL, `Name_Female_Lang_ruRU` TEXT NULL, `Name_Female_Lang_ptPT` TEXT NULL, `Name_Female_Lang_ptBR` TEXT NULL, `Name_Female_Lang_itIT` TEXT NULL, `Name_Female_Lang_Unk` TEXT NULL, `Name_Female_Lang_Mask` INT UNSIGNED NOT NULL DEFAULT '0', `Name_Male_Lang_enUS` TEXT NULL, `Name_Male_Lang_enGB` TEXT NULL, `Name_Male_Lang_koKR` TEXT NULL, `Name_Male_Lang_frFR` TEXT NULL, `Name_Male_Lang_deDE` TEXT NULL, `Name_Male_Lang_enCN` TEXT NULL, `Name_Male_Lang_zhCN` TEXT NULL, `Name_Male_Lang_enTW` TEXT NULL, `Name_Male_Lang_zhTW` TEXT NULL, `Name_Male_Lang_esES` TEXT NULL, `Name_Male_Lang_esMX` TEXT NULL, `Name_Male_Lang_ruRU` TEXT NULL, `Name_Male_Lang_ptPT` TEXT NULL, `Name_Male_Lang_ptBR` TEXT NULL, `Name_Male_Lang_itIT` TEXT NULL, `Name_Male_Lang_Unk` TEXT NULL, `Name_Male_Lang_Mask` INT UNSIGNED NOT NULL DEFAULT '0', `FacialHairCustomization_1` TEXT NULL, `FacialHairCustomization_2` TEXT NULL, `HairCustomization` TEXT NULL, `Required_Expansion` INT NOT NULL DEFAULT '0', PRIMARY KEY (`ID`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||||
@@ -2258,7 +2258,7 @@ void AchievementMgr::CompletedAchievement(AchievementEntry const* achievement)
|
|||||||
//! Since no common attributes were found, (not even in titleRewardFlags field)
|
//! Since no common attributes were found, (not even in titleRewardFlags field)
|
||||||
//! we explicitly check by ID. Maybe in the future we could move the achievement_reward
|
//! we explicitly check by ID. Maybe in the future we could move the achievement_reward
|
||||||
//! condition fields to the condition system.
|
//! condition fields to the condition system.
|
||||||
if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->getGender() : uint8(GetPlayer()->GetTeamId())])
|
if (uint32 titleId = reward->titleId[achievement->ID == 1793 ? GetPlayer()->GetNativeGender() : (GetPlayer()->GetTeam() == ALLIANCE ? 0 : 1)])
|
||||||
if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId))
|
if (CharTitlesEntry const* titleEntry = sCharTitlesStore.LookupEntry(titleId))
|
||||||
GetPlayer()->SetTitle(titleEntry);
|
GetPlayer()->SetTitle(titleEntry);
|
||||||
|
|
||||||
@@ -2363,8 +2363,8 @@ bool AchievementMgr::CanUpdateCriteria(AchievementCriteriaEntry const* criteria,
|
|||||||
if (achievement->mapID != -1 && GetPlayer()->GetMapId() != uint32(achievement->mapID))
|
if (achievement->mapID != -1 && GetPlayer()->GetMapId() != uint32(achievement->mapID))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && GetPlayer()->GetTeamId(true) != TEAM_HORDE) ||
|
if ((achievement->requiredFaction == ACHIEVEMENT_FACTION_HORDE && GetPlayer()->GetTeamId() != TEAM_HORDE) ||
|
||||||
(achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && GetPlayer()->GetTeamId(true) != TEAM_ALLIANCE))
|
(achievement->requiredFaction == ACHIEVEMENT_FACTION_ALLIANCE && GetPlayer()->GetTeamId() != TEAM_ALLIANCE))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (uint32 i = 0; i < MAX_CRITERIA_REQUIREMENTS; ++i)
|
for (uint32 i = 0; i < MAX_CRITERIA_REQUIREMENTS; ++i)
|
||||||
|
|||||||
@@ -1506,6 +1506,11 @@ struct WGWorkshop
|
|||||||
teamControl = team;
|
teamControl = team;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case HORDE_FACTION:
|
||||||
|
case ALLIANCE_FACTION:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!init)
|
if (!init)
|
||||||
|
|||||||
@@ -744,7 +744,7 @@ uint32 Battleground::GetRealRepFactionForPlayer(uint32 factionId, Player* player
|
|||||||
if (player)
|
if (player)
|
||||||
{
|
{
|
||||||
// if the bg team is not the original team, reverse reputation
|
// if the bg team is not the original team, reverse reputation
|
||||||
if (player->GetBgTeamId() != player->GetTeamId(true))
|
if (player->GetBgTeamId() != player->GetTeamId())
|
||||||
{
|
{
|
||||||
switch (factionId)
|
switch (factionId)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ GroupQueueInfo* BattlegroundQueue::AddGroup(Player* leader, Group* group, Battle
|
|||||||
ginfo->JoinTime = GameTime::GetGameTimeMS().count();
|
ginfo->JoinTime = GameTime::GetGameTimeMS().count();
|
||||||
ginfo->RemoveInviteTime = 0;
|
ginfo->RemoveInviteTime = 0;
|
||||||
ginfo->teamId = leader->GetTeamId();
|
ginfo->teamId = leader->GetTeamId();
|
||||||
ginfo->RealTeamID = leader->GetTeamId(true);
|
ginfo->RealTeamID = leader->GetTeamId();
|
||||||
ginfo->ArenaTeamRating = arenaRating;
|
ginfo->ArenaTeamRating = arenaRating;
|
||||||
ginfo->ArenaMatchmakerRating = matchmakerRating;
|
ginfo->ArenaMatchmakerRating = matchmakerRating;
|
||||||
ginfo->PreviousOpponentsTeamId = opponentsArenaTeamId;
|
ginfo->PreviousOpponentsTeamId = opponentsArenaTeamId;
|
||||||
|
|||||||
@@ -431,7 +431,7 @@ namespace lfg
|
|||||||
{
|
{
|
||||||
if (!itemRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
if (!itemRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
||||||
{
|
{
|
||||||
if (itemRequirement->faction == TEAM_NEUTRAL || itemRequirement->faction == player->GetTeamId(true))
|
if (itemRequirement->faction == TEAM_NEUTRAL || itemRequirement->faction == player->GetTeamId())
|
||||||
{
|
{
|
||||||
if (!player->HasItemCount(itemRequirement->id, 1))
|
if (!player->HasItemCount(itemRequirement->id, 1))
|
||||||
{
|
{
|
||||||
@@ -447,7 +447,7 @@ namespace lfg
|
|||||||
{
|
{
|
||||||
if (!questRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
if (!questRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
||||||
{
|
{
|
||||||
if (questRequirement->faction == TEAM_NEUTRAL || questRequirement->faction == player->GetTeamId(true))
|
if (questRequirement->faction == TEAM_NEUTRAL || questRequirement->faction == player->GetTeamId())
|
||||||
{
|
{
|
||||||
if (!player->GetQuestRewardStatus(questRequirement->id))
|
if (!player->GetQuestRewardStatus(questRequirement->id))
|
||||||
{
|
{
|
||||||
@@ -469,7 +469,7 @@ namespace lfg
|
|||||||
{
|
{
|
||||||
if (!achievementRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
if (!achievementRequirement->checkLeaderOnly || !group || group->GetLeaderGUID() == player->GetGUID())
|
||||||
{
|
{
|
||||||
if (achievementRequirement->faction == TEAM_NEUTRAL || achievementRequirement->faction == player->GetTeamId(true))
|
if (achievementRequirement->faction == TEAM_NEUTRAL || achievementRequirement->faction == player->GetTeamId())
|
||||||
{
|
{
|
||||||
if (!player->HasAchieved(achievementRequirement->id))
|
if (!player->HasAchieved(achievementRequirement->id))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -517,9 +517,10 @@ bool Player::Create(ObjectGuid::LowType guidlow, CharacterCreateInfo* createInfo
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 RaceClassGender = (createInfo->Race) | (createInfo->Class << 8) | (createInfo->Gender << 16);
|
setRace(createInfo->Race);
|
||||||
|
setClass(createInfo->Class);
|
||||||
SetUInt32Value(UNIT_FIELD_BYTES_0, (RaceClassGender | (powertype << 24)));
|
setGender(Gender(createInfo->Gender));
|
||||||
|
setPowerType(Powers(powertype), false);
|
||||||
InitDisplayIds();
|
InitDisplayIds();
|
||||||
if (sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
|
if (sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_PVP || sWorld->getIntConfig(CONFIG_GAME_TYPE) == REALM_TYPE_RPPVP)
|
||||||
{
|
{
|
||||||
@@ -724,7 +725,7 @@ bool Player::StoreNewItemInBestSlots(uint32 titem_id, uint32 titem_amount)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// item can't be added
|
// item can't be added
|
||||||
LOG_ERROR("entities.player", "STORAGE: Can't equip or store initial item {} for race {} class {}, error msg = {}", titem_id, getRace(true), getClass(), msg);
|
LOG_ERROR("entities.player", "STORAGE: Can't equip or store initial item {} for race {} class {}, error msg = {}", titem_id, getRace(), getClass(), msg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2224,7 +2225,7 @@ void Player::SetGameMaster(bool on)
|
|||||||
SetPhaseMask(newPhase, false);
|
SetPhaseMask(newPhase, false);
|
||||||
|
|
||||||
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
|
m_ExtraFlags &= ~ PLAYER_EXTRA_GM_ON;
|
||||||
SetFactionForRace(getRace(true));
|
SetFactionForRace(getRace());
|
||||||
RemovePlayerFlag(PLAYER_FLAGS_GM);
|
RemovePlayerFlag(PLAYER_FLAGS_GM);
|
||||||
RemoveUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
|
RemoveUnitFlag2(UNIT_FLAG2_ALLOW_CHEAT_SPELLS);
|
||||||
|
|
||||||
@@ -2435,7 +2436,7 @@ void Player::GiveLevel(uint8 level)
|
|||||||
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_LEVEL, level);
|
guild->UpdateMemberData(this, GUILD_MEMBER_DATA_LEVEL, level);
|
||||||
|
|
||||||
PlayerLevelInfo info;
|
PlayerLevelInfo info;
|
||||||
sObjectMgr->GetPlayerLevelInfo(getRace(true), getClass(), level, &info);
|
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), level, &info);
|
||||||
|
|
||||||
PlayerClassLevelInfo classInfo;
|
PlayerClassLevelInfo classInfo;
|
||||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo);
|
sObjectMgr->GetPlayerClassLevelInfo(getClass(), level, &classInfo);
|
||||||
@@ -2551,7 +2552,7 @@ void Player::InitStatsForLevel(bool reapplyMods)
|
|||||||
sObjectMgr->GetPlayerClassLevelInfo(getClass(), GetLevel(), &classInfo);
|
sObjectMgr->GetPlayerClassLevelInfo(getClass(), GetLevel(), &classInfo);
|
||||||
|
|
||||||
PlayerLevelInfo info;
|
PlayerLevelInfo info;
|
||||||
sObjectMgr->GetPlayerLevelInfo(getRace(true), getClass(), GetLevel(), &info);
|
sObjectMgr->GetPlayerLevelInfo(getRace(), getClass(), GetLevel(), &info);
|
||||||
|
|
||||||
uint32 maxPlayerLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
uint32 maxPlayerLevel = sWorld->getIntConfig(CONFIG_MAX_PLAYER_LEVEL);
|
||||||
sScriptMgr->OnSetMaxLevel(this, maxPlayerLevel);
|
sScriptMgr->OnSetMaxLevel(this, maxPlayerLevel);
|
||||||
@@ -4338,7 +4339,7 @@ void Player::BuildPlayerRepop()
|
|||||||
WorldPacket data(SMSG_PRE_RESURRECT, GetPackGUID().size());
|
WorldPacket data(SMSG_PRE_RESURRECT, GetPackGUID().size());
|
||||||
data << GetPackGUID();
|
data << GetPackGUID();
|
||||||
GetSession()->SendPacket(&data);
|
GetSession()->SendPacket(&data);
|
||||||
if (getRace(true) == RACE_NIGHTELF)
|
if (getRace() == RACE_NIGHTELF)
|
||||||
{
|
{
|
||||||
CastSpell(this, 20584, true);
|
CastSpell(this, 20584, true);
|
||||||
}
|
}
|
||||||
@@ -5742,19 +5743,19 @@ TeamId Player::TeamIdForRace(uint8 race)
|
|||||||
{
|
{
|
||||||
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
|
if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race))
|
||||||
{
|
{
|
||||||
switch (rEntry->TeamID)
|
switch (rEntry->BaseLanguage)
|
||||||
{
|
{
|
||||||
case 1:
|
case 1:
|
||||||
return TEAM_HORDE;
|
return HORDE_FACTION;
|
||||||
case 7:
|
case 7:
|
||||||
return TEAM_ALLIANCE;
|
return ALLIANCE_FACTION;
|
||||||
}
|
}
|
||||||
LOG_ERROR("entities.player", "Race ({}) has wrong teamid ({}) in DBC: wrong DBC files?", uint32(race), rEntry->TeamID);
|
LOG_ERROR("entities.player", "Race ({}) has wrong teamid ({}) in DBC: wrong DBC files?", uint32(race), rEntry->BaseLanguage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
LOG_ERROR("entities.player", "Race ({}) not found in DBC: wrong DBC files?", uint32(race));
|
LOG_ERROR("entities.player", "Race ({}) not found in DBC: wrong DBC files?", uint32(race));
|
||||||
|
|
||||||
return TEAM_ALLIANCE;
|
return ALLIANCE_FACTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Player::SetFactionForRace(uint8 race)
|
void Player::SetFactionForRace(uint8 race)
|
||||||
@@ -5763,7 +5764,7 @@ void Player::SetFactionForRace(uint8 race)
|
|||||||
|
|
||||||
sScriptMgr->OnPlayerUpdateFaction(this);
|
sScriptMgr->OnPlayerUpdateFaction(this);
|
||||||
|
|
||||||
if (GetTeamId(true) != GetTeamId())
|
if (GetTeamId() != GetTeamId())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
|
ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(race);
|
||||||
@@ -5881,7 +5882,7 @@ void Player::RewardReputation(Unit* victim, float rate)
|
|||||||
ChampioningFaction = GetChampioningFaction();
|
ChampioningFaction = GetChampioningFaction();
|
||||||
}
|
}
|
||||||
|
|
||||||
TeamId teamId = GetTeamId(true); // Always check player original reputation when rewarding
|
TeamId teamId = GetTeamId(); // Always check player original reputation when rewarding
|
||||||
|
|
||||||
if (Rep->RepFaction1 && (!Rep->TeamDependent || teamId == TEAM_ALLIANCE))
|
if (Rep->RepFaction1 && (!Rep->TeamDependent || teamId == TEAM_ALLIANCE))
|
||||||
{
|
{
|
||||||
@@ -6065,7 +6066,7 @@ bool Player::RewardHonor(Unit* uVictim, uint32 groupsize, int32 honor, bool awar
|
|||||||
ApplyModUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 1, true);
|
ApplyModUInt32Value(PLAYER_FIELD_LIFETIME_HONORABLE_KILLS, 1, true);
|
||||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL);
|
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_EARN_HONORABLE_KILL);
|
||||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, victim->getClass());
|
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_CLASS, victim->getClass());
|
||||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, victim->getRace(true));
|
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HK_RACE, victim->getRace());
|
||||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId());
|
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL_AT_AREA, GetAreaId());
|
||||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, victim);
|
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_HONORABLE_KILL, 1, 0, victim);
|
||||||
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim);
|
UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_SPECIAL_PVP_KILL, 1, 0, victim);
|
||||||
@@ -10270,7 +10271,7 @@ bool Player::ActivateTaxiPathTo(std::vector<uint32> const& nodes, Creature* npc
|
|||||||
// only one mount ID for both sides. Probably not good to use 315 in case DBC nodes
|
// only one mount ID for both sides. Probably not good to use 315 in case DBC nodes
|
||||||
// change but I couldn't find a suitable alternative. OK to use class because only DK
|
// change but I couldn't find a suitable alternative. OK to use class because only DK
|
||||||
// can use this taxi.
|
// can use this taxi.
|
||||||
uint32 mount_display_id = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetTeamId(true), npc == nullptr || (sourcenode == 315 && getClass() == CLASS_DEATH_KNIGHT));
|
uint32 mount_display_id = sObjectMgr->GetTaxiMountDisplayId(sourcenode, GetTeamId(), npc == nullptr || (sourcenode == 315 && getClass() == CLASS_DEATH_KNIGHT));
|
||||||
|
|
||||||
// in spell case allow 0 model
|
// in spell case allow 0 model
|
||||||
if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0)
|
if ((mount_display_id == 0 && spellid == 0) || sourcepath == 0)
|
||||||
@@ -10365,7 +10366,7 @@ void Player::ContinueTaxiFlight()
|
|||||||
|
|
||||||
LOG_DEBUG("entities.unit", "WORLD: Restart character {} taxi flight", GetGUID().ToString());
|
LOG_DEBUG("entities.unit", "WORLD: Restart character {} taxi flight", GetGUID().ToString());
|
||||||
|
|
||||||
uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeamId(true), true);
|
uint32 mountDisplayId = sObjectMgr->GetTaxiMountDisplayId(sourceNode, GetTeamId(), true);
|
||||||
if (!mountDisplayId)
|
if (!mountDisplayId)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -10534,7 +10535,7 @@ void Player::InitDataForForm(bool reapplyMods)
|
|||||||
|
|
||||||
void Player::InitDisplayIds()
|
void Player::InitDisplayIds()
|
||||||
{
|
{
|
||||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(true), getClass());
|
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
|
||||||
if (!info)
|
if (!info)
|
||||||
{
|
{
|
||||||
LOG_ERROR("entities.player", "Player {} has incorrect race/class pair. Can't init display ids.", GetGUID().ToString());
|
LOG_ERROR("entities.player", "Player {} has incorrect race/class pair. Can't init display ids.", GetGUID().ToString());
|
||||||
@@ -10655,7 +10656,7 @@ bool Player::BuyItemFromVendorSlot(ObjectGuid vendorguid, uint32 vendorslot, uin
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!IsGameMaster() && ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && GetTeamId(true) == TEAM_ALLIANCE) || (pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && GetTeamId(true) == TEAM_HORDE)))
|
if (!IsGameMaster() && ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY && GetTeamId() == TEAM_ALLIANCE) || (pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY && GetTeamId() == TEAM_HORDE)))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -11317,7 +11318,7 @@ void Player::ReportedAfkBy(Player* reporter)
|
|||||||
|
|
||||||
WorldLocation Player::GetStartPosition() const
|
WorldLocation Player::GetStartPosition() const
|
||||||
{
|
{
|
||||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(true), getClass());
|
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
|
||||||
uint32 mapId = info->mapId;
|
uint32 mapId = info->mapId;
|
||||||
if (getClass() == CLASS_DEATH_KNIGHT && HasSpell(50977))
|
if (getClass() == CLASS_DEATH_KNIGHT && HasSpell(50977))
|
||||||
return WorldLocation(0, 2352.0f, -5709.0f, 154.5f, 0.0f);
|
return WorldLocation(0, 2352.0f, -5709.0f, 154.5f, 0.0f);
|
||||||
@@ -14599,7 +14600,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
|||||||
stmt->SetData(index++, GetGUID().GetCounter());
|
stmt->SetData(index++, GetGUID().GetCounter());
|
||||||
stmt->SetData(index++, GetSession()->GetAccountId());
|
stmt->SetData(index++, GetSession()->GetAccountId());
|
||||||
stmt->SetData(index++, GetName());
|
stmt->SetData(index++, GetName());
|
||||||
stmt->SetData(index++, getRace(true));
|
stmt->SetData(index++, getRace());
|
||||||
stmt->SetData(index++, getClass());
|
stmt->SetData(index++, getClass());
|
||||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
|
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
|
||||||
stmt->SetData(index++, GetLevel());
|
stmt->SetData(index++, GetLevel());
|
||||||
@@ -14717,7 +14718,7 @@ void Player::_SaveCharacter(bool create, CharacterDatabaseTransaction trans)
|
|||||||
// Update query
|
// Update query
|
||||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER);
|
stmt = CharacterDatabase.GetPreparedStatement(CHAR_UPD_CHARACTER);
|
||||||
stmt->SetData(index++, GetName());
|
stmt->SetData(index++, GetName());
|
||||||
stmt->SetData(index++, getRace(true));
|
stmt->SetData(index++, getRace());
|
||||||
stmt->SetData(index++, getClass());
|
stmt->SetData(index++, getClass());
|
||||||
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
|
stmt->SetData(index++, GetByteValue(PLAYER_BYTES_3, 0)); // save gender from PLAYER_BYTES_3, UNIT_BYTES_0 changes with every transform effect
|
||||||
stmt->SetData(index++, GetLevel());
|
stmt->SetData(index++, GetLevel());
|
||||||
|
|||||||
@@ -2056,9 +2056,9 @@ public:
|
|||||||
void CheckAreaExploreAndOutdoor();
|
void CheckAreaExploreAndOutdoor();
|
||||||
|
|
||||||
static TeamId TeamIdForRace(uint8 race);
|
static TeamId TeamIdForRace(uint8 race);
|
||||||
[[nodiscard]] TeamId GetTeamId(bool original = false) const { return original ? TeamIdForRace(getRace(true)) : m_team; };
|
[[nodiscard]] uint32 GetTeam() const { return m_team; }
|
||||||
|
[[nodiscard]] TeamId GetTeamId() const { return m_team == ALLIANCE ? TEAM_ALLIANCE : TEAM_HORDE; }
|
||||||
void SetFactionForRace(uint8 race);
|
void SetFactionForRace(uint8 race);
|
||||||
void setTeamId(TeamId teamid) { m_team = teamid; };
|
|
||||||
|
|
||||||
void InitDisplayIds();
|
void InitDisplayIds();
|
||||||
|
|
||||||
@@ -2709,7 +2709,7 @@ public:
|
|||||||
void outDebugValues() const;
|
void outDebugValues() const;
|
||||||
ObjectGuid m_lootGuid;
|
ObjectGuid m_lootGuid;
|
||||||
|
|
||||||
TeamId m_team;
|
uint32 m_team;
|
||||||
uint32 m_nextSave; // pussywizard
|
uint32 m_nextSave; // pussywizard
|
||||||
uint16 m_additionalSaveTimer; // pussywizard
|
uint16 m_additionalSaveTimer; // pussywizard
|
||||||
uint8 m_additionalSaveMask; // pussywizard
|
uint8 m_additionalSaveMask; // pussywizard
|
||||||
|
|||||||
@@ -2310,12 +2310,12 @@ InventoryResult Player::CanUseItem(ItemTemplate const* proto) const
|
|||||||
return EQUIP_ERR_ITEM_NOT_FOUND;
|
return EQUIP_ERR_ITEM_NOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((proto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && GetTeamId(true) != TEAM_HORDE)
|
if ((proto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && GetTeamId() != TEAM_HORDE)
|
||||||
{
|
{
|
||||||
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((proto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && GetTeamId(true) != TEAM_ALLIANCE)
|
if ((proto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && GetTeamId() != TEAM_ALLIANCE)
|
||||||
{
|
{
|
||||||
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
return EQUIP_ERR_YOU_CAN_NEVER_USE_THAT_ITEM;
|
||||||
}
|
}
|
||||||
@@ -5076,7 +5076,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
|||||||
|
|
||||||
//Need to call it to initialize m_team (m_team can be calculated from race)
|
//Need to call it to initialize m_team (m_team can be calculated from race)
|
||||||
//Other way is to saves m_team into characters table.
|
//Other way is to saves m_team into characters table.
|
||||||
SetFactionForRace(getRace(true));
|
SetFactionForRace(getRace());
|
||||||
|
|
||||||
// pussywizard: create empty instance bind containers if necessary
|
// pussywizard: create empty instance bind containers if necessary
|
||||||
sInstanceSaveMgr->PlayerCreateBoundInstancesMaps(playerGuid);
|
sInstanceSaveMgr->PlayerCreateBoundInstancesMaps(playerGuid);
|
||||||
@@ -5249,7 +5249,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
|||||||
else if (!taxi_nodes.empty())
|
else if (!taxi_nodes.empty())
|
||||||
{
|
{
|
||||||
instanceId = 0;
|
instanceId = 0;
|
||||||
if (!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes, GetTeamId(true)))
|
if (!m_taxi.LoadTaxiDestinationsFromString(taxi_nodes, GetTeamId()))
|
||||||
{
|
{
|
||||||
// xinef: could no load valid data for taxi, relocate to homebind and clear
|
// xinef: could no load valid data for taxi, relocate to homebind and clear
|
||||||
m_taxi.ClearTaxiDestinations();
|
m_taxi.ClearTaxiDestinations();
|
||||||
@@ -5311,7 +5311,7 @@ bool Player::LoadFromDB(ObjectGuid playerGuid, CharacterDatabaseQueryHolder cons
|
|||||||
map = sMapMgr->CreateMap(mapId, this);
|
map = sMapMgr->CreateMap(mapId, this);
|
||||||
if (!map)
|
if (!map)
|
||||||
{
|
{
|
||||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(true), getClass());
|
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
|
||||||
mapId = info->mapId;
|
mapId = info->mapId;
|
||||||
Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
|
Relocate(info->positionX, info->positionY, info->positionZ, 0.0f);
|
||||||
LOG_ERROR("entities.player", "Player (guidlow {}) have invalid coordinates (X: {} Y: {} Z: {} O: {}). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
LOG_ERROR("entities.player", "Player (guidlow {}) have invalid coordinates (X: {} Y: {} Z: {} O: {}). Teleport to default race/class locations.", guid, GetPositionX(), GetPositionY(), GetPositionZ(), GetOrientation());
|
||||||
@@ -6780,7 +6780,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|
|||||||
missingItems = &missingLeaderItems;
|
missingItems = &missingLeaderItems;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (itemRequirement->faction == TEAM_NEUTRAL || itemRequirement->faction == checkPlayer->GetTeamId(true))
|
if (itemRequirement->faction == TEAM_NEUTRAL || itemRequirement->faction == checkPlayer->GetTeamId())
|
||||||
{
|
{
|
||||||
if (!checkPlayer->HasItemCount(itemRequirement->id, 1))
|
if (!checkPlayer->HasItemCount(itemRequirement->id, 1))
|
||||||
{
|
{
|
||||||
@@ -6802,7 +6802,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|
|||||||
missingAchievements = &missingLeaderAchievements;
|
missingAchievements = &missingLeaderAchievements;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (achievementRequirement->faction == TEAM_NEUTRAL || achievementRequirement->faction == GetTeamId(true))
|
if (achievementRequirement->faction == TEAM_NEUTRAL || achievementRequirement->faction == GetTeamId())
|
||||||
{
|
{
|
||||||
if (!checkPlayer || !checkPlayer->HasAchieved(achievementRequirement->id))
|
if (!checkPlayer || !checkPlayer->HasAchieved(achievementRequirement->id))
|
||||||
{
|
{
|
||||||
@@ -6824,7 +6824,7 @@ bool Player::Satisfy(DungeonProgressionRequirements const* ar, uint32 target_map
|
|||||||
missingQuests = &missingLeaderQuests;
|
missingQuests = &missingLeaderQuests;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (questRequirement->faction == TEAM_NEUTRAL || questRequirement->faction == checkPlayer->GetTeamId(true))
|
if (questRequirement->faction == TEAM_NEUTRAL || questRequirement->faction == checkPlayer->GetTeamId())
|
||||||
{
|
{
|
||||||
if (!checkPlayer->GetQuestRewardStatus(questRequirement->id))
|
if (!checkPlayer->GetQuestRewardStatus(questRequirement->id))
|
||||||
{
|
{
|
||||||
@@ -7005,7 +7005,7 @@ bool Player::CheckInstanceCount(uint32 instanceId) const
|
|||||||
|
|
||||||
bool Player::_LoadHomeBind(PreparedQueryResult result)
|
bool Player::_LoadHomeBind(PreparedQueryResult result)
|
||||||
{
|
{
|
||||||
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(true), getClass());
|
PlayerInfo const* info = sObjectMgr->GetPlayerInfo(getRace(), getClass());
|
||||||
if (!info)
|
if (!info)
|
||||||
{
|
{
|
||||||
LOG_ERROR("entities.player", "Player (Name {}) has incorrect race/class pair. Can't be loaded.", GetName());
|
LOG_ERROR("entities.player", "Player (Name {}) has incorrect race/class pair. Can't be loaded.", GetName());
|
||||||
|
|||||||
@@ -1195,7 +1195,7 @@ void Player::UpdateArea(uint32 newArea)
|
|||||||
else
|
else
|
||||||
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY);
|
RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_SANCTUARY);
|
||||||
|
|
||||||
uint32 const areaRestFlag = (GetTeamId(true) == TEAM_ALLIANCE)
|
uint32 const areaRestFlag = (GetTeamId() == TEAM_ALLIANCE)
|
||||||
? AREA_FLAG_REST_ZONE_ALLIANCE
|
? AREA_FLAG_REST_ZONE_ALLIANCE
|
||||||
: AREA_FLAG_REST_ZONE_HORDE;
|
: AREA_FLAG_REST_ZONE_HORDE;
|
||||||
if (area && area->flags & areaRestFlag)
|
if (area && area->flags & areaRestFlag)
|
||||||
@@ -1255,12 +1255,12 @@ void Player::UpdateZone(uint32 newZone, uint32 newArea)
|
|||||||
{
|
{
|
||||||
case AREATEAM_ALLY:
|
case AREATEAM_ALLY:
|
||||||
pvpInfo.IsInHostileArea =
|
pvpInfo.IsInHostileArea =
|
||||||
GetTeamId(true) != TEAM_ALLIANCE &&
|
GetTeamId() != TEAM_ALLIANCE &&
|
||||||
(sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL);
|
(sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL);
|
||||||
break;
|
break;
|
||||||
case AREATEAM_HORDE:
|
case AREATEAM_HORDE:
|
||||||
pvpInfo.IsInHostileArea =
|
pvpInfo.IsInHostileArea =
|
||||||
GetTeamId(true) != TEAM_HORDE &&
|
GetTeamId() != TEAM_HORDE &&
|
||||||
(sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL);
|
(sWorld->IsPvPRealm() || zone->flags & AREA_FLAG_CAPITAL);
|
||||||
break;
|
break;
|
||||||
case AREATEAM_NONE:
|
case AREATEAM_NONE:
|
||||||
|
|||||||
@@ -9968,9 +9968,15 @@ bool Unit::HandleOverrideClassScriptAuraProc(Unit* victim, uint32 /*damage*/, Au
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Unit::setPowerType(Powers new_powertype)
|
void Unit::setPowerType(Powers new_powertype, bool sendUpdate/* = true*/)
|
||||||
{
|
{
|
||||||
SetByteValue(UNIT_FIELD_BYTES_0, 3, new_powertype);
|
if (getPowerType() == new_powertype)
|
||||||
|
return;
|
||||||
|
|
||||||
|
SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE, new_powertype);
|
||||||
|
|
||||||
|
if (!sendUpdate)
|
||||||
|
return;
|
||||||
|
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
if (GetTypeId() == TYPEID_PLAYER)
|
||||||
{
|
{
|
||||||
@@ -15173,7 +15179,10 @@ uint32 Unit::GetCreatureType() const
|
|||||||
if (ssEntry && ssEntry->creatureType > 0)
|
if (ssEntry && ssEntry->creatureType > 0)
|
||||||
return ssEntry->creatureType;
|
return ssEntry->creatureType;
|
||||||
else
|
else
|
||||||
return CREATURE_TYPE_HUMANOID;
|
{
|
||||||
|
ChrRacesEntry const* raceEntry = sChrRacesStore.AssertEntry(getRace());
|
||||||
|
return raceEntry->CreatureType;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return ToCreature()->GetCreatureTemplate()->type;
|
return ToCreature()->GetCreatureTemplate()->type;
|
||||||
@@ -21277,25 +21286,6 @@ void Unit::BuildCooldownPacket(WorldPacket& data, uint8 flags, PacketCooldowns c
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8 Unit::getRace(bool original) const
|
|
||||||
{
|
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
|
||||||
{
|
|
||||||
if (original)
|
|
||||||
return m_realRace;
|
|
||||||
else
|
|
||||||
return m_race;
|
|
||||||
}
|
|
||||||
|
|
||||||
return GetByteValue(UNIT_FIELD_BYTES_0, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Unit::setRace(uint8 race)
|
|
||||||
{
|
|
||||||
if (GetTypeId() == TYPEID_PLAYER)
|
|
||||||
m_race = race;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if unit in combat with specific unit
|
// Check if unit in combat with specific unit
|
||||||
bool Unit::IsInCombatWith(Unit const* who) const
|
bool Unit::IsInCombatWith(Unit const* who) const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -39,6 +39,14 @@
|
|||||||
#define BASE_MAXDAMAGE 2.0f
|
#define BASE_MAXDAMAGE 2.0f
|
||||||
#define BASE_ATTACK_TIME 2000
|
#define BASE_ATTACK_TIME 2000
|
||||||
|
|
||||||
|
enum UnitBytes0Offsets : uint8
|
||||||
|
{
|
||||||
|
UNIT_BYTES_0_OFFSET_RACE = 0,
|
||||||
|
UNIT_BYTES_0_OFFSET_CLASS = 1,
|
||||||
|
UNIT_BYTES_0_OFFSET_GENDER = 2,
|
||||||
|
UNIT_BYTES_0_OFFSET_POWER_TYPE = 3
|
||||||
|
};
|
||||||
|
|
||||||
enum UnitBytes1Offsets : uint8
|
enum UnitBytes1Offsets : uint8
|
||||||
{
|
{
|
||||||
UNIT_BYTES_1_OFFSET_STAND_STATE = 0,
|
UNIT_BYTES_1_OFFSET_STAND_STATE = 0,
|
||||||
@@ -1432,12 +1440,21 @@ public:
|
|||||||
[[nodiscard]] uint8 GetLevel() const { return getLevel(); }
|
[[nodiscard]] uint8 GetLevel() const { return getLevel(); }
|
||||||
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return GetLevel(); }
|
uint8 getLevelForTarget(WorldObject const* /*target*/) const override { return GetLevel(); }
|
||||||
void SetLevel(uint8 lvl, bool showLevelChange = true);
|
void SetLevel(uint8 lvl, bool showLevelChange = true);
|
||||||
[[nodiscard]] uint8 getRace(bool original = false) const;
|
[[nodiscard]] uint8 getRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE); }
|
||||||
void setRace(uint8 race);
|
void setRace(uint8 race) { SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE, race); }
|
||||||
[[nodiscard]] uint32 getRaceMask() const { return 1 << (getRace(true) - 1); }
|
[[nodiscard]] uint32 getRaceMask() const { return 1 << (getRace() - 1); }
|
||||||
[[nodiscard]] uint8 getClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, 1); }
|
[[nodiscard]] uint8 getClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS); }
|
||||||
|
void setClass(uint8 classId) { SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, classId); }
|
||||||
|
[[nodiscard]] uint8 GetRace() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE); }
|
||||||
|
void SetRace(uint8 race) { SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_RACE, race); }
|
||||||
|
[[nodiscard]] uint32 GetRaceMask() const { return 1 << (getRace() - 1); }
|
||||||
|
[[nodiscard]] uint8 GetClass() const { return GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS); }
|
||||||
|
void SetClass(uint8 classId) { SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_CLASS, classId); }
|
||||||
[[nodiscard]] uint32 getClassMask() const { return 1 << (getClass() - 1); }
|
[[nodiscard]] uint32 getClassMask() const { return 1 << (getClass() - 1); }
|
||||||
[[nodiscard]] uint8 getGender() const { return GetByteValue(UNIT_FIELD_BYTES_0, 2); }
|
Gender getGender() const { return Gender(GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER)); }
|
||||||
|
void setGender(Gender gender) { SetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_GENDER, gender); }
|
||||||
|
virtual Gender GetNativeGender() const { return getGender(); }
|
||||||
|
virtual void SetNativeGender(Gender gender) { setGender(gender); }
|
||||||
|
|
||||||
[[nodiscard]] float GetStat(Stats stat) const { return float(GetUInt32Value(static_cast<uint16>(UNIT_FIELD_STAT0) + stat)); }
|
[[nodiscard]] float GetStat(Stats stat) const { return float(GetUInt32Value(static_cast<uint16>(UNIT_FIELD_STAT0) + stat)); }
|
||||||
void SetStat(Stats stat, int32 val) { SetStatInt32Value(static_cast<uint16>(UNIT_FIELD_STAT0) + stat, val); }
|
void SetStat(Stats stat, int32 val) { SetStatInt32Value(static_cast<uint16>(UNIT_FIELD_STAT0) + stat, val); }
|
||||||
@@ -1468,8 +1485,8 @@ public:
|
|||||||
int32 ModifyHealth(int32 val);
|
int32 ModifyHealth(int32 val);
|
||||||
int32 GetHealthGain(int32 dVal);
|
int32 GetHealthGain(int32 dVal);
|
||||||
|
|
||||||
[[nodiscard]] Powers getPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, 3)); }
|
[[nodiscard]] Powers getPowerType() const { return Powers(GetByteValue(UNIT_FIELD_BYTES_0, UNIT_BYTES_0_OFFSET_POWER_TYPE)); }
|
||||||
void setPowerType(Powers power);
|
void setPowerType(Powers power, bool sendUpdate = true);
|
||||||
[[nodiscard]] uint32 GetPower(Powers power) const { return GetUInt32Value(static_cast<uint16>(UNIT_FIELD_POWER1) + power); }
|
[[nodiscard]] uint32 GetPower(Powers power) const { return GetUInt32Value(static_cast<uint16>(UNIT_FIELD_POWER1) + power); }
|
||||||
[[nodiscard]] uint32 GetMaxPower(Powers power) const { return GetUInt32Value(static_cast<uint16>(UNIT_FIELD_MAXPOWER1) + power); }
|
[[nodiscard]] uint32 GetMaxPower(Powers power) const { return GetUInt32Value(static_cast<uint16>(UNIT_FIELD_MAXPOWER1) + power); }
|
||||||
void SetPower(Powers power, uint32 val, bool withPowerUpdate = true, bool fromRegenerate = false);
|
void SetPower(Powers power, uint32 val, bool withPowerUpdate = true, bool fromRegenerate = false);
|
||||||
|
|||||||
@@ -3744,8 +3744,8 @@ void ObjectMgr::LoadPlayerInfo()
|
|||||||
info->positionY = positionY;
|
info->positionY = positionY;
|
||||||
info->positionZ = positionZ;
|
info->positionZ = positionZ;
|
||||||
info->orientation = orientation;
|
info->orientation = orientation;
|
||||||
info->displayId_m = rEntry->model_m;
|
info->displayId_m = rEntry->MaleDisplayID;
|
||||||
info->displayId_f = rEntry->model_f;
|
info->displayId_f = rEntry->FemaleDisplayID;
|
||||||
_playerInfo[current_race][current_class] = info;
|
_playerInfo[current_race][current_class] = info;
|
||||||
|
|
||||||
++count;
|
++count;
|
||||||
|
|||||||
@@ -1441,7 +1441,7 @@ void Guild::HandleInviteMember(WorldSession* session, std::string const& name)
|
|||||||
if (pInvitee->GetSocial()->HasIgnore(player->GetGUID()))
|
if (pInvitee->GetSocial()->HasIgnore(player->GetGUID()))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeamId(true) != player->GetTeamId(true))
|
if (!sWorld->getBoolConfig(CONFIG_ALLOW_TWO_SIDE_INTERACTION_GUILD) && pInvitee->GetTeamId() != player->GetTeamId())
|
||||||
{
|
{
|
||||||
SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_NOT_ALLIED, name);
|
SendCommandResult(session, GUILD_COMMAND_INVITE, ERR_GUILD_NOT_ALLIED, name);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -308,10 +308,10 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// prevent character creating Expansion race without Expansion account
|
// prevent character creating Expansion race without Expansion account
|
||||||
if (raceEntry->expansion > Expansion())
|
if (raceEntry->RequiredExpansion > Expansion())
|
||||||
{
|
{
|
||||||
SendCharCreate(CHAR_CREATE_EXPANSION);
|
SendCharCreate(CHAR_CREATE_EXPANSION);
|
||||||
LOG_ERROR("network.opcode", "Expansion {} account:[{}] tried to Create character with expansion {} race ({})", Expansion(), GetAccountId(), raceEntry->expansion, createInfo->Race);
|
LOG_ERROR("network.opcode", "Expansion {} account:[{}] tried to Create character with expansion {} race ({})", Expansion(), GetAccountId(), raceEntry->RequiredExpansion, createInfo->Race);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -325,6 +325,13 @@ void WorldSession::HandleCharCreateOpcode(WorldPacket& recvData)
|
|||||||
|
|
||||||
if (AccountMgr::IsPlayerAccount(GetSecurity()))
|
if (AccountMgr::IsPlayerAccount(GetSecurity()))
|
||||||
{
|
{
|
||||||
|
if (raceEntry->Alliance == CHRRACES_ALLIANCE_TYPE_NOT_PLAYABLE || raceEntry->HasFlag(CHRRACES_FLAGS_NOT_PLAYABLE))
|
||||||
|
{
|
||||||
|
LOG_ERROR("network", "Race ({}) was not playable but requested while creating new char for account (ID: {}): wrong DBC files or cheater?", createInfo->Race, GetAccountId());
|
||||||
|
SendCharCreate(CHAR_CREATE_DISABLED);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
uint32 raceMaskDisabled = sWorld->getIntConfig(CONFIG_CHARACTER_CREATING_DISABLED_RACEMASK);
|
||||||
if ((1 << (createInfo->Race - 1)) & raceMaskDisabled)
|
if ((1 << (createInfo->Race - 1)) & raceMaskDisabled)
|
||||||
{
|
{
|
||||||
@@ -871,7 +878,7 @@ void WorldSession::HandlePlayerLoginFromDB(LoginQueryHolder const& holder)
|
|||||||
if (cEntry->CinematicSequence)
|
if (cEntry->CinematicSequence)
|
||||||
pCurrChar->SendCinematicStart(cEntry->CinematicSequence);
|
pCurrChar->SendCinematicStart(cEntry->CinematicSequence);
|
||||||
else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace()))
|
else if (ChrRacesEntry const* rEntry = sChrRacesStore.LookupEntry(pCurrChar->getRace()))
|
||||||
pCurrChar->SendCinematicStart(rEntry->CinematicSequence);
|
pCurrChar->SendCinematicStart(rEntry->CinematicSequenceID);
|
||||||
|
|
||||||
// send new char string if not empty
|
// send new char string if not empty
|
||||||
if (!sWorld->GetNewCharString().empty())
|
if (!sWorld->GetNewCharString().empty())
|
||||||
|
|||||||
@@ -741,7 +741,7 @@ void WorldSession::HandleAreaTriggerOpcode(WorldPacket& recv_data)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32 teamFaction = player->GetTeamId(true) == TEAM_ALLIANCE ? FACTION_MASK_ALLIANCE : FACTION_MASK_HORDE;
|
uint32 teamFaction = player->GetTeamId() == TEAM_ALLIANCE ? FACTION_MASK_ALLIANCE : FACTION_MASK_HORDE;
|
||||||
bool isTavernAreatrigger = sObjectMgr->IsTavernAreaTrigger(triggerId, teamFaction);
|
bool isTavernAreatrigger = sObjectMgr->IsTavernAreaTrigger(triggerId, teamFaction);
|
||||||
if (!player->IsInAreaTriggerRadius(atEntry, isTavernAreatrigger ? 5.f : 0.f))
|
if (!player->IsInAreaTriggerRadius(atEntry, isTavernAreatrigger ? 5.f : 0.f))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -439,12 +439,12 @@ bool LootItem::AllowedForPlayer(Player const* player, ObjectGuid source) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
// not show loot for not own team
|
// not show loot for not own team
|
||||||
if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeamId(true) != TEAM_HORDE)
|
if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_HORDE_ONLY) && player->GetTeamId() != TEAM_HORDE)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && player->GetTeamId(true) != TEAM_ALLIANCE)
|
if ((pProto->Flags2 & ITEM_FLAGS_EXTRA_ALLIANCE_ONLY) && player->GetTeamId() != TEAM_ALLIANCE)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5104,17 +5104,13 @@ void AuraEffect::HandleAuraDummy(AuraApplication const* aurApp, uint8 mode, bool
|
|||||||
target->PlayDistanceSound(11965);
|
target->PlayDistanceSound(11965);
|
||||||
break;
|
break;
|
||||||
case 46354: // Blood Elf Illusion
|
case 46354: // Blood Elf Illusion
|
||||||
|
// We change this to a if statement since workflow failed due to not having nuetral race as a part of the switch.
|
||||||
if (caster)
|
if (caster)
|
||||||
{
|
{
|
||||||
switch (caster->getGender())
|
if (caster->getGender() == GENDER_FEMALE)
|
||||||
{
|
|
||||||
case GENDER_FEMALE:
|
|
||||||
caster->CastSpell(target, 46356, true, nullptr, this);
|
caster->CastSpell(target, 46356, true, nullptr, this);
|
||||||
break;
|
else
|
||||||
case GENDER_MALE:
|
|
||||||
caster->CastSpell(target, 46355, true, nullptr, this);
|
caster->CastSpell(target, 46355, true, nullptr, this);
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 46361: // Reinforced Net
|
case 46361: // Reinforced Net
|
||||||
|
|||||||
@@ -2204,7 +2204,7 @@ void World::DetectDBCLang()
|
|||||||
uint8 default_locale = TOTAL_LOCALES;
|
uint8 default_locale = TOTAL_LOCALES;
|
||||||
for (uint8 i = default_locale - 1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
|
for (uint8 i = default_locale - 1; i < TOTAL_LOCALES; --i) // -1 will be 255 due to uint8
|
||||||
{
|
{
|
||||||
if (race->name[i][0] != '\0') // check by race names
|
if (race->Name[i][0] != '\0') // check by race names
|
||||||
{
|
{
|
||||||
default_locale = i;
|
default_locale = i;
|
||||||
_availableDbcLocaleMask |= (1 << i);
|
_availableDbcLocaleMask |= (1 << i);
|
||||||
|
|||||||
@@ -134,6 +134,11 @@ void OutdoorPvPTF::ResetZoneToTeamControlled(TeamId team)
|
|||||||
m_HordeTowersControlled = 0;
|
m_HordeTowersControlled = 0;
|
||||||
m_AllianceTowersControlled = 0;
|
m_AllianceTowersControlled = 0;
|
||||||
break;
|
break;
|
||||||
|
case HORDE_FACTION:
|
||||||
|
case ALLIANCE_FACTION:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& [guid, tower] : m_capturePoints)
|
for (auto& [guid, tower] : m_capturePoints)
|
||||||
@@ -164,6 +169,11 @@ void OPvPCapturePointTF::ResetToTeamControlled(TeamId team)
|
|||||||
m_OldState = OBJECTIVESTATE_NEUTRAL;
|
m_OldState = OBJECTIVESTATE_NEUTRAL;
|
||||||
m_team = TEAM_NEUTRAL;
|
m_team = TEAM_NEUTRAL;
|
||||||
break;
|
break;
|
||||||
|
case HORDE_FACTION:
|
||||||
|
case ALLIANCE_FACTION:
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_value = 0.0f;
|
m_value = 0.0f;
|
||||||
|
|||||||
@@ -180,13 +180,13 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
|||||||
{
|
{
|
||||||
_state = ARGENT_PONY_STATE_ENCH;
|
_state = ARGENT_PONY_STATE_ENCH;
|
||||||
|
|
||||||
aura = (player->GetTeamId(true) == TEAM_ALLIANCE ? SPELL_AURA_TIRED_S : SPELL_AURA_TIRED_G);
|
aura = (player->GetTeamId() == TEAM_ALLIANCE ? SPELL_AURA_TIRED_S : SPELL_AURA_TIRED_G);
|
||||||
duration = player->GetSpellCooldownDelay(aura);
|
duration = player->GetSpellCooldownDelay(aura);
|
||||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP);
|
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP);
|
||||||
|
|
||||||
for (uint8 i = 0; i < 3; ++i)
|
for (uint8 i = 0; i < 3; ++i)
|
||||||
{
|
{
|
||||||
if (player->GetTeamId(true) == TEAM_ALLIANCE)
|
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||||
{
|
{
|
||||||
if (uint32 cooldown = player->GetSpellCooldownDelay(SPELL_AURA_POSTMAN_S + i))
|
if (uint32 cooldown = player->GetSpellCooldownDelay(SPELL_AURA_POSTMAN_S + i))
|
||||||
{
|
{
|
||||||
@@ -211,7 +211,7 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Generate Banners
|
// Generate Banners
|
||||||
uint32 mask = player->GetTeamId(true) ? RACEMASK_HORDE : RACEMASK_ALLIANCE;
|
uint32 mask = player->GetTeamId() ? RACEMASK_HORDE : RACEMASK_ALLIANCE;
|
||||||
for (uint8 i = 1; i < MAX_RACES; ++i)
|
for (uint8 i = 1; i < MAX_RACES; ++i)
|
||||||
if (mask & (1 << (i - 1)) && player->HasAchieved(argentBanners[i].achievement))
|
if (mask & (1 << (i - 1)) && player->HasAchieved(argentBanners[i].achievement))
|
||||||
_banners[i] = true;
|
_banners[i] = true;
|
||||||
@@ -268,7 +268,7 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
|||||||
if (player->GetGUID() != creature->GetOwnerGUID())
|
if (player->GetGUID() != creature->GetOwnerGUID())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!creature->HasAura(player->GetTeamId(true) ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S))
|
if (!creature->HasAura(player->GetTeamId() ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S))
|
||||||
{
|
{
|
||||||
uint8 _state = creature->AI()->GetData(0 /*GET_DATA_STATE*/);
|
uint8 _state = creature->AI()->GetData(0 /*GET_DATA_STATE*/);
|
||||||
if (_state == ARGENT_PONY_STATE_ENCH || _state == ARGENT_PONY_STATE_VENDOR)
|
if (_state == ARGENT_PONY_STATE_ENCH || _state == ARGENT_PONY_STATE_VENDOR)
|
||||||
@@ -296,20 +296,20 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
|||||||
case GOSSIP_ACTION_TRADE:
|
case GOSSIP_ACTION_TRADE:
|
||||||
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_VENDOR);
|
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_VENDOR);
|
||||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||||
spellId = player->GetTeamId(true) ? SPELL_AURA_SHOP_G : SPELL_AURA_SHOP_S;
|
spellId = player->GetTeamId() ? SPELL_AURA_SHOP_G : SPELL_AURA_SHOP_S;
|
||||||
creature->AI()->DoAction(ARGENT_PONY_STATE_VENDOR);
|
creature->AI()->DoAction(ARGENT_PONY_STATE_VENDOR);
|
||||||
break;
|
break;
|
||||||
case GOSSIP_ACTION_BANK:
|
case GOSSIP_ACTION_BANK:
|
||||||
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_BANKER);
|
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_BANKER);
|
||||||
player->GetSession()->SendShowBank(player->GetGUID());
|
player->GetSession()->SendShowBank(player->GetGUID());
|
||||||
spellId = player->GetTeamId(true) ? SPELL_AURA_BANK_G : SPELL_AURA_BANK_S;
|
spellId = player->GetTeamId() ? SPELL_AURA_BANK_G : SPELL_AURA_BANK_S;
|
||||||
creature->AI()->DoAction(ARGENT_PONY_STATE_BANK);
|
creature->AI()->DoAction(ARGENT_PONY_STATE_BANK);
|
||||||
break;
|
break;
|
||||||
case GOSSIP_ACTION_MAILBOX:
|
case GOSSIP_ACTION_MAILBOX:
|
||||||
{
|
{
|
||||||
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_MAILBOX);
|
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_MAILBOX);
|
||||||
player->GetSession()->SendShowMailBox(creature->GetGUID());
|
player->GetSession()->SendShowMailBox(creature->GetGUID());
|
||||||
spellId = player->GetTeamId(true) ? SPELL_AURA_POSTMAN_G : SPELL_AURA_POSTMAN_S;
|
spellId = player->GetTeamId() ? SPELL_AURA_POSTMAN_G : SPELL_AURA_POSTMAN_S;
|
||||||
creature->AI()->DoAction(ARGENT_PONY_STATE_MAILBOX);
|
creature->AI()->DoAction(ARGENT_PONY_STATE_MAILBOX);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -326,7 +326,7 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
|||||||
{
|
{
|
||||||
creature->CastSpell(creature, spellId, true);
|
creature->CastSpell(creature, spellId, true);
|
||||||
player->AddSpellCooldown(spellId, 0, 3 * MINUTE * IN_MILLISECONDS);
|
player->AddSpellCooldown(spellId, 0, 3 * MINUTE * IN_MILLISECONDS);
|
||||||
player->AddSpellCooldown(player->GetTeamId(true) ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S, 0, 3 * MINUTE * IN_MILLISECONDS + 4 * HOUR * IN_MILLISECONDS);
|
player->AddSpellCooldown(player->GetTeamId() ? SPELL_AURA_TIRED_G : SPELL_AURA_TIRED_S, 0, 3 * MINUTE * IN_MILLISECONDS + 4 * HOUR * IN_MILLISECONDS);
|
||||||
creature->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS);
|
creature->DespawnOrUnsummon(3 * MINUTE * IN_MILLISECONDS);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -1968,7 +1968,7 @@ class spell_pvp_trinket_wotf_shared_cd : public SpellScript
|
|||||||
// Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
|
// Spell::SendSpellCooldown() skips all spells with TRIGGERED_IGNORE_SPELL_AND_CATEGORY_CD
|
||||||
player->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell());
|
player->AddSpellAndCategoryCooldowns(GetSpellInfo(), GetCastItem() ? GetCastItem()->GetEntry() : 0, GetSpell());
|
||||||
|
|
||||||
if (player->GetTeamId(true) == TEAM_HORDE)
|
if (player->GetTeamId() == TEAM_HORDE)
|
||||||
{
|
{
|
||||||
if (GetSpellInfo()->Id == SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)
|
if (GetSpellInfo()->Id == SPELL_WILL_OF_THE_FORSAKEN_COOLDOWN_TRIGGER)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -3643,7 +3643,7 @@ class spell_item_recall : public SpellScript
|
|||||||
}
|
}
|
||||||
|
|
||||||
TeamId bgTeam = player->GetBgTeamId();
|
TeamId bgTeam = player->GetBgTeamId();
|
||||||
if (player->GetTeamId(true) != bgTeam)
|
if (player->GetTeamId() != bgTeam)
|
||||||
{
|
{
|
||||||
if (SpellTargetPosition const* recallSpellTarget = sSpellMgr->GetSpellTargetPosition(bgTeam == TEAM_HORDE ? SPELL_RECALL_HORDE : SPELL_RECALL_ALLIANCE, EFFECT_0))
|
if (SpellTargetPosition const* recallSpellTarget = sSpellMgr->GetSpellTargetPosition(bgTeam == TEAM_HORDE ? SPELL_RECALL_HORDE : SPELL_RECALL_ALLIANCE, EFFECT_0))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -668,6 +668,13 @@ struct ChrClassesEntry
|
|||||||
uint32 expansion; // 59 (0 - original race, 1 - tbc addon, ...)
|
uint32 expansion; // 59 (0 - original race, 1 - tbc addon, ...)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum ChrRacesAllianceType
|
||||||
|
{
|
||||||
|
CHRRACES_ALLIANCE_TYPE_ALLIANCE = 0,
|
||||||
|
CHRRACES_ALLIANCE_TYPE_HORDE = 1,
|
||||||
|
CHRRACES_ALLIANCE_TYPE_NOT_PLAYABLE = 2,
|
||||||
|
};
|
||||||
|
|
||||||
enum ChrRacesFlags
|
enum ChrRacesFlags
|
||||||
{
|
{
|
||||||
CHRRACES_FLAGS_NOT_PLAYABLE = 0x01,
|
CHRRACES_FLAGS_NOT_PLAYABLE = 0x01,
|
||||||
@@ -677,25 +684,29 @@ enum ChrRacesFlags
|
|||||||
|
|
||||||
struct ChrRacesEntry
|
struct ChrRacesEntry
|
||||||
{
|
{
|
||||||
uint32 RaceID; // 0
|
uint32 ID; // 0
|
||||||
uint32 Flags; // 1
|
uint32 Flags; // 1
|
||||||
uint32 FactionID; // 2 facton template id
|
uint32 FactionID; // 2
|
||||||
// 3 unused
|
//uint32 ExplorationSoundID; // 3
|
||||||
uint32 model_m; // 4
|
uint32 MaleDisplayID; // 4
|
||||||
uint32 model_f; // 5
|
uint32 FemaleDisplayID; // 5
|
||||||
// 6 unused
|
//char const* ClientPrefix; // 6
|
||||||
uint32 TeamID; // 7 (7-Alliance 1-Horde)
|
uint32 BaseLanguage; // 7 (7-Alliance 1-Horde)
|
||||||
// 8-11 unused
|
uint32 CreatureType; // 8
|
||||||
uint32 CinematicSequence; // 12 id from CinematicSequences.dbc
|
uint32 ResSicknessSpellID; // 9
|
||||||
//uint32 unk_322; // 13 faction (0 alliance, 1 horde, 2 not available?)
|
//uint32 SplashSoundID; // 10
|
||||||
char const* name[16]; // 14-29 used for DBC language detection/selection
|
//char const* ClientFileString; // 11
|
||||||
// 30 string flags, unused
|
uint32 CinematicSequenceID; // 12 ID from CinematicSequences.dbc
|
||||||
//char const* nameFemale[16]; // 31-46, if different from base (male) case
|
uint32 Alliance; // 13
|
||||||
// 47 string flags, unused
|
char const* Name[16]; // 14-29
|
||||||
//char const* nameNeutralGender[16]; // 48-63, if different from base (male) case
|
//uint32 Name_lang_mask; // 30
|
||||||
// 64 string flags, unused
|
//char const* NameFemale[16]; // 31-46
|
||||||
// 65-67 unused
|
//uint32 NameFemale_lang_mask; // 47
|
||||||
uint32 expansion; // 68 (0 - original race, 1 - tbc addon, ...)
|
//char const* NameMale[16]; // 48-63
|
||||||
|
//uint32 NameMale_lang_mask; // 64
|
||||||
|
//char const* FacialHairCustomization[2]; // 65-66
|
||||||
|
//char const* HairCustomization; // 67
|
||||||
|
uint32 RequiredExpansion; // 68
|
||||||
|
|
||||||
inline bool HasFlag(ChrRacesFlags flag) const { return (Flags & flag) != 0; }
|
inline bool HasFlag(ChrRacesFlags flag) const { return (Flags & flag) != 0; }
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ char constexpr CharStartOutfitEntryfmt[] = "dbbbXiiiiiiiiiiiiiiiiiiiiiiiixxxxxxx
|
|||||||
char constexpr CharTitlesEntryfmt[] = "nxssssssssssssssssxssssssssssssssssxi";
|
char constexpr CharTitlesEntryfmt[] = "nxssssssssssssssssxssssssssssssssssxi";
|
||||||
char constexpr ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; // ChatChannelsEntryfmt, index not used (more compact store)
|
char constexpr ChatChannelsEntryfmt[] = "nixssssssssssssssssxxxxxxxxxxxxxxxxxx"; // ChatChannelsEntryfmt, index not used (more compact store)
|
||||||
char constexpr ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
|
char constexpr ChrClassesEntryfmt[] = "nxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxixii";
|
||||||
char constexpr ChrRacesEntryfmt[] = "niixiixixxxxixssssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
char constexpr ChrRacesEntryfmt[] = "niixiixiiixxiissssssssssssssssxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxi";
|
||||||
char constexpr CinematicCameraEntryfmt[] = "nsiffff";
|
char constexpr CinematicCameraEntryfmt[] = "nsiffff";
|
||||||
char constexpr CinematicSequencesEntryfmt[] = "nxixxxxxxx";
|
char constexpr CinematicSequencesEntryfmt[] = "nxixxxxxxx";
|
||||||
char constexpr CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxx";
|
char constexpr CreatureDisplayInfofmt[] = "nixifxxxxxxxxxxx";
|
||||||
|
|||||||
@@ -730,8 +730,10 @@ enum Language
|
|||||||
enum TeamId
|
enum TeamId
|
||||||
{
|
{
|
||||||
TEAM_ALLIANCE = 0,
|
TEAM_ALLIANCE = 0,
|
||||||
TEAM_HORDE,
|
TEAM_HORDE = 1,
|
||||||
TEAM_NEUTRAL,
|
TEAM_NEUTRAL = 2,
|
||||||
|
HORDE_FACTION = 67,
|
||||||
|
ALLIANCE_FACTION = 469
|
||||||
};
|
};
|
||||||
|
|
||||||
enum Team
|
enum Team
|
||||||
|
|||||||
Reference in New Issue
Block a user