aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/World
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2017-12-30 20:28:41 +0100
committerShauren <shauren.trinity@gmail.com>2021-04-16 15:22:42 +0200
commit9b141207d170e4b2b4e6d9290d5f921f76cbcea0 (patch)
tree47d65d966a66699f6de7e308047e408bdb255bff /src/server/scripts/World
parent2ea8f5e6fced094f28c45ac84123c85477122567 (diff)
[3.3.5] CastSpell unclusterfucking (that's a word now) (#21123)
Core/Spell: The giant CastSpell unclusterfucking (that's a word now) of this generation. - CastSpell now always takes three arguments - target, spellId, and a struct containing extra arguments - This struct (CastSpellExtraArgs, see SpellDefines.h) serves as a conglomerate of every previous combination of the 20 billion different CastSpell overloads, all merged into one - It has some great utility constructors - check them out! All of these can be used to implicitly construct the ExtraArgs object. - A gajillion refactors to make everything behave the way it always has (cherry picked from commit d507a7e3388382960108b24143da48e5f912b4a7)
Diffstat (limited to 'src/server/scripts/World')
-rw-r--r--src/server/scripts/World/mob_generic_creature.cpp3
-rw-r--r--src/server/scripts/World/npcs_special.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/server/scripts/World/mob_generic_creature.cpp b/src/server/scripts/World/mob_generic_creature.cpp
index ca3b27140e4..e7a0aeb1770 100644
--- a/src/server/scripts/World/mob_generic_creature.cpp
+++ b/src/server/scripts/World/mob_generic_creature.cpp
@@ -19,6 +19,7 @@
#include "Map.h"
#include "PassiveAI.h"
#include "ScriptedCreature.h"
+#include "SpellInfo.h"
#include "SpellMgr.h"
class trigger_periodic : public CreatureScript
@@ -43,7 +44,7 @@ public:
if (timer <= diff)
{
if (spell)
- me->CastSpell(me, spell, true);
+ me->CastSpell(me, spell->Id, CastSpellExtraArgs(TRIGGERED_FULL_MASK).SetCastDifficulty(spell->Difficulty));
timer = interval;
}
else
diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp
index cf4be0e3e3e..601f0d23421 100644
--- a/src/server/scripts/World/npcs_special.cpp
+++ b/src/server/scripts/World/npcs_special.cpp
@@ -468,10 +468,10 @@ public:
{
_scheduler.Schedule(Seconds(2), [this](TaskContext context)
{
- me->CastCustomSpell(SPELL_TORCH_TARGET_PICKER, SPELLVALUE_MAX_TARGETS, 1);
+ me->CastSpell(nullptr, SPELL_TORCH_TARGET_PICKER);
_scheduler.Schedule(Seconds(3), [this](TaskContext /*context*/)
{
- me->CastCustomSpell(SPELL_TORCH_TARGET_PICKER, SPELLVALUE_MAX_TARGETS, 1);
+ me->CastSpell(nullptr, SPELL_TORCH_TARGET_PICKER);
});
context.Repeat(Seconds(5));
});
@@ -2284,7 +2284,7 @@ public:
}
else
//me->CastSpell(me, GetFireworkSpell(me->GetEntry()), true);
- me->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), GetFireworkSpell(me->GetEntry()), true);
+ me->CastSpell(me->GetPosition(), GetFireworkSpell(me->GetEntry()), true);
}
};