mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 04:59:41 -04:00
Implement SMART_ACTION_GAME_EVENT_STOP (111) and SMART_ACTION_GAME_EVENT_START (112).
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
#include "SmartScript.h"
|
||||
#include "SpellMgr.h"
|
||||
#include "Vehicle.h"
|
||||
#include "GameEventMgr.h"
|
||||
|
||||
class TrinityStringTextBuilder
|
||||
{
|
||||
@@ -2116,6 +2117,28 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
delete targets;
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_GAME_EVENT_STOP:
|
||||
{
|
||||
uint32 eventId = e.action.gameEventStop.id;
|
||||
if (!sGameEventMgr->IsActiveEvent(eventId))
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_STOP, inactive event (id: %u)", eventId);
|
||||
return;
|
||||
}
|
||||
sGameEventMgr->StopEvent(eventId, true);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_GAME_EVENT_START:
|
||||
{
|
||||
uint32 eventId = e.action.gameEventStart.id;
|
||||
if (sGameEventMgr->IsActiveEvent(eventId))
|
||||
{
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: At case SMART_ACTION_GAME_EVENT_START, already activated event (id: %u)", eventId);
|
||||
return;
|
||||
}
|
||||
sGameEventMgr->StartEvent(eventId, true);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
TC_LOG_ERROR(LOG_FILTER_SQL, "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user