mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
[svn] Modify SummonGameObject function to set owner GUID.
Implement spell 23019. Patch provided by Edder. --HG-- branch : trunk
This commit is contained in:
@@ -1453,6 +1453,7 @@ GameObject* WorldObject::SummonGameObject(uint32 entry, float x, float y, float
|
||||
return NULL;
|
||||
go->SetRespawnTime(respawnTime);
|
||||
go->SetSpawnedByDefault(false); // do not save respawn time
|
||||
go->SetOwnerGUID(GetGUID());
|
||||
map->Add(go);
|
||||
|
||||
return go;
|
||||
|
||||
@@ -819,28 +819,10 @@ void Spell::EffectDummy(uint32 i)
|
||||
creatureTarget->RemoveCorpse();
|
||||
creatureTarget->SetHealth(0); // just for nice GM-mode view
|
||||
|
||||
GameObject* pGameObj = new GameObject;
|
||||
|
||||
Map *map = creatureTarget->GetMap();
|
||||
|
||||
if(!pGameObj->Create(objmgr.GenerateLowGuid(HIGHGUID_GAMEOBJECT), 179644, map,
|
||||
creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(),
|
||||
creatureTarget->GetOrientation(), 0, 0, 0, 0, 100, 1) )
|
||||
{
|
||||
delete pGameObj;
|
||||
return;
|
||||
}
|
||||
|
||||
pGameObj->SetRespawnTime(creatureTarget->GetRespawnTime()-time(NULL));
|
||||
pGameObj->SetOwnerGUID(m_caster->GetGUID() );
|
||||
pGameObj->SetUInt32Value(GAMEOBJECT_LEVEL, m_caster->getLevel() );
|
||||
pGameObj->SetSpellId(m_spellInfo->Id);
|
||||
|
||||
DEBUG_LOG("AddObject at SpellEfects.cpp EffectDummy\n");
|
||||
map->Add(pGameObj);
|
||||
|
||||
GameObject* Crystal_Prison = m_caster->SummonGameObject(179644, creatureTarget->GetPositionX(), creatureTarget->GetPositionY(), creatureTarget->GetPositionZ(), creatureTarget->GetOrientation(), 0, 0, 0, 0, creatureTarget->GetRespawnTime()-time(NULL));
|
||||
sLog.outDebug("SummonGameObject at SpellEfects.cpp EffectDummy for Spell 23019\n");
|
||||
WorldPacket data(SMSG_GAMEOBJECT_SPAWN_ANIM_OBSOLETE, 8);
|
||||
data << uint64(pGameObj->GetGUID());
|
||||
data << uint64(Crystal_Prison->GetGUID());
|
||||
m_caster->SendMessageToSet(&data,true);
|
||||
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user