mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 08:21:28 +00:00
[Quest API] (Performance) Check event exists before export and execute EVENT_HP (#2904)
# Notes - Optionally parse this event instead of always doing so.
This commit is contained in:
parent
57d0420399
commit
4a339d49df
12
zone/mob.cpp
12
zone/mob.cpp
@ -1382,9 +1382,11 @@ void Mob::CreateHPPacket(EQApplicationPacket* app)
|
|||||||
{
|
{
|
||||||
if (ds->hp < GetNextHPEvent())
|
if (ds->hp < GetNextHPEvent())
|
||||||
{
|
{
|
||||||
std::string export_string = fmt::format("{}", GetNextHPEvent());
|
|
||||||
SetNextHPEvent(-1);
|
SetNextHPEvent(-1);
|
||||||
parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, export_string, 0);
|
|
||||||
|
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_HP)) {
|
||||||
|
parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, std::to_string(GetNextHPEvent()), 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1392,9 +1394,11 @@ void Mob::CreateHPPacket(EQApplicationPacket* app)
|
|||||||
{
|
{
|
||||||
if (ds->hp > GetNextIncHPEvent())
|
if (ds->hp > GetNextIncHPEvent())
|
||||||
{
|
{
|
||||||
std::string export_string = fmt::format("{}", GetNextIncHPEvent());
|
|
||||||
SetNextIncHPEvent(-1);
|
SetNextIncHPEvent(-1);
|
||||||
parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, export_string, 1);
|
|
||||||
|
if (parse->HasQuestSub(GetNPCTypeID(), EVENT_HP)) {
|
||||||
|
parse->EventNPC(EVENT_HP, CastToNPC(), nullptr, std::to_string(GetNextIncHPEvent()), 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user