mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 11:55:43 +00:00
fix(Core/SmartScripts): Added new parameter onlyInCombat to `SMART_… (#13947)
* fix(Core/SmartScripts): Added new parameter `onlyInCombat` to `SMART_EVENT_FRIENDLY_MISSING_BUFF` event. Coilfang Scale-Healer should cast Power Word: Shield only in combat. Fixes #13838 * missing sql.
This commit is contained in:
@@ -3511,16 +3511,21 @@ void SmartScript::ProcessEvent(SmartScriptHolder& e, Unit* unit, uint32 var0, ui
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_FRIENDLY_MISSING_BUFF:
|
||||
{
|
||||
if (e.event.missingBuff.onlyInCombat && !me->IsEngaged())
|
||||
{
|
||||
std::vector<Creature*> creatures;
|
||||
DoFindFriendlyMissingBuff(creatures, float(e.event.missingBuff.radius), e.event.missingBuff.spell);
|
||||
|
||||
if (creatures.empty())
|
||||
return;
|
||||
|
||||
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Acore::Containers::SelectRandomContainerElement(creatures));
|
||||
break;
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<Creature*> creatures;
|
||||
DoFindFriendlyMissingBuff(creatures, float(e.event.missingBuff.radius), e.event.missingBuff.spell);
|
||||
|
||||
if (creatures.empty())
|
||||
return;
|
||||
|
||||
ProcessTimedAction(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax, Acore::Containers::SelectRandomContainerElement(creatures));
|
||||
break;
|
||||
}
|
||||
case SMART_EVENT_HAS_AURA:
|
||||
{
|
||||
if (!me)
|
||||
|
||||
@@ -131,7 +131,7 @@ enum SMART_EVENT
|
||||
SMART_EVENT_VICTIM_CASTING = 13, // RepeatMin, RepeatMax, spellid
|
||||
SMART_EVENT_FRIENDLY_HEALTH = 14, // HPDeficit, Radius, RepeatMin, RepeatMax
|
||||
SMART_EVENT_FRIENDLY_IS_CC = 15, // Radius, RepeatMin, RepeatMax
|
||||
SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax
|
||||
SMART_EVENT_FRIENDLY_MISSING_BUFF = 16, // SpellId, Radius, RepeatMin, RepeatMax, onlyInCombat
|
||||
SMART_EVENT_SUMMONED_UNIT = 17, // CreatureId(0 all), CooldownMin, CooldownMax
|
||||
SMART_EVENT_TARGET_MANA_PCT = 18, // ManaMin%, ManaMax%, RepeatMin, RepeatMax
|
||||
SMART_EVENT_ACCEPTED_QUEST = 19, // QuestID (0 = any), CooldownMin, CooldownMax
|
||||
@@ -301,6 +301,7 @@ struct SmartEvent
|
||||
uint32 radius;
|
||||
uint32 repeatMin;
|
||||
uint32 repeatMax;
|
||||
uint32 onlyInCombat;
|
||||
} missingBuff;
|
||||
|
||||
struct
|
||||
|
||||
Reference in New Issue
Block a user