Core/GameObjects: sync gameobject data field names with master branch and added some missing entries for Cataclysm

This commit is contained in:
Ovahlord committed 2023-01-17 19:45:56 +01:00
1 parent e1f3a1a2ff
commit acaf42798a
17 files changed
+388 -359

No files matched your search

@@ -703,7 +703,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, P
{
case GAMEOBJECT_TYPE_FISHINGHOLE:
SetGoAnimProgress(animprogress);
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishinghole.minSuccessOpens, GetGOInfo()->fishinghole.maxSuccessOpens);
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishinghole.minRestock, GetGOInfo()->fishinghole.maxRestock);
break;
case GAMEOBJECT_TYPE_DESTRUCTIBLE_BUILDING:
m_goValue.Building.Health = goinfo->building.intactNumHits + goinfo->building.damagedNumHits;
@@ -733,7 +733,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, P
m_stealth.AddValue(STEALTH_TRAP, 70);
}
if (GetGOInfo()->trap.invisible)
if (GetGOInfo()->trap.stealthAffected)
{
m_invisibility.AddFlag(INVISIBILITY_TRAP);
m_invisibility.AddValue(INVISIBILITY_TRAP, 300);
@@ -823,7 +823,7 @@ void GameObject::Update(uint32 diff)
// Arming Time for GAMEOBJECT_TYPE_TRAP (6)
GameObjectTemplate const* goInfo = GetGOInfo();
// Bombs
if (goInfo->trap.type == 2)
if (goInfo->trap.charges == 2)
// Hardcoded tooltip value
m_cooldownTime = GameTime::GetGameTimeMS() + 10 * IN_MILLISECONDS;
else if (Unit* owner = GetOwner())
@@ -922,7 +922,7 @@ void GameObject::Update(uint32 diff)
break;
case GAMEOBJECT_TYPE_FISHINGHOLE:
// Initialize a new max fish count on respawn
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishinghole.minSuccessOpens, GetGOInfo()->fishinghole.maxSuccessOpens);
m_goValue.FishingHole.MaxOpens = urand(GetGOInfo()->fishinghole.minRestock, GetGOInfo()->fishinghole.maxRestock);
break;
default:
break;
@@ -963,7 +963,7 @@ void GameObject::Update(uint32 diff)
break;
// Type 2 (bomb) does not need to be triggered by a unit and despawns after casting its spell.
if (goInfo->trap.type == 2)
if (goInfo->trap.charges == 2)
{
SetLootState(GO_ACTIVATED);
break;
@@ -972,7 +972,7 @@ void GameObject::Update(uint32 diff)
// Type 0 despawns after being triggered, type 1 does not.
/// @todo This is activation radius. Casting radius must be selected from spell data.
float radius;
if (!goInfo->trap.diameter)
if (!goInfo->trap.radius)
{
// Battleground traps: data2 == 0 && data5 == 3
if (goInfo->trap.cooldown != 3)
@@ -981,7 +981,7 @@ void GameObject::Update(uint32 diff)
radius = 3.f;
}
else
radius = goInfo->trap.diameter / 2.f;
radius = goInfo->trap.radius / 2.f;
// Pointer to appropriate target if found any
Unit* target = nullptr;
@@ -1061,10 +1061,10 @@ void GameObject::Update(uint32 diff)
case GAMEOBJECT_TYPE_TRAP:
{
GameObjectTemplate const* goInfo = GetGOInfo();
if (goInfo->trap.type == 2 && goInfo->trap.spellId)
if (goInfo->trap.charges == 2 && goInfo->trap.spell)
{
/// @todo nullptr target won't work for target type 1
CastSpell(nullptr, goInfo->trap.spellId);
CastSpell(nullptr, goInfo->trap.spell);
SetLootState(GO_JUST_DEACTIVATED);
}
else if (Unit* target = ObjectAccessor::GetUnit(*this, m_lootStateUnitGUID))
@@ -1072,19 +1072,19 @@ void GameObject::Update(uint32 diff)
// Some traps do not have a spell but should be triggered
CastSpellExtraArgs args;
args.SetOriginalCaster(GetOwnerGUID());
if (goInfo->trap.spellId)
CastSpell(target, goInfo->trap.spellId, args);
if (goInfo->trap.spell)
CastSpell(target, goInfo->trap.spell, args);
// Template value or 4 seconds
m_cooldownTime = GameTime::GetGameTimeMS() + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)) * IN_MILLISECONDS;
if (goInfo->trap.type == 1)
if (goInfo->trap.charges == 1)
SetLootState(GO_JUST_DEACTIVATED);
else if (!goInfo->trap.type)
else if (!goInfo->trap.charges)
SetLootState(GO_READY);
// Battleground gameobjects have data2 == 0 && data5 == 3
if (!goInfo->trap.diameter && goInfo->trap.cooldown == 3)
if (!goInfo->trap.radius && goInfo->trap.cooldown == 3)
if (Player* player = target->ToPlayer())
if (Battleground* bg = player->GetBattleground())
bg->HandleTriggerBuff(GetGUID());
@@ -1105,7 +1105,7 @@ void GameObject::Update(uint32 diff)
//if Gameobject should cast spell, then this, but some GOs (type = 10) should be destroyed
if (GetGoType() == GAMEOBJECT_TYPE_GOOBER)
{
uint32 spellId = GetGOInfo()->goober.spellId;
uint32 spellId = GetGOInfo()->goober.spell;
if (spellId)
{
@@ -1597,8 +1597,8 @@ uint8 GameObject::getLevelForTarget(WorldObject const* target) const
if (GetGoType() == GAMEOBJECT_TYPE_TRAP)
{
if (GetGOInfo()->trap.level != 0)
return GetGOInfo()->trap.level;
if (GetGOInfo()->trap.Unused != 0)
return GetGOInfo()->trap.Unused;
if (const Unit* targetUnit = target->ToUnit())
return targetUnit->getLevel();
}
@@ -1676,7 +1676,7 @@ bool GameObject::ActivateToQuest(Player* target) const
}
case GAMEOBJECT_TYPE_GOOBER:
{
if (GetGOInfo()->goober.questId == -1 || target->GetQuestStatus(GetGOInfo()->goober.questId) == QUEST_STATUS_INCOMPLETE)
if (GetGOInfo()->goober.questID == -1 || target->GetQuestStatus(GetGOInfo()->goober.questID) == QUEST_STATUS_INCOMPLETE)
return true;
break;
}
@@ -1693,7 +1693,7 @@ void GameObject::TriggeringLinkedGameObject(uint32 trapEntry, Unit* target)
if (!trapInfo || trapInfo->type != GAMEOBJECT_TYPE_TRAP)
return;
SpellInfo const* trapSpell = sSpellMgr->GetSpellInfo(trapInfo->trap.spellId);
SpellInfo const* trapSpell = sSpellMgr->GetSpellInfo(trapInfo->trap.spell);
if (!trapSpell) // checked at load already
return;
@@ -1848,12 +1848,12 @@ void GameObject::Use(Unit* user)
case GAMEOBJECT_TYPE_TRAP: //6
{
GameObjectTemplate const* goInfo = GetGOInfo();
if (goInfo->trap.spellId)
CastSpell(user, goInfo->trap.spellId);
if (goInfo->trap.spell)
CastSpell(user, goInfo->trap.spell);
m_cooldownTime = GameTime::GetGameTimeMS() + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)) * IN_MILLISECONDS; // template or 4 seconds
if (goInfo->trap.type == 1) // Deactivate after trigger
if (goInfo->trap.charges == 1) // Deactivate after trigger
SetLootState(GO_JUST_DEACTIVATED);
return;
@@ -1870,8 +1870,8 @@ void GameObject::Use(Unit* user)
if (ChairListSlots.empty()) // this is called once at first chair use to make list of available slots
{
if (info->chair.slots > 0) // sometimes chairs in DB have error in fields and we dont know number of slots
for (uint32 i = 0; i < info->chair.slots; ++i)
if (info->chair.chairslots > 0) // sometimes chairs in DB have error in fields and we dont know number of slots
for (uint32 i = 0; i < info->chair.chairslots; ++i)
ChairListSlots[i].Clear(); // Last user of current slot set to 0 (none sit here yet)
else
ChairListSlots[0].Clear(); // error in DB, make one default slot
@@ -1895,7 +1895,7 @@ void GameObject::Use(Unit* user)
for (ChairSlotAndUser::iterator itr = ChairListSlots.begin(); itr != ChairListSlots.end(); ++itr)
{
// the distance between this slot and the center of the go - imagine a 1D space
float relativeDistance = (info->size*itr->first)-(info->size*(info->chair.slots-1)/2.0f);
float relativeDistance = (info->size*itr->first)-(info->size*(info->chair.chairslots -1)/2.0f);
float x_i = GetPositionX() + relativeDistance * std::cos(orthogonalOrientation);
float y_i = GetPositionY() + relativeDistance * std::sin(orthogonalOrientation);
@@ -1934,7 +1934,7 @@ void GameObject::Use(Unit* user)
{
itr->second = player->GetGUID(); //this slot in now used by player
player->TeleportTo(GetMapId(), x_lowest, y_lowest, GetPositionZ(), GetOrientation(), TELE_TO_NOT_LEAVE_TRANSPORT | TELE_TO_NOT_LEAVE_COMBAT | TELE_TO_NOT_UNSUMMON_PET);
player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR+info->chair.height);
player->SetStandState(UNIT_STAND_STATE_SIT_LOW_CHAIR + info->chair.chairheight);
if (info->chair.triggeredEvent)
GameEvents::Trigger(info->chair.triggeredEvent, player, this);
return;
@@ -1950,7 +1950,7 @@ void GameObject::Use(Unit* user)
if (Player* player = user->ToPlayer())
{
if (info->goober.pageId) // show page...
if (info->goober.pageID) // show page...
{
WorldPacket data(SMSG_GAMEOBJECT_PAGETEXT, 8);
data << GetGUID();
@@ -1962,17 +1962,17 @@ void GameObject::Use(Unit* user)
player->SendPreparedGossip(this);
}
if (info->goober.eventId)
if (info->goober.eventID)
{
TC_LOG_DEBUG("maps.script", "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetSpawnId());
GameEvents::Trigger(info->goober.eventId, player, this);
TC_LOG_DEBUG("maps.script", "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventID, GetEntry(), GetSpawnId());
GameEvents::Trigger(info->goober.eventID, player, this);
}
// possible quest objective for active quests
if (info->goober.questId && sObjectMgr->GetQuestTemplate(info->goober.questId))
if (info->goober.questID && sObjectMgr->GetQuestTemplate(info->goober.questID))
{
//Quest require to be active for GO using
if (player->GetQuestStatus(info->goober.questId) != QUEST_STATUS_INCOMPLETE)
if (player->GetQuestStatus(info->goober.questID) != QUEST_STATUS_INCOMPLETE)
break;
}
@@ -1987,7 +1987,7 @@ void GameObject::Use(Unit* user)
player->KillCreditGO(info->entry, GetGUID());
}
if (uint32 trapEntry = info->goober.linkedTrapId)
if (uint32 trapEntry = info->goober.linkedTrap)
TriggeringLinkedGameObject(trapEntry, user);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_IN_USE);
@@ -2002,7 +2002,7 @@ void GameObject::Use(Unit* user)
m_cooldownTime = GameTime::GetGameTimeMS() + info->GetAutoCloseTime();
// cast this spell later if provided
spellId = info->goober.spellId;
spellId = info->goober.spell;
if (!info->goober.playerCast)
spellCaster = nullptr;
@@ -2019,8 +2019,8 @@ void GameObject::Use(Unit* user)
Player* player = user->ToPlayer();
if (info->camera.cinematicId)
player->SendCinematicStart(info->camera.cinematicId);
if (info->camera.camera)
player->SendCinematicStart(info->camera.camera);
if (info->camera.eventID)
GameEvents::Trigger(info->camera.eventID, player, this);
@@ -2168,12 +2168,12 @@ void GameObject::Use(Unit* user)
}
// full amount unique participants including original summoner
if (GetUniqueUseCount() == info->summoningRitual.reqParticipants)
if (GetUniqueUseCount() == info->summoningRitual.casters)
{
if (m_ritualOwner)
spellCaster = m_ritualOwner;
spellId = info->summoningRitual.spellId;
spellId = info->summoningRitual.spell;
if (spellId == 62330) // GO store nonexistent spell, replace by expected
{
@@ -2225,7 +2225,7 @@ void GameObject::Use(Unit* user)
if (!m_goInfo->spellcaster.allowMounted)
user->RemoveAurasByType(SPELL_AURA_MOUNTED);
spellId = m_goInfo->spellcaster.spellId;
spellId = m_goInfo->spellcaster.spell;
if (!sSpellMgr->GetSpellInfo(spellId))
{
TC_LOG_ERROR("misc", "SpellCaster gameobject (Entry: %u) attempted to cast a non-existant spell (ID: %u).", GetEntry(), spellId);
@@ -2831,7 +2831,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
if (!target)
return;
bool forcedFlags = GetGoType() == GAMEOBJECT_TYPE_CHEST && GetGOInfo()->chest.groupLootRules && HasLootRecipient();
bool forcedFlags = GetGoType() == GAMEOBJECT_TYPE_CHEST && GetGOInfo()->chest.usegrouplootrules && HasLootRecipient();
bool targetIsGM = target->IsGameMaster();
ByteBuffer fieldBuffer;
@@ -2891,7 +2891,7 @@ void GameObject::BuildValuesUpdate(uint8 updateType, ByteBuffer* data, Player* t
{
uint32 goFlags = m_uint32Values[GAMEOBJECT_FLAGS];
if (GetGoType() == GAMEOBJECT_TYPE_CHEST)
if (GetGOInfo()->chest.groupLootRules && !IsLootAllowedFor(target))
if (GetGOInfo()->chest.usegrouplootrules && !IsLootAllowedFor(target))
goFlags |= GO_FLAG_LOCKED | GO_FLAG_NOT_SELECTABLE;
fieldBuffer << goFlags;