Erik Strandberg authored and Aokromes committed 2017-12-10 00:37:21 +00:00
1 parent dcc4d29276
commit a3b16c040b
122 files changed
+6029 -5246

No files matched your search

@@ -33,6 +33,7 @@
#include "UpdateFieldFlags.h"
#include "World.h"
#include "Transport.h"
#include "GossipDef.h"
GameObject::GameObject() : WorldObject(false), MapObject(),
m_model(nullptr), m_goValue(), m_AI(nullptr)
@@ -721,7 +722,6 @@ void GameObject::Update(uint32 diff)
break;
}
}
sScriptMgr->OnGameObjectUpdate(this, diff);
}
void GameObject::Refresh()
@@ -1239,9 +1239,7 @@ void GameObject::Use(Unit* user)
if (Player* playerUser = user->ToPlayer())
{
if (sScriptMgr->OnGossipHello(playerUser, this))
return;
playerUser->PlayerTalkClass->ClearMenus();
if (AI()->GossipHello(playerUser, false))
return;
}
@@ -2068,7 +2066,7 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
case GO_DESTRUCTIBLE_DAMAGED:
{
EventInform(m_goInfo->building.damagedEvent, eventInvoker);
sScriptMgr->OnGameObjectDamaged(this, eventInvoker);
AI()->Damaged(eventInvoker, m_goInfo->building.damageEvent);
RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_DESTROYED);
SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_DAMAGED);
@@ -2092,8 +2090,9 @@ void GameObject::SetDestructibleState(GameObjectDestructibleState state, Player*
}
case GO_DESTRUCTIBLE_DESTROYED:
{
sScriptMgr->OnGameObjectDestroyed(this, eventInvoker);
EventInform(m_goInfo->building.destroyedEvent, eventInvoker);
AI()->Destroyed(eventInvoker, m_goInfo->building.destroyedEvent);
if (eventInvoker)
if (Battleground* bg = eventInvoker->GetBattleground())
bg->DestroyGate(eventInvoker, this);
@@ -2146,8 +2145,7 @@ void GameObject::SetLootState(LootState state, Unit* unit)
else
m_lootStateUnitGUID.Clear();
AI()->OnStateChanged(state, unit);
sScriptMgr->OnGameObjectLootStateChanged(this, state, unit);
AI()->OnLootStateChanged(state, unit);
if (GetGoType() == GAMEOBJECT_TYPE_DOOR) // only set collision for doors on SetGoState
return;
@@ -2166,7 +2164,8 @@ void GameObject::SetLootState(LootState state, Unit* unit)
void GameObject::SetGoState(GOState state)
{
SetByteValue(GAMEOBJECT_BYTES_1, 0, state);
sScriptMgr->OnGameObjectStateChanged(this, state);
if (AI())
AI()->OnStateChanged(state);
if (m_model && !IsTransport())
{
if (!IsInWorld())