Core: Implement Gameobject::Use() for traps

This commit is contained in:
Gacko committed 2012-10-21 14:38:46 +02:00
1 parent 5548e89191
commit 2c8c7a195d
1 file changed
+13
@@ -1115,6 +1115,19 @@ void GameObject::Use(Unit* user)
player->SendPreparedGossip(this);
return;
}
case GAMEOBJECT_TYPE_TRAP: //6
{
GameObjectTemplate const* goInfo = GetGOInfo();
if (goInfo->trap.spellId)
CastSpell(user, goInfo->trap.spellId);
m_cooldownTime = time(NULL) + (goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4)); // template or 4 seconds
if (goInfo->trap.type == 1) // Deactivate after trigger
SetLootState(GO_JUST_DEACTIVATED);
return;
}
//Sitting: Wooden bench, chairs enzz
case GAMEOBJECT_TYPE_CHAIR: //7
{