[Quest API] Add EVENT_ITEM_CLICK_CLIENT and EVENT_ITEM_CLICK_CAST_CLIENT to Perl/Lua. (#2810)

* [Quest API] Add EVENT_ITEM_CLICK_CLIENT and EVENT_ITEM_CLICK_CAST_CLIENT to Perl/Lua.

# Perl
- Add `EVENT_ITEM_CLICK_CLIENT`.
- Add `EVENT_ITEM_CLICK_CAST_CLIENT`.
- Both events export `$item_id`, `$item_name`, `$slot_id`, and `$spell_id`.

# Lua
- Add `event_item_click_client`.
- Add `event_item_click_cast_client`.
- Both events export `e.item_id`, `e.item_name`, `e.slot_id`, `e.spell_id`, and `e.item`.

# Notes
- Allows operators to handle item clicks in player scripts instead of item-specific scripts.

* Update lua_parser_events.cpp

* Remove optional bool.
This commit is contained in:
Alex King
2023-01-30 06:01:12 -05:00
committed by GitHub
parent 66896a3121
commit a25952910a
10 changed files with 298 additions and 154 deletions
+8 -8
View File
@@ -103,8 +103,8 @@ void QuestParserCollection::RemoveEncounter(const std::string name) {
}
}
bool QuestParserCollection::HasQuestSub(uint32 npcid, QuestEventID evt, bool check_encounters) {
return HasQuestSubLocal(npcid, evt) || HasQuestSubGlobal(evt) || (check_encounters && NPCHasEncounterSub(npcid, evt));
bool QuestParserCollection::HasQuestSub(uint32 npcid, QuestEventID evt) {
return HasQuestSubLocal(npcid, evt) || HasQuestSubGlobal(evt) || NPCHasEncounterSub(npcid, evt);
}
bool QuestParserCollection::NPCHasEncounterSub(uint32 npc_id, QuestEventID evt) {
@@ -162,8 +162,8 @@ bool QuestParserCollection::HasQuestSubGlobal(QuestEventID evt) {
return false;
}
bool QuestParserCollection::PlayerHasQuestSub(QuestEventID evt, bool check_encounters) {
return PlayerHasQuestSubLocal(evt) || PlayerHasQuestSubGlobal(evt) || (check_encounters && PlayerHasEncounterSub(evt));
bool QuestParserCollection::PlayerHasQuestSub(QuestEventID evt) {
return PlayerHasQuestSubLocal(evt) || PlayerHasQuestSubGlobal(evt) || PlayerHasEncounterSub(evt);
}
bool QuestParserCollection::PlayerHasEncounterSub(QuestEventID evt) {
@@ -207,8 +207,8 @@ bool QuestParserCollection::SpellHasEncounterSub(uint32 spell_id, QuestEventID e
return HasEncounterSub(evt, package_name);
}
bool QuestParserCollection::SpellHasQuestSub(uint32 spell_id, QuestEventID evt, bool check_encounters) {
if (check_encounters && SpellHasEncounterSub(spell_id, evt)) {
bool QuestParserCollection::SpellHasQuestSub(uint32 spell_id, QuestEventID evt) {
if (SpellHasEncounterSub(spell_id, evt)) {
return true;
}
@@ -241,11 +241,11 @@ bool QuestParserCollection::ItemHasEncounterSub(EQ::ItemInstance* item, QuestEve
return false;
}
bool QuestParserCollection::ItemHasQuestSub(EQ::ItemInstance *itm, QuestEventID evt, bool check_encounters) {
bool QuestParserCollection::ItemHasQuestSub(EQ::ItemInstance *itm, QuestEventID evt) {
if (itm == nullptr)
return false;
if (check_encounters && ItemHasEncounterSub(itm, evt)) {
if (ItemHasEncounterSub(itm, evt)) {
return true;
}