mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 09:31:30 +00:00
[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:
parent
241f900dc4
commit
086538754e
@ -8102,9 +8102,12 @@ 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))
|
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;
|
EQ::ItemInstance* e_inst = (EQ::ItemInstance*)inst;
|
||||||
|
|
||||||
|
if (parse->ItemHasQuestSub(e_inst, EVENT_ITEM_TICK)) {
|
||||||
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Only look at augs in main inventory
|
//Only look at augs in main inventory
|
||||||
if (slot > EQ::invslot::EQUIPMENT_END) { return; }
|
if (slot > EQ::invslot::EQUIPMENT_END) { return; }
|
||||||
@ -8120,11 +8123,14 @@ void Client::TryItemTick(int slot)
|
|||||||
{
|
{
|
||||||
if( GetLevel() >= zone->tick_items[iid].level && zone->random.Int(0, 100) >= (100 - zone->tick_items[iid].chance) )
|
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;
|
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);
|
parse->EventItem(EVENT_ITEM_TICK, this, e_inst, nullptr, "", slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Client::ItemTimerCheck()
|
void Client::ItemTimerCheck()
|
||||||
|
|||||||
14
zone/mob.cpp
14
zone/mob.cpp
@ -4139,11 +4139,21 @@ void Mob::ExecWeaponProc(const EQ::ItemInstance *inst, uint16 spell_id, Mob *on,
|
|||||||
//const cast is dirty but it would require redoing a ton of interfaces at this point
|
//const cast is dirty but it would require redoing a ton of interfaces at this point
|
||||||
//It should be safe as we don't have any truly const EQ::ItemInstance floating around anywhere.
|
//It should be safe as we don't have any truly const EQ::ItemInstance floating around anywhere.
|
||||||
//So we'll live with it for now
|
//So we'll live with it for now
|
||||||
int i = parse->EventItem(EVENT_WEAPON_PROC, CastToClient(), const_cast<EQ::ItemInstance*>(inst), on, "", spell_id);
|
if (parse->ItemHasQuestSub(const_cast<EQ::ItemInstance*>(inst), EVENT_WEAPON_PROC)) {
|
||||||
if(i != 0) {
|
int i = parse->EventItem(
|
||||||
|
EVENT_WEAPON_PROC,
|
||||||
|
CastToClient(),
|
||||||
|
const_cast<EQ::ItemInstance*>(inst),
|
||||||
|
on,
|
||||||
|
"",
|
||||||
|
spell_id
|
||||||
|
);
|
||||||
|
|
||||||
|
if (i != 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool twinproc = false;
|
bool twinproc = false;
|
||||||
int32 twinproc_chance = 0;
|
int32 twinproc_chance = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user