[Quest API] (Performance) Check event EVENT_ITEM_TICK or EVENT_WEAPON_PROC exist before export and execute (#2914)

* [Quest API] Optionally parse EVENT_ITEM_TICK

# Notes
- Optionally parse this event instead of always doing so.

* Update mob.cpp
This commit is contained in:
Alex King
2023-02-12 23:22:22 -05:00
committed by GitHub
parent 241f900dc4
commit 086538754e
2 changed files with 22 additions and 6 deletions
+9 -3
View File
@@ -8102,7 +8102,10 @@ void Client::TryItemTick(int slot)
if (GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) && (zone->tick_items[iid].bagslot || slot <= EQ::invslot::EQUIPMENT_END))
{
EQ::ItemInstance* e_inst = (EQ::ItemInstance*)inst;
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
if (parse->ItemHasQuestSub(e_inst, EVENT_ITEM_TICK)) {
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
}
}
}
@@ -8120,8 +8123,11 @@ void Client::TryItemTick(int slot)
{
if( GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) )
{
EQ::ItemInstance* e_inst = (EQ::ItemInstance*)a_inst;
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
EQ::ItemInstance* e_inst = (EQ::ItemInstance*) a_inst;
if (parse->ItemHasQuestSub(e_inst, EVENT_ITEM_TICK)) {
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
}
}
}
}