fix(Core/Smart Scripts): Add param5 flag for range event (#13049)

* fix(Core/Smart Scripts): Add param5 flag for range event to prevent cast on entering combat.
This commit is contained in:
Malcrom
2022-09-18 10:36:15 -03:00
committed by GitHub
parent 3dde9d904c
commit f06f5a1334
2 changed files with 8 additions and 2 deletions

View File

@@ -3430,8 +3430,13 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
if (me->IsInRange(me->GetVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max)) if (me->IsInRange(me->GetVictim(), (float)e.event.minMaxRepeat.min, (float)e.event.minMaxRepeat.max))
ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim()); ProcessTimedAction(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax, me->GetVictim());
else // xinef: make it predictable else
RecalcTimer(e, 500, 500); {
if (!e.event.minMaxRepeat.controller)
RecalcTimer(e, 500, 500); // xinef: make it predictable "Malcrom: This seems to be done to standardize min, max start rather than using the range values for the timer."
else
RecalcTimer(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax); // Malcrom: if param5 value is greater than 0 first action will not happen until after repeat timer fires.
}
break; break;
} }
case SMART_EVENT_VICTIM_CASTING: case SMART_EVENT_VICTIM_CASTING:

View File

@@ -221,6 +221,7 @@ struct SmartEvent
uint32 max; uint32 max;
uint32 repeatMin; uint32 repeatMin;
uint32 repeatMax; uint32 repeatMax;
uint32 controller;
} minMaxRepeat; } minMaxRepeat;
struct struct