theballaam96

Coin Door Opcode

Apr 8th, 2021 (edited)
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.88 KB | None | 0 0
  1. if (*(byte *)(behaviour + 0x48) == 0) {
  2.     if (checkFlag(0x10>4,'Permanent') !== 0) { // If has Nintendo Coin
  3.         if (checkFlag(0x2F>3,'Permanent') !== 0) { // If has Rareware Coin
  4.             changeTriggerActiveStateOfFirstInstanceOfType(Type 0x02,0) // Clear trigger for "Nintendo / Rareware Coin text trigger"
  5.         }
  6.     }
  7. }
  8. if (*(byte *)(behaviour + 0x48) == 0) {
  9.     if (checkFlag(0x60>3,'Permanent') !== 0) { // Coin Door isn't open
  10.         *(byte *)(behaviour + 0x4B) = 20
  11.     }
  12. }
  13. if (*(byte *)(behaviour + 0x48) == 0) {
  14.     if (checkFlag(0x10>4,'Permanent') !== 0) { // Has Nintendo Coin
  15.         if (checkFlag(0x2F>3,'Permanent') !== 0) { // Has RW Coin
  16.             if (checkFlag(0x60>3,'Permanent') == 0) { // Coin Door isn't open
  17.                 if (isPlayerWithinDistanceOfObject(50) !== 0) { // Is within 50 units of the door
  18.                     setFlag(0x60>3,True,'Permanent') // Set door open flag
  19.                     playSong('Success', (float) 1) // Play success song
  20.                     PlayCutsceneFromModelTwoScript(behaviour,16,1,0) // Play Cutscene 16 (Coin door open)
  21.                     *(byte *)(behaviour + 0x4B) = 100
  22.                 }
  23.             }
  24.         }
  25.     }
  26. }
  27. if (*(byte *)(behaviour + 0x48) == 0) {
  28.     if (checkFlag(0x2F>3,'Permanent') == 0) { // If missing RW Coin
  29.         *(byte *)(behaviour + 0x4B) = 100
  30.     }
  31. }
  32. if (*(byte *)(behaviour + 0x48) == 0) {
  33.     if (checkFlag(0x10>4,'Permanent') == 0) { // If missing Nin Coin
  34.         *(byte *)(behaviour + 0x4B) = 100
  35.     }
  36. }
  37. if (*(byte *)(behaviour + 0x48) == 1) {
  38.     FUN_80650A04(param_4,1,5)
  39.     FUN_806508B4(param_4,1,1)
  40.     if (*(short *)(behaviour + 0x10) < 0) {
  41.         *(short *)(behaviour + 0x10) = FUN_80605044(param_4,288,0,0)
  42.     }
  43.     *(byte *)(behaviour + 0x4B) = 5
  44. }
  45. if (*(byte *)(behaviour + 0x48) == 5) {
  46.     *(code *)(0x80748040)(behaviour,param_4,0,2)
  47. }
  48. if (*(byte *)(behaviour + 0x48) == 5) {
  49.     if (FUN_80650D04(param_4,1) == 0) {
  50.         x10_temp = *(short *)(behaviour + 0x10)
  51.         if (-1 < x10_temp) {
  52.             FUN_80605380(x10_temp)
  53.             *(short *)(behaviour + 0x10) = 0xFFFF
  54.         }
  55.         *(short *)(behaviour + 0x44) = 100
  56.         *(byte *)(behaviour + 0x4B) = 6
  57.     }
  58. }
  59. if (*(byte *)(behaviour + 0x48) == 6) {
  60.     if (*(ushort *)(behaviour + 0x44) == 0) {
  61.         *(byte *)(behaviour + 0x60) = 1
  62.         *(ushort *)(behaviour + 0x62) = 0
  63.         *(byte *)(behaviour + 0x66) = 255
  64.         *(byte *)(behaviour + 0x4B) = 100
  65.     }
  66. }
  67. if (*(byte *)(behaviour + 0x48) == 20) {
  68.     *(byte *)(behaviour + 0x60) = 1
  69.     *(ushort *)(behaviour + 0x62) = 0
  70.     *(byte *)(behaviour + 0x66) = 255
  71. }
  72. if (*(byte *)(behaviour + 0x48) == 20) {
  73.     FUN_80650A04(param_4,1,0)
  74.     FUN_80650AD8(param_4,1,0,(100/(5.333806864e-315)))
  75.     FUN_806508B4(param_4,1,1)
  76.     *(byte *)(behaviour + 0x4B) = 21
  77. }
  78. if (*(byte *)(behaviour + 0x48) == 21) {
  79.     FUN_8065092C(param_4,1)
  80.     *(byte *)(behaviour + 0x4B) = 22
  81. }
  82. if (*(byte *)(behaviour + 0x48) == 22) {
  83.     *(byte *)(behaviour + 0x4B) = 100
  84. }
  85. if (touchingModelTwoById(0x5A) !== 0) { // Touching Key 8
  86.     // Execution Type 0x53 stripped from final. Parameters: 246,0,0
  87.     setFlag(0x2F>4,True,'Permanent') // Set Key 8 Flag
  88. }
Add Comment
Please, Sign In to add comment