[Quest API] (Performance) Check event EVENT_AGGRO, EVENT_ATTACK, or EVENT_COMBAT exist before export and execute (#2901)

* [Quest API] Optionally parse EVENT_COMBAT

# Notes
- Optionally parse this event instead of always doing so.

* Optional EVENT_ATTACK

* Update attack.cpp
This commit is contained in:
Alex King
2023-02-12 23:30:24 -05:00
committed by GitHub
parent bad44f35e2
commit 93f19d3971
3 changed files with 32 additions and 11 deletions
+6 -3
View File
@@ -5340,9 +5340,12 @@ void Bot::Damage(Mob *from, int64 damage, uint16 spell_id, EQ::skills::SkillType
spell_id = SPELL_UNKNOWN;
//handle EVENT_ATTACK. Resets after we have not been attacked for 12 seconds
if(attacked_timer.Check()) {
LogCombat("Triggering EVENT_ATTACK due to attack by [{}]", from->GetName());
parse->EventBot(EVENT_ATTACK, this, from, "", 0);
if (attacked_timer.Check()) {
if (parse->BotHasQuestSub(EVENT_ATTACK)) {
LogCombat("Triggering EVENT_ATTACK due to attack by [{}]", from->GetName());
parse->EventBot(EVENT_ATTACK, this, from, "", 0);
}
}
attacked_timer.Start(CombatEventTimer_expire);