mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-18 14:10:18 -04:00
Core/SAI: Split set/remove unit_flags actions (#26954)
(cherry picked from commit 0a2fca1aed)
This commit is contained in:
@@ -2505,6 +2505,48 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
targetUnit->SetHealth(targetUnit->CountPctFromMaxHealth(e.action.setHealthPct.percent));
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_IMMUNE_PC:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (IsUnit(target))
|
||||
{
|
||||
if (e.action.setImmunePC.immunePC)
|
||||
target->ToUnit()->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
else
|
||||
target->ToUnit()->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_IMMUNE_NPC:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (IsUnit(target))
|
||||
{
|
||||
if (e.action.setImmuneNPC.immuneNPC)
|
||||
target->ToUnit()->AddUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
else
|
||||
target->ToUnit()->RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_SET_UNINTERACTIBLE:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (IsUnit(target))
|
||||
{
|
||||
if (e.action.setUninteractible.uninteractible)
|
||||
target->ToUnit()->AddUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
|
||||
else
|
||||
target->ToUnit()->RemoveUnitFlag(UNIT_FLAG_UNINTERACTIBLE);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_CREATE_CONVERSATION:
|
||||
{
|
||||
WorldObject* baseObject = GetBaseObject();
|
||||
|
||||
Reference in New Issue
Block a user