feat(Core/SAI): Implement SMART_ACTION_DISABLE (#16254)

* init

* Create rev_1684036819129474700.sql

* Update rev_1684036819129474700.sql
This commit is contained in:
Gultask
2023-05-17 09:31:50 -03:00
committed by GitHub
parent 97dff23ba1
commit 69fab3df70
4 changed files with 80 additions and 1 deletions

View File

@@ -2797,6 +2797,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
break;
}
case SMART_ACTION_DISABLE:
{
for (WorldObject* target : targets)
{
if (IsUnit(target))
{
target->ToUnit()->SetImmuneToAll(!e.action.disable.state);
target->ToUnit()->SetVisible(e.action.disable.state);
}
}
break;
}
default:
LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry {} SourceType {}, Event {}, Unhandled Action type {}", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;