Item- PickUp

Status
Not open for further replies.
Level 9
Joined
Dec 21, 2006
Messages
490
hello there

i have a item class with max charges 10, start charges 1, charge use 1
if i pick up this item a trigger with item manipulated triggers, if i pick up another one trigger doesn't trigger because it stacks.
how could i track such pickups?
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,241
Code:
// Inventory changes
const int c_unitInventoryChangeUses             = 0;
const int c_unitInventoryChangeExhausts         = 1;
const int c_unitInventoryChangeGains            = 2;
const int c_unitInventoryChangeLoses            = 3;
const int c_unitInventoryChangePicksUp          = 4;
const int c_unitInventoryChangeDrops            = 5;
const int c_unitInventoryChangeBuys             = 6;
const int c_unitInventoryChangeSells            = 7;
const int c_unitInventoryChangeGives            = 8;
const int c_unitInventoryChangeReceives         = 9;
const int c_unitInventoryChangeMoves            = 10;

native void     TriggerAddEventUnitInventoryChange (trigger t, unitref u, int inChangeType, unitref inItem);
You tried all the different inventory change events?
 
Level 9
Joined
Dec 21, 2006
Messages
490
yepp

any buffs applied by the item do not get refreshed aswell. any buffs on the item itself (the item unit, not the item) neither.
help me i desperately seek a solution for this :d

---edit---

the event unit removed triggers but i cannot check the unit type (lol) because the unit is gone. that's so sad
 
Last edited:
Level 9
Joined
Dec 21, 2006
Messages
490
but then i cannot check how many charges the removed unit had.

i have found a workaround that has some drawbacks but it works.
maybe some1 will need one day, so i briefly describe:

i am having 2 item types: tag and tagS
every time i pick up a tag, i'll replace it with a tagS item
each time i drop tagS, i'll create X (number of charges of tagS) tag items and
drop them at the tagS position.
so i can only pick up tag-item with 1 charge.

drawbacks: cannot drop stacked item, 3 triggers needed, cannot pick up with full inventory
 
Status
Not open for further replies.
Top