[Cleanup] Convert Event Parses to Single Line (#4569)

* [Cleanup] Convert Event Parses to Single Line

* Push

* Update spells.cpp

* Update spells.cpp

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Alex King
2024-12-12 01:43:22 -05:00
committed by GitHub
parent bd85fc96a0
commit 5c6e7a8b09
7 changed files with 56 additions and 253 deletions
+20 -38
View File
@@ -256,22 +256,15 @@ bool Mob::CastSpell(uint16 spell_id, uint16 target_id, CastingSlot slot,
Mob* spell_target = entity_list.GetMobID(target_id);
std::vector<std::any> args = { spell_target };
int return_value = parse->EventMob(
EVENT_CAST_BEGIN,
this,
nullptr,
[&]() {
return fmt::format(
"{} {} {} {}",
spell_id,
GetID(),
GetCasterLevel(spell_id),
target_id
);
},
0,
&args
);
int return_value = parse->EventMob(EVENT_CAST_BEGIN, this, nullptr, [&]() {
return fmt::format(
"{} {} {} {}",
spell_id,
GetID(),
GetCasterLevel(spell_id),
target_id
);
}, 0, &args);
if (IsClient() && return_value != 0) {
if (IsDiscipline(spell_id)) {
@@ -1804,22 +1797,15 @@ void Mob::CastedSpellFinished(uint16 spell_id, uint32 target_id, CastingSlot slo
std::vector<std::any> args = { spell_target };
parse->EventMob(
EVENT_CAST,
this,
nullptr,
[&]() {
return fmt::format(
"{} {} {} {}",
spell_id,
GetID(),
GetCasterLevel(spell_id),
target_id
);
},
0,
&args
);
parse->EventMob(EVENT_CAST, this, nullptr, [&]() {
return fmt::format(
"{} {} {} {}",
spell_id,
GetID(),
GetCasterLevel(spell_id),
target_id
);
}, 0, &args);
if(bard_song_mode)
{
@@ -3965,10 +3951,7 @@ bool Mob::SpellOnTarget(
std::vector<std::any> args = { spelltar };
parse->EventMob(
EVENT_CAST_ON,
spelltar,
this,
parse->EventMob(EVENT_CAST_ON, spelltar, this,
[&]() {
return fmt::format(
"{} {} {} {}",
@@ -3978,8 +3961,7 @@ bool Mob::SpellOnTarget(
target_id
);
},
0,
&args
0, &args
);
if (!DoCastingChecksOnTarget(false, spell_id, spelltar)) {