Core/Creature: implement initial SummonInfo API for handling summons in the future

This commit is contained in:
Ovahlord committed 2025-08-09 15:01:55 +02:00
1 parent 0f41e34aa1
commit 5848eedb24
10 files changed
+427 -1

No files matched your search

@@ -46,6 +46,7 @@
#include "SpellDefines.h"
#include "SpellMgr.h"
#include "StringConvert.h"
#include "SummonInfoArgs.h"
#include "TemporarySummon.h"
#include "Totem.h"
#include "Transport.h"
@@ -2086,6 +2087,22 @@ TempSummon* Map::SummonCreature(uint32 entry, Position const& pos, SummonCreatur
if (summonArgs.Summoner)
PhasingHandler::InheritPhaseShift(summon, summonArgs.Summoner);
// Store special settings which have been extracted from spell effects/scripts
SummonInfoArgs args;
if (summonArgs.Summoner)
args.SummonerGUID = summonArgs.Summoner->GetGUID();
if (summonArgs.SummonProperties)
args.SummonPropertiesId = summonArgs.SummonProperties->ID;
if (summonArgs.SummonDuration)
args.Duration = Milliseconds(summonArgs.SummonDuration);
if (summonArgs.SummonSpellId)
args.SummonSpellId = summonArgs.SummonSpellId;
if (summonArgs.SummonHealth)
args.MaxHealth = summonArgs.SummonHealth;
// Initialize the SummonInfo API which marks the creature as Summon
summon->InitializeSummonInfo(args);
TransportBase* transport = summonArgs.Summoner ? summonArgs.Summoner->GetTransport() : nullptr;
if (transport)
{