[Quest API] Add EVENT_DAMAGE_GIVEN and EVENT_DAMAGE_TAKEN to Perl/Lua. (#2804)

* [Quest API] Add EVENT_DAMAGE_GIVEN and EVENT_DAMAGE_TAKEN to Perl/Lua.

# Perl
- Add `EVENT_DAMAGE_GIVEN`.
- Add `EVENT_DAMAGE_TAKEN`.
- Both events export `$entity_id`, `$damage`, `$spell_id`, `$skill_id`, `$is_damage_shield`, `$is_avoidable`, `$buff_slot`, `$is_buff_tic`, `$special_attack`.

# Lua
- Add `event_damage_given`.
- Add `event_damage_taken`.
- Both events export `e.entity_id`, `e.damage`, `e.spell_id`, `e.skill_id`, `e.is_damage_shield`, `e.is_avoidable`, `e.buff_slot`, `e.is_buff_tic`, `e.special_attack`, and `e.other`.

# Notes
- These events allow operators to have events fire based on damage given or taken, as well as keep better track of a Bot, Client, or NPC's damage per second or otherwise.
- Special Attack is only useful for NPCs, but allows you to see if the attack is Rampage, AERampage, or Chaotic Stab.

* Cleanup.
This commit is contained in:
Alex King
2023-01-29 14:35:17 -05:00
committed by GitHub
parent a489290eba
commit b867d40774
6 changed files with 257 additions and 14 deletions
+19 -1
View File
@@ -210,6 +210,16 @@ void handle_npc_despawn_zone(
std::vector<std::any> *extra_pointers
);
void handle_npc_damage(
QuestInterface *parse,
lua_State* L,
NPC* npc,
Mob *init,
std::string data,
uint32 extra_data,
std::vector<std::any> *extra_pointers
);
// Player
void handle_player_say(
QuestInterface *parse,
@@ -652,6 +662,14 @@ void handle_player_augment_remove(
std::vector<std::any> *extra_pointers
);
void handle_player_damage(
QuestInterface *parse,
lua_State* L,
Client* client,
std::string data,
uint32 extra_data,
std::vector<std::any> *extra_pointers
);
// Item
void handle_item_click(
@@ -965,7 +983,7 @@ void handle_bot_equip_item(
std::vector<std::any> *extra_pointers
);
void handle_bot_unequip_item(
void handle_bot_damage(
QuestInterface *parse,
lua_State* L,
Bot* bot,