diff options
author | Subv <s.v.h21@hotmail.com> | 2012-10-21 15:10:42 -0700 |
---|---|---|
committer | Subv <s.v.h21@hotmail.com> | 2012-10-21 15:10:42 -0700 |
commit | bc1714161a8cb1f2ebf801107f38eb25576227f1 (patch) | |
tree | 057242f396edd0cb7b38653e5f00ee492ca4d265 /src | |
parent | e475b50f587f5501a61eb9d39ba4f45dc2ff4b3e (diff) | |
parent | 2c8c7a195d79450bbfc9c2dd4c0dc90e79ac3986 (diff) |
Merge pull request #8146 from Gacko/usetraps
Core: Implement Gameobject::Use() for traps
Closes #8137
Closes #4811
Diffstat (limited to 'src')
-rwxr-xr-x | src/server/game/Entities/GameObject/GameObject.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp index 59f68a0494f..ee85cbbc301 100755 --- a/src/server/game/Entities/GameObject/GameObject.cpp +++ b/src/server/game/Entities/GameObject/GameObject.cpp @@ -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 { |