P dead V3

From Unofficial QEdit Wiki Guide
Jump to: navigation, search

Syntax

Syntax: p_dead_V3 register1, register2

  • register1 = Register to set if the player dose not have a a scape doll in their inventory.
  • register2 = Reserved register 250 stores players slot number.

Use

Used to make sure players is really dead and not holding on to a scape doll in their inventory.

If the player is holding a scape doll in their inventory register1 will not be set and equal 00000000.

If the player is not holding a scape doll in their inventory register1 will be set to equal 00000001.

Example


1:       ret 
100:     get_slotnumber R250 //Gets the players slot number and stores it in register 250.
         thread 101 //Threads function 101.
         thread 102 //Threads function 102.
         ret 
101:     sync  //Waits 1 frame.
         get_player_hp R250, R1 //Stores the players maximum HP in register 1, current HP in register 2, maximum TP in register 3, and current TP in register 4.
         jmp 101 //Jumps to function 101.
102:     sync  //Waits 1 frame.
         switch_call R2, 2:103:1 //Calls a function based a registers value. If register 2 equals 00000000 call function 103. If register 2 equals 00000001 (or anything else not 00000000) call function 1.
         jmp 102 //Jumps to function 102.
103:     p_dead_V3 R5, R250 //If the player does not a scape doll in their inventory make register 5 equal 00000001.
         switch_call R5, 2:1:104 //Calls a function based a registers value. If register 5 equals 00000000 call function 1. If register 5 equals 00000001 (or anything else not 00000000) call function 104.
         ret 
104:     leti R6, 00000000 //Makes register 6 equal 00000000.
         clear_mainwarp 00000000 //Dis-allows access to the floor id defined from the main Ragol telepoerter. (Edit in the floors id('s) your quest uses and add more of this opcode as needed to suit the needs of your quest.).
         set R253 //Makes register 253 (quest failure flag reserved register) equal 00000001.
         go_floor R250, R6 //Sends the player who encounters this to the floor in the floor id stored in register 6.
         ret 

Also see

ret, get_slotnumber, thread, sync,

get_player_hp, jmp, switch_call, p_dead_V3,

leti, clear_mainwarp, set, go_floor,

reservedregisters