Create cleaner versions of onBeforeDropBag and onBeforeUseItem
Foreword
All new events in IWD should adhere to the following two rules:
- Event should not be prefixed by
on...
- Event should only accept a single argument (an event object which contains whatever is needed)
onBeforeDropBag -> beforeDropBag
Old arguments:
(obj: 'object that does the dropping', items: 'array of items to be dropped', killSource: 'object that caused the drop to happen')
New arguments:
{
objDropper: 'object that does the dropping',
objLooter: 'object that will be looting',
objKillSource: 'object that caused the drop to happen',
items: 'array of items to be dropped'
}
onBeforeUseItem -> beforeUseItem
Old arguments:
(obj: 'object that is using the item', item: 'item that is being used', eventMessage: { success: 'boolean', cdMax: 'integer' })
New arguments:
{
obj: 'object that is using the item',
item: 'item that is being used',
cdMax: 'integer that can be overridden if needed',
success: 'boolean'
}