Core/AreaTriggers: Added helper static function AreaTrigger::CreateNewMovementForceId for use in scripts with movement forces

This commit is contained in:
Shauren
2021-12-08 19:02:33 +01:00
parent e2de5000ac
commit df2d0f3670
2 changed files with 6 additions and 0 deletions

View File

@@ -225,6 +225,11 @@ AreaTrigger* AreaTrigger::CreateAreaTrigger(uint32 areaTriggerCreatePropertiesId
return at;
}
ObjectGuid AreaTrigger::CreateNewMovementForceId(Map* map, uint32 areaTriggerId)
{
return ObjectGuid::Create<HighGuid::AreaTrigger>(map->GetId(), areaTriggerId, map->GenerateLowGuid<HighGuid::AreaTrigger>());
}
bool AreaTrigger::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool /*addToMap*/, bool /*allowDuplicate*/)
{
_spawnId = spawnId;

View File

@@ -71,6 +71,7 @@ class TC_GAME_API AreaTrigger : public WorldObject, public GridObject<AreaTrigge
public:
static AreaTrigger* CreateAreaTrigger(uint32 areaTriggerCreatePropertiesId, Unit* caster, Unit* target, SpellInfo const* spell, Position const& pos, int32 duration, SpellCastVisual spellVisual, ObjectGuid const& castId = ObjectGuid::Empty, AuraEffect const* aurEff = nullptr);
static ObjectGuid CreateNewMovementForceId(Map* map, uint32 areaTriggerId);
bool LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap, bool allowDuplicate);
void Update(uint32 diff) override;