mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
Core/GameObject: spawn linked traps at gameobject creation instead of…
… using DB spawns.
This commit is contained in:
@@ -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