mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-15 20:52:22 -04:00
Core/SmartScripts: added SMART_ACTION_SET_COUNTER and SMART_EVENT_COUNTER_SET
as per request of DB developers
This commit is contained in:
@@ -61,6 +61,7 @@ SmartScript::~SmartScript()
|
||||
delete itr->second;
|
||||
|
||||
delete mTargetStorage;
|
||||
mCounterList.clear();
|
||||
}
|
||||
|
||||
void SmartScript::OnReset()
|
||||
@@ -77,6 +78,7 @@ void SmartScript::OnReset()
|
||||
}
|
||||
ProcessEventsFor(SMART_EVENT_RESET);
|
||||
mLastInvoker.Clear();
|
||||
mCounterList.clear();
|
||||
}
|
||||
|
||||
void SmartScript::ProcessEventsFor(SMART_EVENT e, Unit* unit, uint32 var0, uint32 var1, bool bvar, const SpellInfo* spell, GameObject* gob)
|
||||
@@ -1351,6 +1353,11 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
ENSURE_AI(SmartAI, me->AI())->SetSwim(e.action.setSwim.swim != 0);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_COUNTER:
|
||||
{
|
||||
StoreCounter(e.action.setCounter.counterId, e.action.setCounter.value, e.action.setCounter.reset);
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_WP_START:
|
||||
{
|
||||
if (!IsSmart())
|
||||
@@ -3239,6 +3246,10 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_COUNTER_SET:
|
||||
if (GetCounterId(e.event.counter.id) != 0 && GetCounterValue(e.event.counter.id) == e.event.counter.value)
|
||||
ProcessTimedAction(e, e.event.counter.cooldownMax, e.event.counter.cooldownMax);
|
||||
break;
|
||||
default:
|
||||
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessEvent: Unhandled Event type %u", e.GetEventType());
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user