AI/SmartAI: New SMART_ACTION_RESPAWN_BY_SPAWNID (hi kilyana)

(cherry picked from commit 691c67f0be)
This commit is contained in:
Treeston
2018-02-23 03:20:03 +01:00
committed by funjoker
parent 5c80f50734
commit 61baf6704c
3 changed files with 31 additions and 0 deletions
@@ -2336,6 +2336,20 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
break;
}
case SMART_ACTION_RESPAWN_BY_SPAWNID:
{
Map* map = nullptr;
if (WorldObject* obj = GetBaseObject())
map = obj->GetMap();
else if (!targets.empty())
map = targets.front()->GetMap();
if (map)
map->RemoveRespawnTime(SpawnObjectType(e.action.respawnData.spawnType), e.action.respawnData.spawnId, true);
else
TC_LOG_ERROR("sql.sql", "SmartScript::ProcessAction: Entry " SI64FMTD " SourceType %u, Event %u - tries to respawn by spawnId but does not provide a map", e.entryOrGuid, e.GetScriptType(), e.event_id);
break;
}
case SMART_ACTION_PLAY_ANIMKIT:
{
for (WorldObject* const target : targets)