Core/GameObjects: add script hook when destructable building is damaged.

This commit is contained in:
Supabad
2011-04-09 19:28:36 +02:00
parent 9efac6fe9f
commit a5a545a403
4 changed files with 18 additions and 6 deletions
@@ -1710,7 +1710,7 @@ void GameObject::TakenDamage(uint32 damage, Unit *who)
if (Battleground* bg = pwho->GetBattleground())
bg->DestroyGate(pwho, this, m_goInfo->building.destroyedEvent);
hitType = BG_OBJECT_DMG_HIT_TYPE_JUST_DESTROYED;
sScriptMgr->OnGameObjectDestroyed(pwho, this, m_goInfo->building.destroyedEvent);
sScriptMgr->OnGameObjectDestroyed(this, pwho, m_goInfo->building.destroyedEvent);
}
if (pwho)
if (Battleground* bg = pwho->GetBattleground())
@@ -1732,6 +1732,7 @@ void GameObject::TakenDamage(uint32 damage, Unit *who)
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
SetUInt32Value(GAMEOBJECT_DISPLAYID, m_goInfo->building.damagedDisplayId);
EventInform(m_goInfo->building.damagedEvent);
sScriptMgr->OnGameObjectDamaged(this, pwho, m_goInfo->building.damagedEvent);
hitType = BG_OBJECT_DMG_HIT_TYPE_JUST_HIGH_DAMAGED;
}
if (pwho)