InitExtendedItemAPI
not ratedPreface: NO IDEA WHAT SECTION THIS GOES UNDER.
This function extends the API of items and very accurately tries "to guess" one of 14 possible happenings of an item.
Its made up of a few things. First to start things off you need to call InitExtendedItemAPI(), perferably at game init. Now you can use calls to getExtendedState() on any of those item related events, and the code will try to "guess" what actually happened. It will loop for at most about a second until it finally gets a result. If it does not get a result it returns 0 (error).
This can allow you some interesting results. You can set up a trigger to handle the guy who traded an item (Use the call in a lose irwm event) and give him some bonus for being nice, and you can also punish the reciever (use the call in an aquire item event) for not giving something in return.
Here is a list of the 15 handled states:
00=="Error : No Event happened"
01=="The item was dropped"
02=="The item was destroyed by a trigger"
03=="The item was given by a trigger"
04=="The item was traded"
05=="The item was an autoconsumed that was given by a trigger"
06=="The item was used"
07=="The item was used to consumption"
08=="The item was sold to a shop"
09=="The item was bought at a shop"
10=="The item was bought at a shop and was autoconsumed"
11=="The item was ordered to be picked up but somewhere along the line the order was canceled"
12=="The item was picked up"
13=="The item was an autoconsumable that was picked up."
14 =="The item was moved in your inventory"
This function extends the API of items and very accurately tries "to guess" one of 14 possible happenings of an item.
Its made up of a few things. First to start things off you need to call InitExtendedItemAPI(), perferably at game init. Now you can use calls to getExtendedState() on any of those item related events, and the code will try to "guess" what actually happened. It will loop for at most about a second until it finally gets a result. If it does not get a result it returns 0 (error).
This can allow you some interesting results. You can set up a trigger to handle the guy who traded an item (Use the call in a lose irwm event) and give him some bonus for being nice, and you can also punish the reciever (use the call in an aquire item event) for not giving something in return.
Here is a list of the 15 handled states:
00=="Error : No Event happened"
01=="The item was dropped"
02=="The item was destroyed by a trigger"
03=="The item was given by a trigger"
04=="The item was traded"
05=="The item was an autoconsumed that was given by a trigger"
06=="The item was used"
07=="The item was used to consumption"
08=="The item was sold to a shop"
09=="The item was bought at a shop"
10=="The item was bought at a shop and was autoconsumed"
11=="The item was ordered to be picked up but somewhere along the line the order was canceled"
12=="The item was picked up"
13=="The item was an autoconsumable that was picked up."
14 =="The item was moved in your inventory"