BB exchange PC

From Unofficial QEdit Wiki Guide
Jump to: navigation, search

Syntax

Syntax: BB_exchange_PC

Use

This opcode is used to remove 1 photon crystal from a players inventory.

Note 1: This opcode only works in one person mode.

Note 2: This opcode disables all drops for the quest.

Example


100: leti R1, 00000000 //Makes register 1 = 00000000. this is unknown as to why it is needed but it is needed to make the get_stackable_item_count work.
     leti R2, 00000003 //Makes register 2 = 00000003. Used for pc hex value byte.
     leti R3, 00000010 //Makes register 3 = 00000010. Used for pc hex value byte.
     leti R4, 00000002 //Makes register 4 = 00000002. Used for pc hex value byte.
     get_stackable_item_count R1, R5 //Stores the current number of items in the stack defined above in registers 2,3,and 4 in Register 5. In short it tells register 5 how many photon crystals the player is currently holding. So you can use Register 5's value to make sure that the player is holding a photon crystal in their inventory and how many of photon crystals they have currently.
     jmpi_= R5, 00000000, 101 //If register 5 = 00000000 then jump to function 101.
     window_msg I will take away 1 Photon crystal now. //Displays a window message.
     winend  //Closes a window message.
     BB_exchange_PC  //Removes 1 photon crystal from the players inventory.
     ret 
101: window_msg Error. You do not have a photon crystal.//Displays a window message.
     winend  //Closes a window message.
     ret 

Also see

leti, get_stackable_item_count, Jmpiue,

window_msg, winend, ret