mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[9317] Call linkedtrap summon in more cases.
* GAMEOBJECT_TYPE_BUTTON can have linked traps * Spell::EffectSummonObject also can summon objects with linked traps Thanks to patman128 for research second case. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
02c23b247e
commit
87a35b0489
5 changed files with 52 additions and 43 deletions
|
|
@ -4922,25 +4922,7 @@ void Spell::EffectSummonObjectWild(uint32 i)
|
|||
}
|
||||
}
|
||||
|
||||
if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if(linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, map,
|
||||
m_caster->GetPhaseMask(), x, y, z, target->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
// Wild object not have owner and check clickable by players
|
||||
map->Add(linkedGO);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete linkedGO;
|
||||
linkedGO = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
pGameObj->SummonLinkedTrapIfAny();
|
||||
}
|
||||
|
||||
void Spell::EffectScriptEffect(uint32 effIndex)
|
||||
|
|
@ -6141,6 +6123,8 @@ void Spell::EffectSummonObject(uint32 i)
|
|||
map->Add(pGameObj);
|
||||
|
||||
m_caster->m_ObjectSlot[slot] = pGameObj->GetGUID();
|
||||
|
||||
pGameObj->SummonLinkedTrapIfAny();
|
||||
}
|
||||
|
||||
void Spell::EffectResurrect(uint32 /*effIndex*/)
|
||||
|
|
@ -6763,26 +6747,7 @@ void Spell::EffectTransmitted(uint32 effIndex)
|
|||
|
||||
cMap->Add(pGameObj);
|
||||
|
||||
if(uint32 linkedEntry = pGameObj->GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
{
|
||||
GameObject* linkedGO = new GameObject;
|
||||
if(linkedGO->Create(sObjectMgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), linkedEntry, cMap,
|
||||
m_caster->GetPhaseMask(), fx, fy, fz, m_caster->GetOrientation(), 0.0f, 0.0f, 0.0f, 0.0f, 100, GO_STATE_READY))
|
||||
{
|
||||
linkedGO->SetRespawnTime(duration > 0 ? duration/IN_MILISECONDS : 0);
|
||||
linkedGO->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel());
|
||||
linkedGO->SetSpellId(m_spellInfo->Id);
|
||||
linkedGO->SetOwnerGUID(m_caster->GetGUID());
|
||||
|
||||
linkedGO->GetMap()->Add(linkedGO);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete linkedGO;
|
||||
linkedGO = NULL;
|
||||
return;
|
||||
}
|
||||
}
|
||||
pGameObj->SummonLinkedTrapIfAny();
|
||||
}
|
||||
|
||||
void Spell::EffectProspecting(uint32 /*i*/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue