GMCP Item Tracker
Posted: Thu Apr 04, 2013 4:24 am
This GMCP Item Tracker takes care of all the item tracking. In order to not get messed up with other functions modifying GMCP.Item information, this tracker uses all of its own tables as well as a manual deep-copy of the gmcp tables into its own tables.
This was programmed for Achaea, and follows the GMCP standards as implemented there. If another MUD has something modified slightly from the standards, or interprets the standards differently, it should only require minor modification. Please feel free to re-post 'realm specific' mods of this here.
Variables:
room_items : A table of all the items in the room, updated with every item entered into the room
inv_items : A table of all the items in your inventory, updated with every item acquired. NOTE: In Achaea, the 'secret' ability hides the acquisition message, even in GMCP - these items will not show until this table is updated, which should happen any time the inventory is checked.
wield_items : A table of the left and right wielded items. If an item is a two-hand wield, it will be in both left -and- right portions of this table. For instance, wield_items.left.id would be the ID of the item wielded in your left hand. This updates on the inventory list message, update messages, and remove messages.
phoenix.items["1234_items"] : A table of the contents of container 1234, automatically generated.
*NEW!*
Events:
Wield Event - this event fires after the wield table is fully updated.
phoenix done with wield - passes an argument of what happened during wield updating. This argument is an explanatory argument, in case you need to trigger off 'unwield', for instance.
Tracking Event - These events fire only after the scripts are done running, and room_item and inv_items have been fully updated.
phoenix items add - passes an argument of 'location', for where the item was added to.
phoenix items remove - passes an argument of 'location', for where the item was removed from.
phoenix items list - passes an argument of 'location', for which location we received a list of.
phoenix items update - passes an argument of 'location', for where the item updated was located.
This was programmed for Achaea, and follows the GMCP standards as implemented there. If another MUD has something modified slightly from the standards, or interprets the standards differently, it should only require minor modification. Please feel free to re-post 'realm specific' mods of this here.
Variables:
room_items : A table of all the items in the room, updated with every item entered into the room
inv_items : A table of all the items in your inventory, updated with every item acquired. NOTE: In Achaea, the 'secret' ability hides the acquisition message, even in GMCP - these items will not show until this table is updated, which should happen any time the inventory is checked.
wield_items : A table of the left and right wielded items. If an item is a two-hand wield, it will be in both left -and- right portions of this table. For instance, wield_items.left.id would be the ID of the item wielded in your left hand. This updates on the inventory list message, update messages, and remove messages.
phoenix.items["1234_items"] : A table of the contents of container 1234, automatically generated.
*NEW!*
Events:
Wield Event - this event fires after the wield table is fully updated.
phoenix done with wield - passes an argument of what happened during wield updating. This argument is an explanatory argument, in case you need to trigger off 'unwield', for instance.
Tracking Event - These events fire only after the scripts are done running, and room_item and inv_items have been fully updated.
phoenix items add - passes an argument of 'location', for where the item was added to.
phoenix items remove - passes an argument of 'location', for where the item was removed from.
phoenix items list - passes an argument of 'location', for which location we received a list of.
phoenix items update - passes an argument of 'location', for where the item updated was located.