Core/Spells: implement summon properties parameter types based on the leaked enumerated strings values

Summon spells can now be commanded to interpret their basepoints depending on the parameter type that has been assigned to the summon properties dbc record Id

* implemented SummonCreatureExtraArgs to reduce the amount of arguments in Map::SummonCreature
This commit is contained in:
Ovahlord committed 2021-08-15 10:35:02 +02:00
1 parent c927ca98ba
commit 8ac7e71690
14 files changed
+305 -100

No files matched your search

@@ -488,7 +488,12 @@ struct boss_ascendant_council_controller final : public BossAI
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, terrastra);
if (SummonPropertiesEntry const* entry = sSummonPropertiesStore.LookupEntry(PROPERTY_DEFAULT))
me->GetMap()->SummonCreature(BOSS_ELEMENTIUM_MONSTROSITY, me->GetPosition(), entry, 0, me);
{
SummonCreatureExtraArgs extraArgs;
extraArgs.Summoner = me;
extraArgs.SummonProperties = entry;
me->GetMap()->SummonCreature(BOSS_ELEMENTIUM_MONSTROSITY, me->GetPosition(), extraArgs);
}
break;
case EVENT_PREPARE_ULTIMATE_ABILITY:
if (events.IsInPhase(PHASE_FELUDIUS_IGNACIOUS))
@@ -213,10 +213,10 @@ class instance_vortex_pinnacle : public InstanceMapScript
{
case EVENT_SUMMON_ZEPHYRS:
if (instance->IsGridLoaded(SouthZephyrSummonLocation))
if (TempSummon* zephyr = instance->SummonCreature(NPC_ZEPHYR, SouthZephyrSummonLocation, nullptr, 18 * IN_MILLISECONDS))
if (TempSummon* zephyr = instance->SummonCreature(NPC_ZEPHYR, SouthZephyrSummonLocation, SummonCreatureExtraArgs().SetSummonDuration(18 * IN_MILLISECONDS)))
zephyr->GetMotionMaster()->MovePath(PATH_ZEPHYR_SOUTH, false);
if (instance->IsGridLoaded(NorthZephyrSummonLocation))
if (TempSummon* zephyr = instance->SummonCreature(NPC_ZEPHYR, NorthZephyrSummonLocation, nullptr, 18 * IN_MILLISECONDS))
if (TempSummon* zephyr = instance->SummonCreature(NPC_ZEPHYR, NorthZephyrSummonLocation, SummonCreatureExtraArgs().SetSummonDuration(18 * IN_MILLISECONDS)))
zephyr->GetMotionMaster()->MovePath(PATH_ZEPHYR_NORTH, false);
_events.Repeat(10s);
break;
@@ -1590,7 +1590,14 @@ class spell_halion_damage_aoe_summon : public SpellScriptLoader
uint32 duration = uint32(GetSpellInfo()->GetDuration());
Position pos = caster->GetPosition();
if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id))
SummonCreatureExtraArgs extraArgs;
extraArgs.SummonProperties = properties;
extraArgs.SummonDuration = duration;
extraArgs.Summoner = caster;
extraArgs.SummonSpellId = GetSpellInfo()->Id;
if (Creature* summon = caster->GetMap()->SummonCreature(entry, pos, extraArgs))
if (summon->IsAIEnabled)
summon->AI()->SetData(DATA_STACKS_DISPELLED, GetSpellValue()->EffectBasePoints[EFFECT_1]);
}
@@ -1470,7 +1470,14 @@ class spell_putricide_mutated_transformation : public SpellScriptLoader
uint32 duration = uint32(GetSpellInfo()->GetDuration());
Position pos = caster->GetPosition();
TempSummon* summon = caster->GetMap()->SummonCreature(entry, pos, properties, duration, caster, GetSpellInfo()->Id);
SummonCreatureExtraArgs extraArgs;
extraArgs.SummonProperties = properties;
extraArgs.SummonDuration = duration;
extraArgs.Summoner = caster;
extraArgs.SummonSpellId = GetSpellInfo()->Id;
TempSummon* summon = caster->GetMap()->SummonCreature(entry, pos, extraArgs);
if (!summon || !summon->IsVehicle())
return;
@@ -1043,7 +1043,7 @@ class boss_the_lich_king : public CreatureScript
}
break;
case EVENT_FROSTMOURNE_HEROIC:
if (TempSummon* terenas = me->GetMap()->SummonCreature(NPC_TERENAS_MENETHIL_FROSTMOURNE_H, TerenasSpawnHeroic, nullptr, 50000))
if (TempSummon* terenas = me->GetMap()->SummonCreature(NPC_TERENAS_MENETHIL_FROSTMOURNE_H, TerenasSpawnHeroic, SummonCreatureExtraArgs().SetSummonDuration(50000)))
{
terenas->AI()->DoAction(ACTION_FROSTMOURNE_INTRO);
std::list<Creature*> triggers;
@@ -1269,7 +1269,7 @@ class instance_icecrown_citadel : public InstanceMapScript
}
break;
case EVENT_TELEPORT_TO_FROSTMOURNE: // Harvest Soul (normal mode)
if (Creature* terenas = instance->SummonCreature(NPC_TERENAS_MENETHIL_FROSTMOURNE, TerenasSpawn, nullptr, 63000))
if (Creature* terenas = instance->SummonCreature(NPC_TERENAS_MENETHIL_FROSTMOURNE, TerenasSpawn, SummonCreatureExtraArgs().SetSummonDuration(63000)))
{
terenas->AI()->DoAction(ACTION_FROSTMOURNE_INTRO);
std::list<Creature*> triggers;
@@ -1281,7 +1281,7 @@ class instance_icecrown_citadel : public InstanceMapScript
visual->CastSpell(visual, SPELL_FROSTMOURNE_TELEPORT_VISUAL, true);
}
if (Creature* warden = instance->SummonCreature(NPC_SPIRIT_WARDEN, SpiritWardenSpawn, nullptr, 63000))
if (Creature* warden = instance->SummonCreature(NPC_SPIRIT_WARDEN, SpiritWardenSpawn, SummonCreatureExtraArgs().SetSummonDuration(63000)))
{
terenas->AI()->AttackStart(warden);
warden->GetThreatManager().AddThreat(terenas, 300000.0f, nullptr, true, true);