[Quest API] Add EVENT_PAYLOAD to Perl/Lua. (#2611)

* [Quest API] Add EVENT_PAYLOAD to Perl/Lua.

# Perl
- Add `$bot->SendPayload(payload_id)`.
- Add `$bot->SendPayload(payload_id, payload_value)`.
- Add `$client->SendPayload(payload_id)`.
- Add `$client->SendPayload(payload_id, payload_value)`.
- Add `$mob->SendPayload(payload_id)`.
- Add `$mob->SendPayload(payload_id, payload_value)`.
- Add `$npc->SendPayload(payload_id)`.
- Add `$npc->SendPayload(payload_id, payload_value)`.

# Lua
- Add `bot:SendPayload(payload_id)`.
- Add `bot:SendPayload(payload_id, payload_value)`.
- Add `client:SendPayload(payload_id)`.
- Add `client:SendPayload(payload_id, payload_value)`.
- Add `mob:SendPayload(payload_id)`.
- Add `mob:SendPayload(payload_id, payload_value)`.
- Add `npc:SendPayload(payload_id)`.
- Add `npc:SendPayload(payload_id, payload_value)`.

# Notes
- Allows operators to send payload IDs with a payload value, the value can be a comma separated value, JSON, etc.
- The idea is to allow a more configurable event for operators to send information to/from entities.

* Cleanup parser events.
This commit is contained in:
Alex King
2022-12-04 17:47:49 -05:00
committed by GitHub
parent e1d5274bd5
commit 9a35cacf27
25 changed files with 1630 additions and 342 deletions
+1 -27
View File
@@ -2477,37 +2477,11 @@ void NPC::CheckSignal() {
if (!signal_q.empty()) {
int signal_id = signal_q.front();
signal_q.pop_front();
std::string export_string = fmt::format("{}", signal_id);
const auto export_string = fmt::format("{}", signal_id);
parse->EventNPC(EVENT_SIGNAL, this, nullptr, export_string, 0);
}
}
/*
alter table npc_types drop column usedspells;
alter table npc_types add column npc_spells_id int(11) unsigned not null default 0 after merchant_id;
Create Table npc_spells (
id int(11) unsigned not null auto_increment primary key,
name tinytext,
parent_list int(11) unsigned not null default 0,
attack_proc smallint(5) not null default -1,
proc_chance tinyint(3) not null default 3
);
create table npc_spells_entries (
id int(11) unsigned not null auto_increment primary key,
npc_spells_id int(11) not null,
spellid smallint(5) not null default 0,
type smallint(5) unsigned not null default 0,
minlevel tinyint(3) unsigned not null default 0,
maxlevel tinyint(3) unsigned not null default 255,
manacost smallint(5) not null default '-1',
recast_delay int(11) not null default '-1',
priority smallint(5) not null default 0,
index npc_spells_id (npc_spells_id)
);
*/
bool IsSpellInList(DBnpcspells_Struct* spell_list, uint16 iSpellID);
bool IsSpellEffectInList(DBnpcspellseffects_Struct* spelleffect_list, uint16 iSpellEffectID, int32 base_value, int32 limit, int32 max_value);