mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
Core/SmartScripts: Rename SMART_ACTION_RESPAWN_TARGET -> SMART_ACTION_ENABLE_TEMP_GOBJ, since that's the only thing it still does in the dynspawn model. Adjust body accordingly to warn on misuse.
This commit is contained in:
@@ -1454,19 +1454,18 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SMART_ACTION_RESPAWN_TARGET:
|
||||
case SMART_ACTION_ENABLE_TEMP_GOBJ:
|
||||
{
|
||||
for (WorldObject* target : targets)
|
||||
{
|
||||
if (IsCreature(target))
|
||||
target->ToCreature()->Respawn();
|
||||
TC_LOG_WARN("sql.sql", "Invalid creature target '%s' (entry %u, spawnId %u) specified for SMART_ACTION_ENABLE_TEMP_GOBJ", target->GetName().c_str(), target->GetEntry(), target->ToCreature()->GetSpawnId());
|
||||
else if (IsGameObject(target))
|
||||
{
|
||||
// do not modify respawndelay of already spawned gameobjects
|
||||
if (target->ToGameObject()->isSpawnedByDefault())
|
||||
target->ToGameObject()->Respawn();
|
||||
TC_LOG_WARN("sql.sql", "Invalid gameobject target '%s' (entry %u, spawnId %u) for SMART_ACTION_ENABLE_TEMP_GOBJ - the object is spawned by default", target->GetName().c_str(), target->GetEntry(), target->ToGameObject()->GetSpawnId());
|
||||
else
|
||||
target->ToGameObject()->SetRespawnTime(e.action.RespawnTarget.goRespawnTime);
|
||||
target->ToGameObject()->SetRespawnTime(e.action.enableTempGO.duration);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -1487,6 +1487,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case SMART_ACTION_ENABLE_TEMP_GOBJ:
|
||||
if (!e.action.enableTempGO.duration)
|
||||
{
|
||||
TC_LOG_ERROR("sql.sql", "Entry %u SourceType %u Event %u Action %u does not specify duration", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
|
||||
return false;
|
||||
}
|
||||
case SMART_ACTION_FOLLOW:
|
||||
case SMART_ACTION_SET_ORIENTATION:
|
||||
case SMART_ACTION_STORE_TARGET_LIST:
|
||||
@@ -1520,7 +1526,6 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
|
||||
case SMART_ACTION_REMOVE_UNIT_FLAG:
|
||||
case SMART_ACTION_PLAYMOVIE:
|
||||
case SMART_ACTION_MOVE_TO_POS:
|
||||
case SMART_ACTION_RESPAWN_TARGET:
|
||||
case SMART_ACTION_CLOSE_GOSSIP:
|
||||
case SMART_ACTION_TRIGGER_TIMED_EVENT:
|
||||
case SMART_ACTION_REMOVE_TIMED_EVENT:
|
||||
|
||||
@@ -516,7 +516,7 @@ enum SMART_ACTION
|
||||
SMART_ACTION_CREATE_TIMED_EVENT = 67, // id, InitialMin, InitialMax, RepeatMin(only if it repeats), RepeatMax(only if it repeats), chance
|
||||
SMART_ACTION_PLAYMOVIE = 68, // entry
|
||||
SMART_ACTION_MOVE_TO_POS = 69, // PointId, transport, disablePathfinding, ContactDistance
|
||||
SMART_ACTION_RESPAWN_TARGET = 70, //
|
||||
SMART_ACTION_ENABLE_TEMP_GOBJ = 70, // despawnTimer (sec)
|
||||
SMART_ACTION_EQUIP = 71, // entry, slotmask slot1, slot2, slot3 , only slots with mask set will be sent to client, bits are 1, 2, 4, leaving mask 0 is defaulted to mask 7 (send all), slots1-3 are only used if no entry is set
|
||||
SMART_ACTION_CLOSE_GOSSIP = 72, // none
|
||||
SMART_ACTION_TRIGGER_TIMED_EVENT = 73, // id(>1)
|
||||
@@ -993,8 +993,8 @@ struct SmartAction
|
||||
|
||||
struct
|
||||
{
|
||||
uint32 goRespawnTime;
|
||||
} RespawnTarget;
|
||||
uint32 duration;
|
||||
} enableTempGO;
|
||||
|
||||
struct
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user