Core/GameObjects: traps that dont have a owner should despawn after spell cast.
This commit is contained in:
@@ -278,7 +278,7 @@ void GameObject::Update(uint32 diff)
|
|||||||
// Arming Time for GAMEOBJECT_TYPE_TRAP (6)
|
// Arming Time for GAMEOBJECT_TYPE_TRAP (6)
|
||||||
GameObjectInfo const* goInfo = GetGOInfo();
|
GameObjectInfo const* goInfo = GetGOInfo();
|
||||||
// Bombs
|
// Bombs
|
||||||
if (goInfo->trap.charges == 2)
|
if (goInfo->trap.type == 2)
|
||||||
m_cooldownTime = time(NULL) + 10; // Hardcoded tooltip value
|
m_cooldownTime = time(NULL) + 10; // Hardcoded tooltip value
|
||||||
else if (Unit* owner = GetOwner())
|
else if (Unit* owner = GetOwner())
|
||||||
{
|
{
|
||||||
@@ -393,7 +393,7 @@ void GameObject::Update(uint32 diff)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Type 2 - Bomb (will go away after casting it's spell)
|
// Type 2 - Bomb (will go away after casting it's spell)
|
||||||
if (goInfo->trap.charges == 2)
|
if (goInfo->trap.type == 2)
|
||||||
{
|
{
|
||||||
if (goInfo->trap.spellId)
|
if (goInfo->trap.spellId)
|
||||||
CastSpell(NULL, goInfo->trap.spellId); // FIXME: null target won't work for target type 1
|
CastSpell(NULL, goInfo->trap.spellId); // FIXME: null target won't work for target type 1
|
||||||
@@ -453,7 +453,7 @@ void GameObject::Update(uint32 diff)
|
|||||||
|
|
||||||
m_cooldownTime = time(NULL) + goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4); // template or 4 seconds
|
m_cooldownTime = time(NULL) + goInfo->trap.cooldown ? goInfo->trap.cooldown : uint32(4); // template or 4 seconds
|
||||||
|
|
||||||
if (owner) // || goInfo->trap.charges == 1)
|
if (goInfo->trap.type == 1)
|
||||||
SetLootState(GO_JUST_DEACTIVATED);
|
SetLootState(GO_JUST_DEACTIVATED);
|
||||||
|
|
||||||
if (IsBattlegroundTrap && ok->GetTypeId() == TYPEID_PLAYER)
|
if (IsBattlegroundTrap && ok->GetTypeId() == TYPEID_PLAYER)
|
||||||
|
|||||||
@@ -130,7 +130,7 @@ struct GameObjectInfo
|
|||||||
uint32 level; //1
|
uint32 level; //1
|
||||||
uint32 radius; //2 radius for trap activation
|
uint32 radius; //2 radius for trap activation
|
||||||
uint32 spellId; //3
|
uint32 spellId; //3
|
||||||
uint32 charges; //4 need respawn (if > 0)
|
uint32 type; //4 0 trap with no despawn after cast. 1 trap despawns after cast. 2 bomb casts on spawn.
|
||||||
uint32 cooldown; //5 time in secs
|
uint32 cooldown; //5 time in secs
|
||||||
int32 autoCloseTime; //6
|
int32 autoCloseTime; //6
|
||||||
uint32 startDelay; //7
|
uint32 startDelay; //7
|
||||||
|
|||||||
Reference in New Issue
Block a user