[Quest API] (Performance) Check event EVENT_LANGUAGE_SKILL_UP, EVENT_SKILL_UP, or EVENT_USE_SKILL exist before export and execute (#2894)

* [Quest API] Optionally parse EVENT_LANGUAGE_SKILL_UP, EVENT_SKILL_UP, and EVENT_USE_SKILL

- Optionally parse these events instead of always doing so.

* Cleanup
This commit is contained in:
Alex King
2023-02-13 00:30:48 -05:00
committed by GitHub
parent 3d6b0e5f74
commit 3474c00e7a
2 changed files with 59 additions and 34 deletions
+9 -6
View File
@@ -1451,12 +1451,15 @@ void Mob::DoAttack(Mob *other, DamageHitInfo &hit, ExtraAttackOptions *opts, boo
}
if (IsBot()) {
const auto export_string = fmt::format(
"{} {}",
hit.skill,
GetSkill(hit.skill)
);
parse->EventBot(EVENT_USE_SKILL, CastToBot(), nullptr, export_string, 0);
if (parse->BotHasQuestSub(EVENT_USE_SKILL)) {
const auto& export_string = fmt::format(
"{} {}",
hit.skill,
GetSkill(hit.skill)
);
parse->EventBot(EVENT_USE_SKILL, CastToBot(), nullptr, export_string, 0);
}
}
}
}