Jump to content

TakePartyItem() and item stacks


Recommended Posts

As the TakePartyItem() action behaves a bit quirky it can remove multiple instances of an item if they are stacked within a single slot. The most notable example is the Twisted Rune entry trigger (TRAN1008.BCS) which can take 5 Rogue Stones from the party's inventory in case they happen to be stacked together. This can be fixed by using TakePartyItemNum() instead, which is what the developers themselves did in ToB. In SoA, there are at least two instances where this could be fixed:

 

// The Twisted Rune entrance trigger in the Bridge District should only consume a single Rogue Stone

COPY_EXISTING ~tran1008.bcs~ ~override~
 DECOMPILE_BCS_TO_BAF
REPLACE_TEXTUALLY CASE_INSENSITIVE ~TakePartyItem("MISC45")~ ~TakePartyItemNum("MISC45",1)~
 COMPILE_BAF_TO_BCS
BUT_ONLY_IF_IT_CHANGES


// Maheer the blacksmith in Waukeen's Promenade should only take a single diamond/beljuril for upgrading the Horn of Valhalla

COPY_EXISTING ~shop03.dlg~ ~override~
 DECOMPILE_DLG_TO_D
REPLACE_TEXTUALLY CASE_INSENSITIVE ~TakePartyItem("misc42")~ ~TakePartyItemNum("misc42",1)~ // Diamond
REPLACE_TEXTUALLY CASE_INSENSITIVE ~TakePartyItem("misc6z")~ ~TakePartyItemNum("misc6z",1)~ // Beljuril
 COMPILE_D_TO_DLG
BUT_ONLY_IF_IT_CHANGES

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...