Merge pull request #16523 from tkrokli/smart_action_set_corpse_delay

[3.3.5][6.x]Core/SmartScript: create SMART_ACTION_SET_CORPSE_DELAY
This commit is contained in:
MitchesD
2016-03-03 23:16:59 +01:00
3 changed files with 23 additions and 1 deletions
@@ -2330,6 +2330,21 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
}
}
case SMART_ACTION_SET_CORPSE_DELAY:
{
ObjectList* targets = GetTargets(e, unit);
if (!targets)
break;
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
if (IsCreature(*itr))
(*itr)->ToCreature()->SetCorpseDelay(e.action.corpseDelay.timer);
}
delete targets;
break;
}
default:
TC_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;