mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 19:37:02 +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
|
|
@ -27,7 +27,7 @@
|
|||
#include "GossipDef.h"
|
||||
#include "QuestDef.h"
|
||||
#include "ObjectAccessor.h"
|
||||
#include "ScriptCalls.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "Group.h"
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
||||
|
|
@ -54,7 +54,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
|||
|
||||
if (!cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies
|
||||
{
|
||||
dialogStatus = Script->NPCDialogStatus(_player, cr_questgiver);
|
||||
dialogStatus = sScriptMgr.OnDialogStatus(_player, cr_questgiver);
|
||||
|
||||
if (dialogStatus > DIALOG_STATUS_REWARD_REP)
|
||||
dialogStatus = getDialogStatus(_player, cr_questgiver, DIALOG_STATUS_NONE);
|
||||
|
|
@ -64,7 +64,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
|||
case TYPEID_GAMEOBJECT:
|
||||
{
|
||||
GameObject* go_questgiver = (GameObject*)questgiver;
|
||||
dialogStatus = Script->GODialogStatus(_player, go_questgiver);
|
||||
dialogStatus = sScriptMgr.OnDialogStatus(_player, go_questgiver);
|
||||
|
||||
if (dialogStatus > DIALOG_STATUS_REWARD_REP)
|
||||
dialogStatus = getDialogStatus(_player, go_questgiver, DIALOG_STATUS_NONE);
|
||||
|
|
@ -103,7 +103,7 @@ void WorldSession::HandleQuestgiverHelloOpcode(WorldPacket & recv_data)
|
|||
if (!pCreature->IsStopped())
|
||||
pCreature->StopMoving();
|
||||
|
||||
if (Script->GossipHello(_player, pCreature))
|
||||
if (sScriptMgr.OnGossipHello(_player, pCreature))
|
||||
return;
|
||||
|
||||
_player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->GossipMenuId);
|
||||
|
|
@ -192,12 +192,12 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
|||
switch(pObject->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
Script->QuestAccept(_player, ((Creature*)pObject), qInfo );
|
||||
sScriptMgr.OnQuestAccept(_player, (Creature*)pObject, qInfo);
|
||||
break;
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
{
|
||||
Script->ItemQuestAccept(_player, ((Item*)pObject), qInfo );
|
||||
sScriptMgr.OnQuestAccept(_player, (Item*)pObject, qInfo);
|
||||
|
||||
// destroy not required for quest finish quest starting item
|
||||
bool destroyItem = true;
|
||||
|
|
@ -216,7 +216,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
|||
break;
|
||||
}
|
||||
case TYPEID_GAMEOBJECT:
|
||||
Script->GOQuestAccept(_player, ((GameObject*)pObject), qInfo );
|
||||
sScriptMgr.OnQuestAccept(_player, (GameObject*)pObject, qInfo);
|
||||
break;
|
||||
}
|
||||
_player->PlayerTalkClass->CloseGossip();
|
||||
|
|
@ -299,7 +299,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
|
|||
switch(pObject->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
if (!(Script->ChooseReward(_player, ((Creature*)pObject), pQuest, reward)))
|
||||
if (!sScriptMgr.OnQuestChooseReward(_player, (Creature*)pObject, pQuest, reward))
|
||||
{
|
||||
// Send next quest
|
||||
if (Quest const* nextquest = _player->GetNextQuest(guid, pQuest))
|
||||
|
|
@ -307,10 +307,10 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
|
|||
}
|
||||
break;
|
||||
case TYPEID_GAMEOBJECT:
|
||||
if (!Script->GOChooseReward(_player, ((GameObject*)pObject), pQuest, reward))
|
||||
if (!sScriptMgr.OnQuestChooseReward(_player, (GameObject*)pObject, pQuest, reward))
|
||||
{
|
||||
// Send next quest
|
||||
if (Quest const* nextquest = _player->GetNextQuest(guid ,pQuest))
|
||||
if (Quest const* nextquest = _player->GetNextQuest(guid, pQuest))
|
||||
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextquest, guid, true);
|
||||
}
|
||||
break;
|
||||
|
|
@ -663,7 +663,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
|
|||
if (!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
|
||||
continue;
|
||||
|
||||
dialogStatus = Script->NPCDialogStatus(_player, questgiver);
|
||||
dialogStatus = sScriptMgr.OnDialogStatus(_player, questgiver);
|
||||
|
||||
if (dialogStatus > DIALOG_STATUS_REWARD_REP)
|
||||
dialogStatus = getDialogStatus(_player, questgiver, DIALOG_STATUS_NONE);
|
||||
|
|
@ -682,7 +682,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
|
|||
if (questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
|
||||
continue;
|
||||
|
||||
dialogStatus = Script->GODialogStatus(_player, questgiver);
|
||||
dialogStatus = sScriptMgr.OnDialogStatus(_player, questgiver);
|
||||
|
||||
if (dialogStatus > DIALOG_STATUS_REWARD_REP)
|
||||
dialogStatus = getDialogStatus(_player, questgiver, DIALOG_STATUS_NONE);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue