feat(Core/SmartScripts): SMART_ACTION_SET_CORPSE_DELAY

This commit is contained in:
IntelligentQuantum
2022-01-04 13:11:19 +03:30
committed by GitHub
parent 0d6b8dba18
commit 9faec8ef1b
3 changed files with 26 additions and 1 deletions

View File

@@ -3275,6 +3275,25 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
CAST_AI(SmartAI, me->AI())->SetEvadeDisabled(e.action.disableEvade.disable != 0);
break;
}
case SMART_ACTION_SET_CORPSE_DELAY:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
{
break;
}
for (auto const& target : *targets)
{
if (IsCreature(target))
{
target->ToCreature()->SetCorpseDelay(e.action.corpseDelay.timer);
}
}
delete targets;
break;
}
default:
LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry %d SourceType %u, Event %u, Unhandled Action type %u", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
break;