[Quest API] (Performance) Check spell or cast events exist before export and execute (#2897)

* [Quest API] Optionally parse spell/cast events

# Notes
- Optionally parses `EVENT_CAST`, `EVENT_CAST_BEGIN`, `EVENT_CAST_ON`, `EVENT_SPELL_EFFECT_NPC`, `EVENT_SPELL_EFFECT_CLIENT`, `EVENT_SPELL_EFFECT_BOT`, `EVENT_SPELL_EFFECT_BUFF_TIC_CLIENT`, `EVENT_SPELL_EFFECT_BUFF_TIC_NPC`, `EVENT_SPELL_EFFECT_BUFF_TIC_BOT`, `EVENT_SPELL_FADE`, and `EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE`.

* Cleanup

* PR comment fixes

---------

Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
Alex King
2023-02-13 00:26:17 -05:00
committed by GitHub
parent 805a9c5f59
commit 9f619859d1
3 changed files with 170 additions and 91 deletions
+27 -25
View File
@@ -15228,32 +15228,34 @@ void Client::Handle_OP_Translocate(const EQApplicationPacket *app)
zone->GetInstanceID() == PendingTranslocateData.instance_id
);
if (parse->EventSpell(EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE, nullptr, this, spell_id, "", 0) == 0) {
// If the spell has a translocate to bind effect, AND we are already in the zone the client
// is bound in, use the GoToBind method. If we send OP_Translocate in this case, the client moves itself
// to the bind coords it has from the PlayerProfile, but with the X and Y reversed. I suspect they are
// reversed in the pp, and since spells like Gate are handled serverside, this has not mattered before.
if (
IsTranslocateSpell(spell_id) &&
in_translocate_zone
) {
PendingTranslocate = false;
GoToBind();
return;
}
if (parse->SpellHasQuestSub(spell_id, EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE)) {
if (parse->EventSpell(EVENT_SPELL_EFFECT_TRANSLOCATE_COMPLETE, nullptr, this, spell_id, "", 0) == 0) {
// If the spell has a translocate to bind effect, AND we are already in the zone the client
// is bound in, use the GoToBind method. If we send OP_Translocate in this case, the client moves itself
// to the bind coords it has from the PlayerProfile, but with the X and Y reversed. I suspect they are
// reversed in the pp, and since spells like Gate are handled serverside, this has not mattered before.
if (
IsTranslocateSpell(spell_id) &&
in_translocate_zone
) {
PendingTranslocate = false;
GoToBind();
return;
}
////Was sending the packet back to initiate client zone...
////but that could be abusable, so lets go through proper channels
MovePC(
PendingTranslocateData.zone_id,
PendingTranslocateData.instance_id,
PendingTranslocateData.x,
PendingTranslocateData.y,
PendingTranslocateData.z,
PendingTranslocateData.heading,
0,
ZoneSolicited
);
////Was sending the packet back to initiate client zone...
////but that could be abusable, so lets go through proper channels
MovePC(
PendingTranslocateData.zone_id,
PendingTranslocateData.instance_id,
PendingTranslocateData.x,
PendingTranslocateData.y,
PendingTranslocateData.z,
PendingTranslocateData.heading,
0,
ZoneSolicited
);
}
}
}