mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
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:
@@ -134,6 +134,11 @@ void OutdoorPvPTF::ResetZoneToTeamControlled(TeamId team)
|
||||
m_HordeTowersControlled = 0;
|
||||
m_AllianceTowersControlled = 0;
|
||||
break;
|
||||
case HORDE_FACTION:
|
||||
case ALLIANCE_FACTION:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (auto& [guid, tower] : m_capturePoints)
|
||||
@@ -164,6 +169,11 @@ void OPvPCapturePointTF::ResetToTeamControlled(TeamId team)
|
||||
m_OldState = OBJECTIVESTATE_NEUTRAL;
|
||||
m_team = TEAM_NEUTRAL;
|
||||
break;
|
||||
case HORDE_FACTION:
|
||||
case ALLIANCE_FACTION:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_value = 0.0f;
|
||||
|
||||
@@ -180,13 +180,13 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
||||
{
|
||||
_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);
|
||||
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP);
|
||||
|
||||
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))
|
||||
{
|
||||
@@ -211,7 +211,7 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
||||
}
|
||||
|
||||
// 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)
|
||||
if (mask & (1 << (i - 1)) && player->HasAchieved(argentBanners[i].achievement))
|
||||
_banners[i] = true;
|
||||
@@ -268,7 +268,7 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
||||
if (player->GetGUID() != creature->GetOwnerGUID())
|
||||
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*/);
|
||||
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:
|
||||
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_VENDOR);
|
||||
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);
|
||||
break;
|
||||
case GOSSIP_ACTION_BANK:
|
||||
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_BANKER);
|
||||
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);
|
||||
break;
|
||||
case GOSSIP_ACTION_MAILBOX:
|
||||
{
|
||||
creature->ReplaceAllNpcFlags(UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_MAILBOX);
|
||||
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);
|
||||
break;
|
||||
}
|
||||
@@ -326,7 +326,7 @@ struct npc_pet_gen_argent_pony_bridle : public ScriptedAI
|
||||
{
|
||||
creature->CastSpell(creature, spellId, true);
|
||||
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);
|
||||
}
|
||||
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
|
||||
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)
|
||||
{
|
||||
|
||||
@@ -3643,7 +3643,7 @@ class spell_item_recall : public SpellScript
|
||||
}
|
||||
|
||||
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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user