mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 07:38:36 +00:00
[Quest API] Add EVENT_CONSIDER to Perl and Lua. (#1531)
* [Quest API] Add EVENT_CONSIDER to Perl and Lua. - Exports $entity_id in Perl. - Exports e.entity_id in Lua. Allows you to perform events on consider for server operators. * Missing comma. * Formatting. * Add return capability to EVENT_CONSIDER and EVENT_CONSIDER_CORPSE so operators can break out of consider functions.
This commit is contained in:
+12
-2
@@ -4854,6 +4854,10 @@ void Client::Handle_OP_Consider(const EQApplicationPacket *app)
|
||||
if (tmob == 0)
|
||||
return;
|
||||
|
||||
if (parse->EventPlayer(EVENT_CONSIDER, this, fmt::format("{}", conin->targetid), 0) == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (tmob->GetClass() == LDON_TREASURE)
|
||||
{
|
||||
Message(Chat::Yellow, "%s", tmob->GetCleanName());
|
||||
@@ -4977,7 +4981,10 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app)
|
||||
Consider_Struct* conin = (Consider_Struct*)app->pBuffer;
|
||||
Corpse* tcorpse = entity_list.GetCorpseByID(conin->targetid);
|
||||
if (tcorpse && tcorpse->IsNPCCorpse()) {
|
||||
parse->EventPlayer(EVENT_CONSIDER_CORPSE, this, fmt::format("{}", conin->targetid), 0);
|
||||
if (parse->EventPlayer(EVENT_CONSIDER_CORPSE, this, fmt::format("{}", conin->targetid), 0) == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 min; uint32 sec; uint32 ttime;
|
||||
if ((ttime = tcorpse->GetDecayTime()) != 0) {
|
||||
sec = (ttime / 1000) % 60; // Total seconds
|
||||
@@ -4991,7 +4998,10 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app)
|
||||
}
|
||||
}
|
||||
else if (tcorpse && tcorpse->IsPlayerCorpse()) {
|
||||
parse->EventPlayer(EVENT_CONSIDER_CORPSE, this, fmt::format("{}", conin->targetid), 0);
|
||||
if (parse->EventPlayer(EVENT_CONSIDER_CORPSE, this, fmt::format("{}", conin->targetid), 0) == 1) {
|
||||
return;
|
||||
}
|
||||
|
||||
uint32 day, hour, min, sec, ttime;
|
||||
if ((ttime = tcorpse->GetDecayTime()) != 0) {
|
||||
sec = (ttime / 1000) % 60; // Total seconds
|
||||
|
||||
Reference in New Issue
Block a user