Core/Datastores: updated DBC structure names to generated member format
This commit is contained in:
1 parent
06ffa70afc
commit
fcb79fee07
105 files changed
+2301
-2328
No files matched your search
@@ -3303,15 +3303,15 @@ void Unit::ProcessTerrainStatusUpdate(ZLiquidStatus status, Optional<LiquidData>
|
||||
curLiquid = sLiquidTypeStore.LookupEntry(liquidData->entry);
|
||||
if (curLiquid != _lastLiquid)
|
||||
{
|
||||
if (_lastLiquid && _lastLiquid->SpellId)
|
||||
RemoveAurasDueToSpell(_lastLiquid->SpellId);
|
||||
if (_lastLiquid && _lastLiquid->SpellID)
|
||||
RemoveAurasDueToSpell(_lastLiquid->SpellID);
|
||||
Player* player = GetCharmerOrOwnerPlayerOrPlayerItself();
|
||||
|
||||
// Set _lastLiquid before casting liquid spell to avoid infinite loops
|
||||
_lastLiquid = curLiquid;
|
||||
|
||||
if (curLiquid && curLiquid->SpellId && (!player || !player->IsGameMaster()))
|
||||
CastSpell(this, curLiquid->SpellId, true);
|
||||
if (curLiquid && curLiquid->SpellID && (!player || !player->IsGameMaster()))
|
||||
CastSpell(this, curLiquid->SpellID, true);
|
||||
|
||||
// Update mount capabilities when changing liquidstatus (enabling / disabling flight auras for example)
|
||||
if (player)
|
||||
@@ -5515,12 +5515,12 @@ ReputationRank Unit::GetReactionTo(Unit const* target) const
|
||||
return *repRank;
|
||||
if (!selfPlayerOwner->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION))
|
||||
{
|
||||
if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->faction))
|
||||
if (FactionEntry const* targetFactionEntry = sFactionStore.LookupEntry(targetFactionTemplateEntry->Faction))
|
||||
{
|
||||
if (targetFactionEntry->CanHaveReputation())
|
||||
{
|
||||
// check contested flags
|
||||
if (targetFactionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
if (targetFactionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
&& selfPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
return REP_HOSTILE;
|
||||
|
||||
@@ -5550,14 +5550,14 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
|
||||
if (Player const* targetPlayerOwner = target->GetAffectingPlayer())
|
||||
{
|
||||
// check contested flags
|
||||
if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_CONTESTED_GUARD
|
||||
&& targetPlayerOwner->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP))
|
||||
return REP_HOSTILE;
|
||||
if (ReputationRank const* repRank = targetPlayerOwner->GetReputationMgr().GetForcedRankIfAny(factionTemplateEntry))
|
||||
return *repRank;
|
||||
if (!target->HasFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_IGNORE_REPUTATION))
|
||||
{
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->faction))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplateEntry->Faction))
|
||||
{
|
||||
if (factionEntry->CanHaveReputation())
|
||||
{
|
||||
@@ -5578,7 +5578,7 @@ ReputationRank Unit::GetFactionReactionTo(FactionTemplateEntry const* factionTem
|
||||
return REP_FRIENDLY;
|
||||
if (targetFactionTemplateEntry->IsFriendlyTo(*factionTemplateEntry))
|
||||
return REP_FRIENDLY;
|
||||
if (factionTemplateEntry->factionFlags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
|
||||
if (factionTemplateEntry->Flags & FACTION_TEMPLATE_FLAG_HOSTILE_BY_DEFAULT)
|
||||
return REP_HOSTILE;
|
||||
// neutral by default
|
||||
return REP_NEUTRAL;
|
||||
@@ -5597,11 +5597,11 @@ bool Unit::IsFriendlyTo(Unit const* unit) const
|
||||
bool Unit::IsHostileToPlayers() const
|
||||
{
|
||||
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
|
||||
if (!my_faction->faction)
|
||||
if (!my_faction->Faction)
|
||||
return false;
|
||||
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
|
||||
if (raw_faction && raw_faction->reputationListID >= 0)
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction);
|
||||
if (raw_faction && raw_faction->ReputationIndex >= 0)
|
||||
return false;
|
||||
|
||||
return my_faction->IsHostileToPlayers();
|
||||
@@ -5610,11 +5610,11 @@ bool Unit::IsHostileToPlayers() const
|
||||
bool Unit::IsNeutralToAll() const
|
||||
{
|
||||
FactionTemplateEntry const* my_faction = GetFactionTemplateEntry();
|
||||
if (!my_faction->faction)
|
||||
if (!my_faction->Faction)
|
||||
return true;
|
||||
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->faction);
|
||||
if (raw_faction && raw_faction->reputationListID >= 0)
|
||||
FactionEntry const* raw_faction = sFactionStore.LookupEntry(my_faction->Faction);
|
||||
if (raw_faction && raw_faction->ReputationIndex >= 0)
|
||||
return false;
|
||||
|
||||
return my_faction->IsNeutralToAll();
|
||||
@@ -6116,7 +6116,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
}
|
||||
}
|
||||
|
||||
if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET)
|
||||
if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET)
|
||||
SetCritterGUID(minion->GetGUID());
|
||||
|
||||
// PvP, FFAPvP
|
||||
@@ -6147,7 +6147,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
|
||||
m_Controlled.erase(minion);
|
||||
|
||||
if (minion->m_Properties && minion->m_Properties->Type == SUMMON_TYPE_MINIPET)
|
||||
if (minion->m_Properties && minion->m_Properties->Title == SUMMON_TYPE_MINIPET)
|
||||
if (GetCritterGUID() == minion->GetGUID())
|
||||
SetCritterGUID(ObjectGuid::Empty);
|
||||
|
||||
@@ -8306,11 +8306,11 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
|
||||
|
||||
for (uint32 i = MAX_MOUNT_CAPABILITIES; i > 0; --i)
|
||||
{
|
||||
MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(mountTypeEntry->MountCapability[i - 1]);
|
||||
MountCapabilityEntry const* mountCapability = sMountCapabilityStore.LookupEntry(mountTypeEntry->Capability[i - 1]);
|
||||
if (!mountCapability)
|
||||
continue;
|
||||
|
||||
if (ridingSkill < mountCapability->RequiredRidingSkill)
|
||||
if (ridingSkill < mountCapability->ReqRidingSkill)
|
||||
continue;
|
||||
|
||||
if (!(mountCapability->Flags & MOUNT_CAPABIILTY_FLAG_IGNORE_RESTRICTIONS))
|
||||
@@ -8344,18 +8344,18 @@ MountCapabilityEntry const* Unit::GetMountCapability(uint32 mountType) const
|
||||
else if (!(mountCapability->Flags & MOUNT_CAPABILITY_FLAG_FLOAT))
|
||||
continue;
|
||||
|
||||
if (mountCapability->RequiredMap != -1 &&
|
||||
int32(GetMapId()) != mountCapability->RequiredMap &&
|
||||
GetMap()->GetEntry()->ParentMapID != mountCapability->RequiredMap)
|
||||
if (mountCapability->ReqMapID != -1 &&
|
||||
int32(GetMapId()) != mountCapability->ReqMapID &&
|
||||
GetMap()->GetEntry()->ParentMapID != mountCapability->ReqMapID)
|
||||
continue;
|
||||
|
||||
if (mountCapability->RequiredArea && !IsInArea(areaId, mountCapability->RequiredArea))
|
||||
if (mountCapability->ReqAreaID && !IsInArea(areaId, mountCapability->ReqAreaID))
|
||||
continue;
|
||||
|
||||
if (mountCapability->RequiredAura && !HasAura(mountCapability->RequiredAura))
|
||||
if (mountCapability->ReqSpellAuraID && !HasAura(mountCapability->ReqSpellAuraID))
|
||||
continue;
|
||||
|
||||
if (mountCapability->RequiredSpell && !HasSpell(mountCapability->RequiredSpell))
|
||||
if (mountCapability->ReqSpellKnownID && !HasSpell(mountCapability->ReqSpellKnownID))
|
||||
continue;
|
||||
|
||||
return mountCapability;
|
||||
@@ -8628,7 +8628,7 @@ bool Unit::_IsValidAttackTarget(Unit const* target, SpellInfo const* bySpell, Wo
|
||||
if (FactionTemplateEntry const* factionTemplate = creature->GetFactionTemplateEntry())
|
||||
{
|
||||
if (!(player->GetReputationMgr().GetForcedRankIfAny(factionTemplate)))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->faction))
|
||||
if (FactionEntry const* factionEntry = sFactionStore.LookupEntry(factionTemplate->Faction))
|
||||
if (FactionState const* repState = player->GetReputationMgr().GetState(factionEntry))
|
||||
if (!(repState->Flags & FACTION_FLAG_AT_WAR))
|
||||
return false;
|
||||
@@ -9713,7 +9713,7 @@ float Unit::GetSpellMaxRangeForTarget(Unit const* target, SpellInfo const* spell
|
||||
{
|
||||
if (!spellInfo->RangeEntry)
|
||||
return 0;
|
||||
if (spellInfo->RangeEntry->maxRangeFriend == spellInfo->RangeEntry->maxRangeHostile)
|
||||
if (spellInfo->RangeEntry->RangeMax[1] == spellInfo->RangeEntry->RangeMax[0])
|
||||
return spellInfo->GetMaxRange();
|
||||
if (!target)
|
||||
return spellInfo->GetMaxRange(true);
|
||||
@@ -9724,7 +9724,7 @@ float Unit::GetSpellMinRangeForTarget(Unit const* target, SpellInfo const* spell
|
||||
{
|
||||
if (!spellInfo->RangeEntry)
|
||||
return 0;
|
||||
if (spellInfo->RangeEntry->minRangeFriend == spellInfo->RangeEntry->minRangeHostile)
|
||||
if (spellInfo->RangeEntry->RangeMin[1] == spellInfo->RangeEntry->RangeMin[0])
|
||||
return spellInfo->GetMinRange();
|
||||
if (!target)
|
||||
return spellInfo->GetMinRange(true);
|
||||
@@ -9737,8 +9737,8 @@ uint32 Unit::GetCreatureType() const
|
||||
{
|
||||
ShapeshiftForm form = GetShapeshiftForm();
|
||||
SpellShapeshiftFormEntry const* ssEntry = sSpellShapeshiftFormStore.LookupEntry(form);
|
||||
if (ssEntry && ssEntry->creatureType > 0)
|
||||
return ssEntry->creatureType;
|
||||
if (ssEntry && ssEntry->CreatureType > 0)
|
||||
return ssEntry->CreatureType;
|
||||
else
|
||||
return CREATURE_TYPE_HUMANOID;
|
||||
}
|
||||
@@ -9771,7 +9771,7 @@ bool Unit::IsInDisallowedMountForm() const
|
||||
if (!shapeshift)
|
||||
return true;
|
||||
|
||||
if (!(shapeshift->flags1 & 0x1))
|
||||
if (!(shapeshift->Flags & 0x1))
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -9782,12 +9782,12 @@ bool Unit::IsInDisallowedMountForm() const
|
||||
if (!display)
|
||||
return true;
|
||||
|
||||
CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtraId);
|
||||
CreatureDisplayInfoExtraEntry const* displayExtra = sCreatureDisplayInfoExtraStore.LookupEntry(display->ExtendedDisplayInfoID);
|
||||
if (!displayExtra)
|
||||
return true;
|
||||
|
||||
CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelId);
|
||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->Race);
|
||||
CreatureModelDataEntry const* model = sCreatureModelDataStore.LookupEntry(display->ModelID);
|
||||
ChrRacesEntry const* race = sChrRacesStore.LookupEntry(displayExtra->DisplayRaceID);
|
||||
|
||||
if (model && !(model->Flags & 0x80))
|
||||
if (race && !(race->Flags & 0x4))
|
||||
@@ -13137,21 +13137,21 @@ uint32 Unit::GetModelForForm(ShapeshiftForm form, uint32 spellId) const
|
||||
|
||||
uint32 modelid = 0;
|
||||
SpellShapeshiftFormEntry const* formEntry = sSpellShapeshiftFormStore.LookupEntry(form);
|
||||
if (formEntry && formEntry->modelID_A)
|
||||
if (formEntry && formEntry->CreatureDisplayID[0])
|
||||
{
|
||||
// Take the alliance modelid as default
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
return formEntry->modelID_A;
|
||||
return formEntry->CreatureDisplayID[0];
|
||||
else
|
||||
{
|
||||
if (Player::TeamForRace(getRace()) == ALLIANCE)
|
||||
modelid = formEntry->modelID_A;
|
||||
modelid = formEntry->CreatureDisplayID[0];
|
||||
else
|
||||
modelid = formEntry->modelID_H;
|
||||
modelid = formEntry->CreatureDisplayID[1];
|
||||
|
||||
// If the player is horde but there are no values for the horde modelid - take the alliance modelid
|
||||
if (!modelid && Player::TeamForRace(getRace()) == HORDE)
|
||||
modelid = formEntry->modelID_A;
|
||||
modelid = formEntry->CreatureDisplayID[0];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13402,7 +13402,7 @@ void Unit::_EnterVehicle(Vehicle* vehicle, int8 seatId, AuraApplication const* a
|
||||
// If vehicle flag for fixed position set (cannons), or if the following hardcoded units, then set state rooted
|
||||
// 30236 | Argent Cannon
|
||||
// 39759 | Tankbuster Cannon
|
||||
if ((vehicle->GetVehicleInfo()->m_flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759)
|
||||
if ((vehicle->GetVehicleInfo()->Flags & VEHICLE_FLAG_FIXED_POSITION) || vehicle->GetBase()->GetEntry() == 30236 || vehicle->GetBase()->GetEntry() == 39759)
|
||||
SetControlled(true, UNIT_STATE_ROOT);
|
||||
|
||||
ASSERT(!m_vehicle);
|
||||
@@ -14008,7 +14008,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
{
|
||||
if (Unit* victim = GetVictim())
|
||||
{
|
||||
if (victim->GetFactionTemplateEntry()->faction == faction_id)
|
||||
if (victim->GetFactionTemplateEntry()->Faction == faction_id)
|
||||
{
|
||||
AttackStop();
|
||||
if (IsNonMeleeSpellCast(false))
|
||||
@@ -14023,7 +14023,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
AttackerSet const& attackers = getAttackers();
|
||||
for (AttackerSet::const_iterator itr = attackers.begin(); itr != attackers.end();)
|
||||
{
|
||||
if ((*itr)->GetFactionTemplateEntry()->faction == faction_id)
|
||||
if ((*itr)->GetFactionTemplateEntry()->Faction == faction_id)
|
||||
{
|
||||
(*itr)->AttackStop();
|
||||
itr = attackers.begin();
|
||||
@@ -14812,11 +14812,11 @@ float Unit::GetCollisionHeight() const
|
||||
{
|
||||
if (CreatureDisplayInfoEntry const* mountDisplayInfo = sCreatureDisplayInfoStore.LookupEntry(GetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID)))
|
||||
{
|
||||
if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelId))
|
||||
if (CreatureModelDataEntry const* mountModelData = sCreatureModelDataStore.LookupEntry(mountDisplayInfo->ModelID))
|
||||
{
|
||||
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId());
|
||||
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId);
|
||||
float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->Scale * displayInfo->scale * 0.5f);
|
||||
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID);
|
||||
float const collisionHeight = scaleMod * (mountModelData->MountHeight + modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale * 0.5f);
|
||||
return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight;
|
||||
}
|
||||
}
|
||||
@@ -14824,9 +14824,9 @@ float Unit::GetCollisionHeight() const
|
||||
|
||||
//! Dismounting case - use basic default model data
|
||||
CreatureDisplayInfoEntry const* displayInfo = sCreatureDisplayInfoStore.AssertEntry(GetNativeDisplayId());
|
||||
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelId);
|
||||
CreatureModelDataEntry const* modelData = sCreatureModelDataStore.AssertEntry(displayInfo->ModelID);
|
||||
|
||||
float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->Scale * displayInfo->scale;
|
||||
float const collisionHeight = scaleMod * modelData->CollisionHeight * modelData->ModelScale * displayInfo->CreatureModelScale;
|
||||
return collisionHeight == 0.0f ? DEFAULT_COLLISION_HEIGHT : collisionHeight;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user