1 parent
b48879ab79
commit
41d9364b16
2 files changed
+7
-6
No files matched your search
@@ -47,7 +47,7 @@ GameObject::GameObject() : WorldObject(false), MapObject(),
|
||||
m_respawnTime = 0;
|
||||
m_respawnDelayTime = 300;
|
||||
m_lootState = GO_NOT_READY;
|
||||
m_lootStateUnit = NULL;
|
||||
m_lootStateUnitGUID = 0;
|
||||
m_spawnedByDefault = true;
|
||||
m_usetimes = 0;
|
||||
m_spellId = 0;
|
||||
@@ -561,11 +561,12 @@ void GameObject::Update(uint32 diff)
|
||||
CastSpell(NULL, goInfo->trap.spellId);
|
||||
SetLootState(GO_JUST_DEACTIVATED);
|
||||
}
|
||||
else if (m_lootStateUnit)
|
||||
else if (m_lootStateUnitGUID)
|
||||
if (Unit* target = Unit::GetUnit(*this, m_lootStateUnitGUID))
|
||||
{
|
||||
// Some traps do not have a spell but should be triggered
|
||||
if (goInfo->trap.spellId)
|
||||
CastSpell(m_lootStateUnit, goInfo->trap.spellId);
|
||||
CastSpell(target, goInfo->trap.spellId);
|
||||
|
||||
// Template value or 4 seconds
|
||||
m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4));
|
||||
@@ -575,7 +576,7 @@ void GameObject::Update(uint32 diff)
|
||||
|
||||
// Battleground gameobjects have data2 == 0 && data5 == 3
|
||||
if (!goInfo->trap.diameter && goInfo->trap.cooldown == 3)
|
||||
if (Player* player = m_lootStateUnit->ToPlayer())
|
||||
if (Player* player = target->ToPlayer())
|
||||
if (Battleground* bg = player->GetBattleground())
|
||||
bg->HandleTriggerBuff(GetGUID());
|
||||
}
|
||||
@@ -2008,7 +2009,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
|
||||
void GameObject::SetLootState(LootState state, Unit* unit)
|
||||
{
|
||||
m_lootState = state;
|
||||
m_lootStateUnit = unit;
|
||||
m_lootStateUnitGUID = unit ? unit->GetGUID() : 0;
|
||||
AI()->OnStateChanged(state, unit);
|
||||
sScriptMgr->OnGameObjectLootStateChanged(this, state, unit);
|
||||
if (m_model)
|
||||
|
||||
Reference in new issue
Block a user