Core/AI: implemented SmartScripts System (still beta) not 100% complete
WARNING: Use scripts at own risk. You were warned. NOTE0: creature, gameobject, areatrigger type scripts should be fully functional NOTE1: has no effect on any core related stuff if not using any SmartScript NOTE2: all event/action/etc descriptions can be found in SmartScriptMgr.h SmartScripts is a reloadable DB-Sript system, with full control for special scripting, like escorting, following, complex combat handling, pre-stored AI templates(caster, turret, etc) and much more with a total of 66 events, 78 actions, 22 target types, and can be easily extended --HG-- branch : trunk
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
#include "MapManager.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "LFGMgr.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
void WorldSession::HandleRepopRequestOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
@@ -144,7 +145,10 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
|
||||
unit->AI()->sGossipSelectCode(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
sScriptMgr.OnGossipSelectCode(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str());
|
||||
go->AI()->GossipSelectCode(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId), code.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -156,7 +160,10 @@ void WorldSession::HandleGossipSelectOptionOpcode(WorldPacket & recv_data)
|
||||
unit->AI()->sGossipSelect(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId));
|
||||
}
|
||||
else
|
||||
{
|
||||
sScriptMgr.OnGossipSelect(_player, go, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId));
|
||||
go->AI()->GossipSelect(_player, _player->PlayerTalkClass->GossipOptionSender(gossipListId), _player->PlayerTalkClass->GossipOptionAction(gossipListId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "ConditionMgr.h"
|
||||
#include "Creature.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
void WorldSession::HandleQuestgiverStatusQueryOpcode(WorldPacket & recv_data)
|
||||
{
|
||||
@@ -217,6 +218,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket & recv_data)
|
||||
}
|
||||
case TYPEID_GAMEOBJECT:
|
||||
sScriptMgr.OnQuestAccept(_player, ((GameObject*)pObject), qInfo);
|
||||
(pObject->ToGameObject())->AI()->QuestAccept(_player, qInfo);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -331,6 +333,7 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket & recv_data)
|
||||
// Send next quest
|
||||
if (Quest const* nextquest = _player->GetNextQuest(guid ,pQuest))
|
||||
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextquest,guid,true);
|
||||
pObject->ToGameObject()->AI()->QuestReward(_player, pQuest, reward);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
#include "SpellAuras.h"
|
||||
#include "CreatureAI.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
void WorldSession::HandleClientCastFlags(WorldPacket& recvPacket, uint8 castFlags, SpellCastTargets & targets)
|
||||
{
|
||||
@@ -287,6 +288,8 @@ void WorldSession::HandleGameObjectUseOpcode(WorldPacket & recv_data)
|
||||
if (sScriptMgr.OnGossipHello(_player, obj))
|
||||
return;
|
||||
|
||||
obj->AI()->GossipHello(_player);
|
||||
|
||||
obj->Use(_player);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user