How do you handle the bug that doesn't track Unacquire gold?
LuckyDay
Member Posts: 7
OnUnacquireItem doesn't trigger when gold is lost.
OnAcquireItem does trigger but doesn't recognize that it is gold or even anything. There is a simple fix that can handle this using GetModuleItemAcquiredStackSize()
OnUnacquireItem does not have an equivalent for GetModuleItemAcquiredStackSize() - it would probably be called GetModuleItemLostStackSize()
So nothing is triggered when gold is lost. This is a bug that's been around forever. There's lot's of times a scripter might want track this as you can track the loss of gear but you can't gold (the lexicon says that the issue extends to stacked items but it contradicts itself on this I haven't found this problem in testing yet, at least when I drop something).
How do other people handle this?
OnAcquireItem does trigger but doesn't recognize that it is gold or even anything. There is a simple fix that can handle this using GetModuleItemAcquiredStackSize()
int getGoldAcquired(); void main() { object PC = GetModuleItemAcquiredBy(); int goldAcquired = getGoldAcquired(); string message = "You picked up " + IntToString(goldAcquired) + "gp"; AssignCommand(PC, SpeakString(message)); } int getGoldAcquired() { int totalGold = 0; object PC = GetModuleItemAcquiredBy(); object item = GetModuleItemAcquired(); if(GetIsObjectValid(item) == FALSE) { totalGold = GetModuleItemAcquiredStackSize(); } return totalGold; }
OnUnacquireItem does not have an equivalent for GetModuleItemAcquiredStackSize() - it would probably be called GetModuleItemLostStackSize()
So nothing is triggered when gold is lost. This is a bug that's been around forever. There's lot's of times a scripter might want track this as you can track the loss of gear but you can't gold (the lexicon says that the issue extends to stacked items but it contradicts itself on this I haven't found this problem in testing yet, at least when I drop something).
How do other people handle this?
2
Comments