diff options
| author | Rat <none@none> | 2010-10-27 21:01:47 +0200 |
|---|---|---|
| committer | Rat <none@none> | 2010-10-27 21:01:47 +0200 |
| commit | 5cb119e617195bfe4ddb35ce377201e0d01807fb (patch) | |
| tree | aa8a528ec76b9b28081714dbdb769ccbdfa22556 /src/server/game/Server | |
| parent | c9fba03da9b095ee1b76329af4db90ce18b31598 (diff) | |
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
Diffstat (limited to 'src/server/game/Server')
3 files changed, 13 insertions, 0 deletions
diff --git a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp index fcebf186f94..41cfdb2317f 100755 --- a/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/MiscHandler.cpp @@ -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)); + } } } diff --git a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp index 81b5b91ef94..98ecd8ad526 100755 --- a/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/QuestHandler.cpp @@ -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: diff --git a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp index 4f0c6a9ed44..23f4ac97968 100755 --- a/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp +++ b/src/server/game/Server/Protocol/Handlers/SpellHandler.cpp @@ -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); } |
