aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-08-20 12:26:29 +0200
committerShauren <shauren.trinity@gmail.com>2023-08-20 12:26:29 +0200
commitd01e7a0d2f9436aeeb7e6c195b6197998637be4c (patch)
tree32d006fd23acf42d4abec3e66e41b02694c89b01 /src
parentf1c51e2a8d3e1cfe7cb8ebf08260d2c74b8b56cb (diff)
Scripts/Spells: Moved creature script to spell script
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Spells/spell_druid.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/server/scripts/Spells/spell_druid.cpp b/src/server/scripts/Spells/spell_druid.cpp
index 19624b0b6e5..2c7a177105a 100644
--- a/src/server/scripts/Spells/spell_druid.cpp
+++ b/src/server/scripts/Spells/spell_druid.cpp
@@ -26,7 +26,6 @@
#include "Containers.h"
#include "DB2Stores.h"
#include "GridNotifiersImpl.h"
-#include "PassiveAI.h"
#include "Player.h"
#include "Spell.h"
#include "SpellAuraEffects.h"
@@ -514,21 +513,18 @@ class spell_dru_efflorescence : public SpellScript
GetCaster()->RemoveAreaTrigger(GetSpellInfo()->Id);
}
- void Register() override
+ void InitSummon()
{
- OnEffectLaunch += SpellEffectFn(spell_dru_efflorescence::RemoveOldAreaTrigger, EFFECT_2, SPELL_EFFECT_CREATE_AREATRIGGER);
+ for (SpellLogEffectGenericVictimParams const& summonedObject : GetSpell()->GetExecuteLogEffectTargets(SPELL_EFFECT_SUMMON, &SpellLogEffect::GenericVictimTargets))
+ if (Unit* summon = ObjectAccessor::GetCreature(*GetCaster(), summonedObject.Victim))
+ summon->CastSpell(summon, SPELL_DRUID_EFFLORESCENCE_AURA,
+ CastSpellExtraArgs().SetTriggeringSpell(GetSpell()));
}
-};
-struct npc_dru_efflorescence : public NullCreatureAI
-{
- explicit npc_dru_efflorescence(Creature* creature) : NullCreatureAI(creature)
- {
- }
-
- void InitializeAI() override
+ void Register() override
{
- me->CastSpell(me, SPELL_DRUID_EFFLORESCENCE_AURA);
+ OnEffectLaunch += SpellEffectFn(spell_dru_efflorescence::RemoveOldAreaTrigger, EFFECT_2, SPELL_EFFECT_CREATE_AREATRIGGER);
+ AfterCast += SpellCastFn(spell_dru_efflorescence::InitSummon);
}
};
@@ -1942,7 +1938,6 @@ void AddSC_druid_spell_scripts()
RegisterSpellScript(spell_dru_eclipse_aura);
RegisterSpellScript(spell_dru_eclipse_dummy);
RegisterSpellScript(spell_dru_eclipse_ooc);
- RegisterCreatureAI(npc_dru_efflorescence);
RegisterSpellScript(spell_dru_efflorescence);
RegisterSpellScript(spell_dru_efflorescence_dummy);
RegisterSpellScript(spell_dru_efflorescence_heal);