mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[10935] Move script calls to ScriptMgr
- Script library presence is now optional. - Some script hooks have new names. Scripting libraries need to be adjusted accordingly. Signed-off-by: zergtmn <zerg@myisp.com>
This commit is contained in:
parent
918e646ca2
commit
ec6089bbd8
32 changed files with 454 additions and 435 deletions
|
|
@ -35,7 +35,6 @@
|
|||
#include "BattleGround.h"
|
||||
#include "BattleGroundAV.h"
|
||||
#include "Util.h"
|
||||
#include "ScriptCalls.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
GameObject::GameObject() : WorldObject()
|
||||
|
|
@ -920,7 +919,7 @@ void GameObject::Use(Unit* user)
|
|||
uint32 spellId = 0;
|
||||
bool triggered = false;
|
||||
|
||||
if (user->GetTypeId() == TYPEID_PLAYER && Script->GOHello((Player*)user, this))
|
||||
if (user->GetTypeId() == TYPEID_PLAYER && sScriptMgr.OnGameObjectUse((Player*)user, this))
|
||||
return;
|
||||
|
||||
switch(GetGoType())
|
||||
|
|
@ -952,7 +951,7 @@ void GameObject::Use(Unit* user)
|
|||
|
||||
Player* player = (Player*)user;
|
||||
|
||||
if (!Script->GOGossipHello(player, this))
|
||||
if (!sScriptMgr.OnGossipHello(player, this))
|
||||
{
|
||||
player->PrepareGossipMenu(this, GetGOInfo()->questgiver.gossipID);
|
||||
player->SendPreparedGossip(this);
|
||||
|
|
@ -970,7 +969,7 @@ void GameObject::Use(Unit* user)
|
|||
{
|
||||
DEBUG_LOG("Chest ScriptStart id %u for GO %u", GetGOInfo()->chest.eventId, GetDBTableGUIDLow());
|
||||
|
||||
if (!Script->ProcessEventId(GetGOInfo()->chest.eventId, user, this, true))
|
||||
if (!sScriptMgr.OnProcessEvent(GetGOInfo()->chest.eventId, user, this, true))
|
||||
GetMap()->ScriptsStart(sEventScripts, GetGOInfo()->chest.eventId, user, this);
|
||||
}
|
||||
|
||||
|
|
@ -1080,7 +1079,7 @@ void GameObject::Use(Unit* user)
|
|||
}
|
||||
else if (info->goober.gossipID) // ...or gossip, if page does not exist
|
||||
{
|
||||
if (!Script->GOGossipHello(player, this))
|
||||
if (!sScriptMgr.OnGossipHello(player, this))
|
||||
{
|
||||
player->PrepareGossipMenu(this, info->goober.gossipID);
|
||||
player->SendPreparedGossip(this);
|
||||
|
|
@ -1091,7 +1090,7 @@ void GameObject::Use(Unit* user)
|
|||
{
|
||||
DEBUG_FILTER_LOG(LOG_FILTER_AI_AND_MOVEGENSS, "Goober ScriptStart id %u for GO entry %u (GUID %u).", info->goober.eventId, GetEntry(), GetDBTableGUIDLow());
|
||||
|
||||
if (!Script->ProcessEventId(info->goober.eventId, player, this, true))
|
||||
if (!sScriptMgr.OnProcessEvent(info->goober.eventId, player, this, true))
|
||||
GetMap()->ScriptsStart(sEventScripts, info->goober.eventId, player, this);
|
||||
}
|
||||
|
||||
|
|
@ -1153,7 +1152,7 @@ void GameObject::Use(Unit* user)
|
|||
|
||||
if (info->camera.eventID)
|
||||
{
|
||||
if (!Script->ProcessEventId(info->camera.eventID, player, this, true))
|
||||
if (!sScriptMgr.OnProcessEvent(info->camera.eventID, player, this, true))
|
||||
GetMap()->ScriptsStart(sEventScripts, info->camera.eventID, player, this);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue