mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 16:38:42 +01:00
Core/GameObject: spawn linked traps at gameobject creation instead of…
… using DB spawns.
This commit is contained in:
4
sql/updates/world/3.3.5/2016_11_01_03_world.sql
Normal file
4
sql/updates/world/3.3.5/2016_11_01_03_world.sql
Normal file
@@ -0,0 +1,4 @@
|
||||
--
|
||||
DELETE FROM `gameobject` WHERE `id` IN (2061,2066,19535,31442,31510,94039,123334,123355,124072,128196,130126,142172,142176,148976,153204,176117,176152,176214,176591,176865,177045,177606,177793,178187,178188,178189,178190,178191,178192,178193,178324,178984,179900,180100,180217,180244,180247,180583,181029,181272,181282,181284,181376,181583,181584,181913,182051,182582,182585,183386,183768,183997,184078,184124,184265,184578,184718,184736,184737,184747,184794,184797,184801,184835,184843,184868,184871,184872,185018,185212,185499,185502,185563,185600,185878,186330,186334,186431,186470,186617,186620,188479,188500,190195,190196,190661,190857,191304,191370,191485,191555,194010,194013,194955,195346,201368,201593);
|
||||
DELETE FROM `gameobject_addon` WHERE `guid` NOT IN (SELECT `guid` FROM `gameobject`);
|
||||
DELETE FROM `game_event_gameobject` WHERE `guid` NOT IN (SELECT `guid` FROM `gameobject`);
|
||||
@@ -324,6 +324,18 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
||||
if (map->Is25ManRaid())
|
||||
loot.maxDuplicates = 3;
|
||||
|
||||
if (uint32 linkedEntry = GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject();
|
||||
if (linkedGO->Create(map->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, map, phaseMask, pos, rotation, 255, GO_STATE_READY))
|
||||
{
|
||||
SetLinkedTrap(linkedGO);
|
||||
map->AddToMap(linkedGO);
|
||||
}
|
||||
else
|
||||
delete linkedGO;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -3229,28 +3229,12 @@ void Spell::EffectSummonObjectWild(SpellEffIndex effIndex)
|
||||
if (Battleground* bg = player->GetBattleground())
|
||||
bg->SetDroppedFlagGUID(pGameObj->GetGUID(), player->GetTeam() == ALLIANCE ? TEAM_HORDE: TEAM_ALLIANCE);
|
||||
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
if (GameObject* linkedTrap = pGameObj->GetLinkedTrap())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(map->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, map,
|
||||
m_caster->GetPhaseMask(), Position(x, y, z, target->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->CopyPhaseFrom(m_caster);
|
||||
pGameObj->SetLinkedTrap(linkedGO);
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
linkedTrap->SetRespawnTime(duration > 0 ? duration / IN_MILLISECONDS : 0);
|
||||
linkedTrap->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
ExecuteLogEffectSummonObject(effIndex, linkedGO);
|
||||
|
||||
// Wild object not have owner and check clickable by players
|
||||
map->AddToMap(linkedGO);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete linkedGO;
|
||||
linkedGO = NULL;
|
||||
return;
|
||||
}
|
||||
ExecuteLogEffectSummonObject(effIndex, linkedTrap);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4872,29 +4856,14 @@ void Spell::EffectTransmitted(SpellEffIndex effIndex)
|
||||
|
||||
cMap->AddToMap(pGameObj);
|
||||
|
||||
if (uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
if (GameObject* linkedTrap = pGameObj->GetLinkedTrap())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if (linkedGO->Create(cMap->GenerateLowGuid<HighGuid::GameObject>(), linkedEntry, cMap, 0, Position(fx, fy, fz, m_caster->GetOrientation()), G3D::Quat(), 255, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->CopyPhaseFrom(m_caster);
|
||||
linkedTrap->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
//linkedTrap->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
|
||||
linkedTrap->SetSpellId(m_spellInfo->Id);
|
||||
linkedTrap->SetOwnerGUID(m_caster->GetGUID());
|
||||
|
||||
pGameObj->SetLinkedTrap(linkedGO);
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILLISECONDS : 0);
|
||||
//linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
linkedGO->SetOwnerGUID(m_caster->GetGUID());
|
||||
|
||||
ExecuteLogEffectSummonObject(effIndex, linkedGO);
|
||||
|
||||
linkedGO->GetMap()->AddToMap(linkedGO);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete linkedGO;
|
||||
linkedGO = NULL;
|
||||
return;
|
||||
}
|
||||
ExecuteLogEffectSummonObject(effIndex, linkedTrap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user