mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-02-05 08:28:57 +01:00
*Integrate Script system to Core
-added ScriptMgr for loading scripts -removed bindings -moved script system to src/game -moved scripts to src/scripts -VC project files updated -cmakes updated (not 100% done yet) NOTE to Devs: -file locations changed -precompiled renamed to ScriptedPch -ecsort_ai renamed to ScriptedEscortAI -follower_ai renamed to ScriptedFollowerAI -guard_ai renamed to ScriptedGuardAI -simple_ai renamed to ScriptedSimpleAI -sc_creature renamed to ScriptedCreature -sc_gossip renamed to ScriptedGossip -sc_instance renamed to ScriptedInstance *use the new headers in scripts, thank you NOTE to ALL: cmake not fully tested, please report any errors with it could make creashes, incompability USE AT YOUR OWN RISK before further tests!! --HG-- branch : trunk
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include "Group.h"
|
||||
#include "BattleGround.h"
|
||||
#include "BattleGroundAV.h"
|
||||
#include "ScriptMgr.h"
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
@@ -56,7 +57,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
||||
Creature* cr_questgiver=(Creature*)questgiver;
|
||||
if( !cr_questgiver->IsHostileTo(_player)) // not show quest status to enemies
|
||||
{
|
||||
questStatus = Script->NPCDialogStatus(_player, cr_questgiver);
|
||||
questStatus = sScriptMgr.NPCDialogStatus(_player, cr_questgiver);
|
||||
if( questStatus > 6 )
|
||||
questStatus = getDialogStatus(_player, cr_questgiver, defstatus);
|
||||
}
|
||||
@@ -66,7 +67,7 @@ void WorldSession::HandleQuestgiverStatusQueryOpcode( WorldPacket & recv_data )
|
||||
{
|
||||
sLog.outDebug( "WORLD: Received CMSG_QUESTGIVER_STATUS_QUERY for GameObject guid = %u",uint32(GUID_LOPART(guid)) );
|
||||
GameObject* go_questgiver=(GameObject*)questgiver;
|
||||
questStatus = Script->GODialogStatus(_player, go_questgiver);
|
||||
questStatus = sScriptMgr.GODialogStatus(_player, go_questgiver);
|
||||
if( questStatus > 6 )
|
||||
questStatus = getDialogStatus(_player, go_questgiver, defstatus);
|
||||
break;
|
||||
@@ -101,7 +102,7 @@ void WorldSession::HandleQuestgiverHelloOpcode( WorldPacket & recv_data )
|
||||
// Stop the npc if moving
|
||||
pCreature->StopMoving();
|
||||
|
||||
if(Script->GossipHello( _player, pCreature ) )
|
||||
if(sScriptMgr.GossipHello( _player, pCreature ) )
|
||||
return;
|
||||
|
||||
_player->PrepareGossipMenu(pCreature, pCreature->GetCreatureInfo()->GossipMenuId);
|
||||
@@ -188,12 +189,12 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
||||
switch(pObject->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
Script->QuestAccept(_player, ((Creature*)pObject), qInfo );
|
||||
sScriptMgr.QuestAccept(_player, ((Creature*)pObject), qInfo );
|
||||
break;
|
||||
case TYPEID_ITEM:
|
||||
case TYPEID_CONTAINER:
|
||||
{
|
||||
Script->ItemQuestAccept(_player, ((Item*)pObject), qInfo );
|
||||
sScriptMgr.ItemQuestAccept(_player, ((Item*)pObject), qInfo );
|
||||
|
||||
// destroy not required for quest finish quest starting item
|
||||
bool destroyItem = true;
|
||||
@@ -212,7 +213,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode( WorldPacket & recv_data )
|
||||
break;
|
||||
}
|
||||
case TYPEID_GAMEOBJECT:
|
||||
Script->GOQuestAccept(_player, ((GameObject*)pObject), qInfo );
|
||||
sScriptMgr.GOQuestAccept(_player, ((GameObject*)pObject), qInfo );
|
||||
break;
|
||||
}
|
||||
_player->PlayerTalkClass->CloseGossip();
|
||||
@@ -297,7 +298,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
|
||||
switch(pObject->GetTypeId())
|
||||
{
|
||||
case TYPEID_UNIT:
|
||||
if( !(Script->ChooseReward( _player, ((Creature*)pObject), pQuest, reward )) )
|
||||
if( !(sScriptMgr.ChooseReward( _player, ((Creature*)pObject), pQuest, reward )) )
|
||||
{
|
||||
// Send next quest
|
||||
if(Quest const* nextquest = _player->GetNextQuest( guid ,pQuest ) )
|
||||
@@ -305,7 +306,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode( WorldPacket & recv_data )
|
||||
}
|
||||
break;
|
||||
case TYPEID_GAMEOBJECT:
|
||||
if( !Script->GOChooseReward( _player, ((GameObject*)pObject), pQuest, reward ) )
|
||||
if( !sScriptMgr.GOChooseReward( _player, ((GameObject*)pObject), pQuest, reward ) )
|
||||
{
|
||||
// Send next quest
|
||||
if(Quest const* nextquest = _player->GetNextQuest( guid ,pQuest ) )
|
||||
@@ -661,7 +662,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
|
||||
continue;
|
||||
if(!questgiver->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER))
|
||||
continue;
|
||||
questStatus = Script->NPCDialogStatus(_player, questgiver);
|
||||
questStatus = sScriptMgr.NPCDialogStatus(_player, questgiver);
|
||||
if( questStatus > 6 )
|
||||
questStatus = getDialogStatus(_player, questgiver, defstatus);
|
||||
|
||||
@@ -676,7 +677,7 @@ void WorldSession::HandleQuestgiverStatusMultipleQuery(WorldPacket& /*recvPacket
|
||||
continue;
|
||||
if(questgiver->GetGoType() != GAMEOBJECT_TYPE_QUESTGIVER)
|
||||
continue;
|
||||
questStatus = Script->GODialogStatus(_player, questgiver);
|
||||
questStatus = sScriptMgr.GODialogStatus(_player, questgiver);
|
||||
if( questStatus > 6 )
|
||||
questStatus = getDialogStatus(_player, questgiver, defstatus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user