Process Scenario Conditional

From Final Fantasy Hacktics Wiki
Jump to navigation Jump to search
#   ROUTINE: PROCESS SCENARIO CONDITIONAL
#       Processes a single scenario conditional (or a piece of a conditional) from ATTACK.OUT.
#       Parameters:
#           r4          =    conditionalValue1
#           r5          =    conditionalValue2
#           r6          =    conditionalValue3
#           r7          =    conditionalValue4
#           *(sp + 10)  =    conditionalValue5
#       Returns:
#           r2  =   0, if this conditional should stop being processed (check failed)
#                   1, if this conditional should continue to be processed (check passed)
#                   2, if a scenario should be run

80142694: 27bdffd0 addiu r29,r29,-0x0030
80142698: afb10014 sw r17,0x0014(r29)
8014269c: 00808821 addu r17,r4,r0                   #   conditionalValue1
801426a0: afb20018 sw r18,0x0018(r29)
801426a4: 00a09021 addu r18,r5,r0                   #   conditionalValue2
801426a8: afb3001c sw r19,0x001c(r29)
801426ac: 00c09821 addu r19,r6,r0                   #   conditionalValue3
801426b0: afb50024 sw r21,0x0024(r29)
801426b4: 00e0a821 addu r21,r7,r0                   #   conditionalValue4
801426b8: afb60028 sw r22,0x0028(r29)
801426bc: 8fb60040 lw r22,0x0040(r29)               #   conditionalValue5
801426c0: 34020001 ori r2,r0,0x0001
801426c4: afbf002c sw r31,0x002c(r29)
801426c8: afb40020 sw r20,0x0020(r29)
801426cc: 16220005 bne r17,r2,0x801426e4            #   if (conditionalValue1 == 1) {                           // 0x01 = IsVariableEqualToValue(Variable, Value)
801426d0: afb00010 sw r16,0x0010(r29)
801426d4: 0c04ed64 jal 0x8013b590                   #       scriptVarValue = Get Script Variable (conditionalValue2);
801426d8: 02402021 addu r4,r18,r0
801426dc: 10530114 beq r2,r19,0x80142b30            #       if (scriptVarValue == conditionalValue3)
801426e0: 34020001 ori r2,r0,0x0001                 #           return 1;
801426e4: 34020002 ori r2,r0,0x0002
801426e8: 16220006 bne r17,r2,0x80142704            #   } else if (conditionalValue1 == 2) {                    // 0x02 = IsVariableGreaterThanOrEqualToValue(Variable, Value)
801426ec: 34020003 ori r2,r0,0x0003
801426f0: 0c04ed64 jal 0x8013b590                   #       scriptVarValue = Get Script Variable (conditionalValue2);
801426f4: 02402021 addu r4,r18,r0
801426f8: 0053102a slt r2,r2,r19
801426fc: 10400107 beq r2,r0,0x80142b1c             #       if (scriptVarValue >= conditionalValue3) return 1;
80142700: 34020003 ori r2,r0,0x0003
80142704: 16220006 bne r17,r2,0x80142720            #   } else if (conditionalValue1 == 3) {                    // 0x03 = IsVariableLessThanOrEqualToValue(Variable, Value)
80142708: 2622fffc addiu r2,r17,-0x0004
8014270c: 0c04ed64 jal 0x8013b590                   #       scriptVarValue = Get Script Variable (conditionalValue2);
80142710: 02402021 addu r4,r18,r0
80142714: 0262102a slt r2,r19,r2
80142718: 10400100 beq r2,r0,0x80142b1c             #       if (scriptVarValue <= conditionalValue3) return 1;
8014271c: 2622fffc addiu r2,r17,-0x0004
80142720: 2c420007 sltiu r2,r2,0x0007              
80142724: 10400048 beq r2,r0,0x80142848             #   } else if ((conditionalValue1 - 4) < 7) {               // 0x04 through 0x0a
80142728: 3402000b ori r2,r0,0x000b
8014272c: 0c050942 jal 0x80142508                   #       battleUnit = Get Battle Unit By Unit ID (conditionalValue2);
80142730: 02402021 addu r4,r18,r0
80142734: 00402821 addu r5,r2,r0                    #       battleUnit
80142738: 2402ffff addiu r2,r0,-0x0001
8014273c: 10a20041 beq r5,r2,0x80142844             #       if (battleUnit != -1) {
80142740: 34020004 ori r2,r0,0x0004
80142744: 122200f5 beq r17,r2,0x80142b1c            #           if (conditionalValue1 == 0x04) return 1;        //  0x04 = IsUnitPresent(UnitID)
80142748: 34020005 ori r2,r0,0x0005
8014274c: 16220006 bne r17,r2,0x80142768            #           if (conditionalValue1 == 0x05) {                //  0x05 = IsUnitHPGreaterThanOrEqualToValue(UnitID, Value)
80142750: 34020006 ori r2,r0,0x0006
80142754: 94a20028 lhu r2,0x0028(r5)                #               battleUnit.HP
80142758: 00000000 nop
8014275c: 0053102a slt r2,r2,r19
80142760: 104000ee beq r2,r0,0x80142b1c             #               if (battleUnit.HP >= conditionalValue3) return 1;
80142764: 34020006 ori r2,r0,0x0006
80142768: 16220006 bne r17,r2,0x80142784            #           } else if (conditionalValue1 == 0x06) {         //  0x06 = IsUnitHPLessThanOrEqualToValue(UnitID, Value)
8014276c: 34020007 ori r2,r0,0x0007
80142770: 94a20028 lhu r2,0x0028(r5)                #               battleUnit.HP
80142774: 00000000 nop
80142778: 0262102a slt r2,r19,r2
8014277c: 104000e7 beq r2,r0,0x80142b1c             #               if (battleUnit.HP <= conditionalValue3) return 1;
80142780: 34020007 ori r2,r0,0x0007
80142784: 16220010 bne r17,r2,0x801427c8            #           } else if (conditionalValue1 == 0x07) {         //  0x07 = IsUnitHPGreaterThanOrEqualToPercent(UnitID, Percent)
80142788: 34020008 ori r2,r0,0x0008
8014278c: 94a30028 lhu r3,0x0028(r5)                #               battleUnit.HP
80142790: 00000000 nop
80142794: 00031040 sll r2,r3,0x01                   #               battleUnit.HP * 2
80142798: 00431021 addu r2,r2,r3                    #               battleUnit.HP * 3
8014279c: 000210c0 sll r2,r2,0x03                   #               battleUnit.HP * 24
801427a0: 00431021 addu r2,r2,r3                    #               battleUnit.HP * 25
801427a4: 94a3002a lhu r3,0x002a(r5)                #               battleUnit.MaxHP
801427a8: 00021080 sll r2,r2,0x02                   #               battleUnit.HP * 100
801427ac: 24630001 addiu r3,r3,0x0001               #               battleUnit.MaxHP + 1
801427b0: 0043001a div r2,r3                        
801427b4: 00001012 mflo r2                          #               percentValue = (battleUnit.HP * 100) / (battleUnit.MaxHP + 1)
801427b8: 00000000 nop
801427bc: 0053102a slt r2,r2,r19
801427c0: 104000d6 beq r2,r0,0x80142b1c             #               if (percentValue >= conditionalValue3) return 1;
801427c4: 34020008 ori r2,r0,0x0008
801427c8: 16220010 bne r17,r2,0x8014280c            #           } else if (conditionalValue1 == 0x08) {         //  0x08 = IsUnitHPLessThanOrEqualToPercent(UnitID, Percent)
801427cc: 34020009 ori r2,r0,0x0009
801427d0: 94a30028 lhu r3,0x0028(r5)                #               battleUnit.HP
801427d4: 00000000 nop
801427d8: 00031040 sll r2,r3,0x01                   #               battleUnit.HP * 2
801427dc: 00431021 addu r2,r2,r3                    #               battleUnit.HP * 3
801427e0: 000210c0 sll r2,r2,0x03                   #               battleUnit.HP * 24
801427e4: 00431021 addu r2,r2,r3                    #               battleUnit.HP * 25
801427e8: 94a3002a lhu r3,0x002a(r5)                #               battleUnit.MaxHP
801427ec: 00021080 sll r2,r2,0x02                   #               battleUnit.HP * 100
801427f0: 24630001 addiu r3,r3,0x0001               #               battleUnit.MaxHP + 1
801427f4: 0043001a div r2,r3
801427f8: 00001012 mflo r2                          #               percentValue = (battleUnit.HP * 100) / (battleUnit.MaxHP + 1)
801427fc: 00000000 nop
80142800: 0262102a slt r2,r19,r2
80142804: 104000c5 beq r2,r0,0x80142b1c             #               if (percentValue <= conditionalValue3) return 1;
80142808: 34020009 ori r2,r0,0x0009
8014280c: 16220006 bne r17,r2,0x80142828            #           } else if (conditionalValue1 == 0x09) {         // 0x09 = IsUnitMPGreaterThanOrEqualToValue(UnitID, Value)
80142810: 3402000a ori r2,r0,0x000a
80142814: 94a2002c lhu r2,0x002c(r5)                #               battleUnit.MP
80142818: 00000000 nop
8014281c: 0053102a slt r2,r2,r19                    
80142820: 104000be beq r2,r0,0x80142b1c             #               if (battleUnit.MP >= conditionalValue3) return 1;
80142824: 3402000a ori r2,r0,0x000a
80142828: 16220007 bne r17,r2,0x80142848            #           } else if (conditionalValue1 == 0x0a) {         // 0x0a = IsUnitMPLessThanOrEqualToValue(UnitID, Value)
8014282c: 3402000b ori r2,r0,0x000b
80142830: 94a2002c lhu r2,0x002c(r5)                #               battleUnit.MP
80142834: 00000000 nop
80142838: 0262102a slt r2,r19,r2
8014283c: 104000bc beq r2,r0,0x80142b30             #               if (battleUnit.MP <= conditionalValue3) return 1;
80142840: 34020001 ori r2,r0,0x0001
                                                    #           }
                                                    #       }
80142844: 3402000b ori r2,r0,0x000b
80142848: 1622001e bne r17,r2,0x801428c4            #   } else if (conditionalValue1 == 0x0b) {                 // 0x0b = IsUnitActiveTurn(UnitID)
8014284c: 3402000d ori r2,r0,0x000d
80142850: 3c048015 lui r4,0x8015
80142854: 8c84d304 lw r4,-0x2cfc(r4)                #       activeTurnUnitID = *0x8014d304
80142858: 340200ff ori r2,r0,0x00ff
8014285c: 10820019 beq r4,r2,0x801428c4             #       if (activeTurnUnitID != 0xff) {
80142860: 3402000d ori r2,r0,0x000d
80142864: 0c0602bf jal 0x80180afc                   #           battleUnit = Get Unit's Data Pointer (activeTurnUnitID);
80142868: 00000000 nop
8014286c: 00402821 addu r5,r2,r0                    #           battleUnit
80142870: 90a20161 lbu r2,0x0161(r5)                #           battleUnit.ENTD_ID
80142874: 00000000 nop
80142878: 105200ad beq r2,r18,0x80142b30            #           if (battleUnit.ENTD_ID == conditionalValue2) 
8014287c: 34020001 ori r2,r0,0x0001                 #               return 1;
80142880: 90a20161 lbu r2,0x0161(r5)                #           battleUnit.ENTD_ID
80142884: 00000000 nop
80142888: 2442ff88 addiu r2,r2,-0x0078              #           battleUnit.ENTD_ID - 0x78
8014288c: 2c420005 sltiu r2,r2,0x0005
80142890: 104000a7 beq r2,r0,0x80142b30             #           if ((battleUnit.ENTD_ID - 0x78) >= 5)       // ENTD ID between 0x78 and 0x7c (inclusive) - player non-Ramza unit?
80142894: 00001021 addu r2,r0,r0                    #               return 0;
80142898: 90a20000 lbu r2,0x0000(r5)                #           battleUnit.BaseClass      
8014289c: 00000000 nop
801428a0: 145200a3 bne r2,r18,0x80142b30            #           if (battleUnit.BaseClass != conditionalValue2)
801428a4: 00001021 addu r2,r0,r0                    #               return 0;
801428a8: 2e42004a sltiu r2,r18,0x004a              #           if (conditionalValue2 >= 0x4a)              // Must be Special class; 0x4a = Squire
801428ac: 10400099 beq r2,r0,0x80142b14             #               return 0;
801428b0: 00000000 nop
801428b4: 1640009e bne r18,r0,0x80142b30            #           if (conditionalValue2 != 0)
801428b8: 34020001 ori r2,r0,0x0001                 #               return 1;
801428bc: 08050acc j 0x80142b30                     #           return 0;
801428c0: 00001021 addu r2,r0,r0
                                                    #       }
801428c4: 16220015 bne r17,r2,0x8014291c            #   } else if (conditionalValue1 == 0x0d) {                 //  0x0d = IsRamzaEquippedWithItem(ItemID)
801428c8: 3402000e ori r2,r0,0x000e
801428cc: 34100001 ori r16,r0,0x0001                #       unitID = 1
801428d0: 2414ffff addiu r20,r0,-0x0001
                                                    #       do {
801428d4: 0c050942 jal 0x80142508                   #           battleUnit = Get Battle Unit By Unit ID (unitID);
801428d8: 02002021 addu r4,r16,r0
801428dc: 00402821 addu r5,r2,r0                    #           battleUnit
801428e0: 10b4000a beq r5,r20,0x8014290c            #           if (battleUnit != -1) {
801428e4: 00000000 nop
801428e8: 00002021 addu r4,r0,r0                    #               equipSlotIndex = 0
801428ec: 00a41021 addu r2,r5,r4                    #               battleUnit + equipSlotIndex   
                                                    #               do {
801428f0: 9042001a lbu r2,0x001a(r2)                #                   equipSlotItemID = *(battleUnit + equipSlotIndex + 0x1a)
801428f4: 00000000 nop
801428f8: 10520088 beq r2,r18,0x80142b1c            #                   if (equipSlotItemID == conditionalValue2) return 1;
801428fc: 24840001 addiu r4,r4,0x0001               #                   equipSlotIndex = equipSlotIndex + 1
80142900: 28820007 slti r2,r4,0x0007
80142904: 1440fffa bne r2,r0,0x801428f0             
80142908: 00a41021 addu r2,r5,r4                    
                                                    #               } while (equipSlotIndex < 7);
                                                    #           }
8014290c: 26100001 addiu r16,r16,0x0001             #           unitID = unitID + 1
80142910: 2a020004 slti r2,r16,0x0004
80142914: 1440ffef bne r2,r0,0x801428d4
80142918: 3402000e ori r2,r0,0x000e
                                                    #       } while (unitID < 4);
8014291c: 16220006 bne r17,r2,0x80142938            #   } else if (conditionalValue1 == 0x0e) {                 // 0x0e = AreWarFundsGreaterThanOrEqualToValue(UselessParam, Value)
80142920: 3402000f ori r2,r0,0x000f
80142924: 0c04ed64 jal 0x8013b590                   #       warFunds = Get Script Variable (0x2c);
80142928: 3404002c ori r4,r0,0x002c
8014292c: 0053102a slt r2,r2,r19                    
80142930: 1040007a beq r2,r0,0x80142b1c             #       if (warFunds >= conditionalValue3) return 1;
80142934: 3402000f ori r2,r0,0x000f
80142938: 16220006 bne r17,r2,0x80142954            #   } else if (conditionalValue1 == 0x0f) {                 // 0x0f = AreWarFundsLessThanOrEqualToValue(UselessParam, Value)
8014293c: 34020010 ori r2,r0,0x0010
80142940: 0c04ed64 jal 0x8013b590                   #       warFunds = Get Script Variable (0x2c);
80142944: 3404002c ori r4,r0,0x002c
80142948: 0262102a slt r2,r19,r2
8014294c: 10400073 beq r2,r0,0x80142b1c             #       if (conditionalValue3 >= warFunds) return 1;
80142950: 34020010 ori r2,r0,0x0010
80142954: 1622000f bne r17,r2,0x80142994            #   } else if (conditionalValue1 == 0x10) {                 // 0x10 = IsDateGreaterThanOrEqual(Month, Day, UselessParam)
80142958: 34020011 ori r2,r0,0x0011
8014295c: 0c04ed64 jal 0x8013b590                   #       month = Get Script Variable (0x2e);
80142960: 3404002e ori r4,r0,0x002e
80142964: 0052102a slt r2,r2,r18
80142968: 14400071 bne r2,r0,0x80142b30             #       if (month < conditionalValue2)
8014296c: 34020001 ori r2,r0,0x0001                 #           return 1;
80142970: 0c04ed64 jal 0x8013b590                   #       month = Get Script Variable (0x2e);
80142974: 3404002e ori r4,r0,0x002e
80142978: 14520006 bne r2,r18,0x80142994            #       if (month == conditionalValue2) {
8014297c: 34020011 ori r2,r0,0x0011
80142980: 0c04ed64 jal 0x8013b590                   #           day = Get Script Variable (0x2f);           
80142984: 3404002f ori r4,r0,0x002f
80142988: 0262102a slt r2,r19,r2
8014298c: 10400063 beq r2,r0,0x80142b1c             #           if (conditionalValue3 >= day) return 1;
80142990: 34020011 ori r2,r0,0x0011
                                                    #       }
80142994: 1622000f bne r17,r2,0x801429d4            #   } else if (conditionalValue1 == 0x11) {                 // 0x11 = IsDateLessThanOrEqual(Month, Day, UselessParam)
80142998: 34020012 ori r2,r0,0x0012
8014299c: 0c04ed64 jal 0x8013b590                   #       month = Get Script Variable (0x2e);
801429a0: 3404002e ori r4,r0,0x002e
801429a4: 0242102a slt r2,r18,r2                     
801429a8: 14400061 bne r2,r0,0x80142b30             #       if (conditionalValue2 < month)
801429ac: 34020001 ori r2,r0,0x0001                 #           return 1;
801429b0: 0c04ed64 jal 0x8013b590                   #       month = Get Script Variable (0x2e);
801429b4: 3404002e ori r4,r0,0x002e
801429b8: 14520006 bne r2,r18,0x801429d4            #       if (month == conditionalValue2) {
801429bc: 34020012 ori r2,r0,0x0012
801429c0: 0c04ed64 jal 0x8013b590                   #           day = Get Script Variable (0x2f);       
801429c4: 3404002f ori r4,r0,0x002f
801429c8: 0053102a slt r2,r2,r19
801429cc: 10400053 beq r2,r0,0x80142b1c             #           if (day >= conditionalValue3) return 1;
801429d0: 34020012 ori r2,r0,0x0012
                                                    #       }
801429d4: 16220006 bne r17,r2,0x801429f0            #   } else if (conditionalValue1 == 0x12) {                 // 0x12 = AreCasualtiesGreaterThanOrEqualToValue(Value, UselessParam)
801429d8: 34020013 ori r2,r0,0x0013
801429dc: 0c04ed64 jal 0x8013b590
801429e0: 34040062 ori r4,r0,0x0062                 #       casualties = Get Script Variable (0x62);
801429e4: 0052102a slt r2,r2,r18
801429e8: 1040004c beq r2,r0,0x80142b1c             #       if (casualties <= scriptVarValue) return 1;
801429ec: 34020013 ori r2,r0,0x0013
801429f0: 16220006 bne r17,r2,0x80142a0c            #   } else if (conditionalValue1 == 0x13) {                 // 0x13 = AreCasualtiesLessThanOrEqualToValue(Value, UselessParam)
801429f4: 34020016 ori r2,r0,0x0016
801429f8: 0c04ed64 jal 0x8013b590                   #       casualties = Get Script Variable (0x62);
801429fc: 34040062 ori r4,r0,0x0062
80142a00: 0242102a slt r2,r18,r2
80142a04: 10400045 beq r2,r0,0x80142b1c             #       if (casualties >= scriptVarValue) return 1;
80142a08: 34020016 ori r2,r0,0x0016
80142a0c: 16220005 bne r17,r2,0x80142a24            #   } else if (conditionalValue1 == 0x16) {                 // 0x16 = AreAllEnemiesDefeated()
80142a10: 34020018 ori r2,r0,0x0018
80142a14: 0c060cdd jal 0x80183374                   #       resultCode = Check Battle Outcome ();
80142a18: 00000000 nop
80142a1c: 1040003f beq r2,r0,0x80142b1c             #       if (resultCode == 0) return 1;
80142a20: 34020018 ori r2,r0,0x0018
80142a24: 16220014 bne r17,r2,0x80142a78            #   } else if (conditionalValue1 == 0x18) {                 // 0x18 = IsUnitAtLocation(UnitID, X, Y, UpperLevel)
80142a28: 34020025 ori r2,r0,0x0025
80142a2c: 0c050942 jal 0x80142508                   #       battleUnit = Get Battle Unit By Unit ID (conditionalValue2);
80142a30: 02402021 addu r4,r18,r0
80142a34: 00402821 addu r5,r2,r0                    #       battleUnit
80142a38: 2402ffff addiu r2,r0,-0x0001
80142a3c: 10a2000e beq r5,r2,0x80142a78             #       if ((battleUnit != -1)
80142a40: 34020025 ori r2,r0,0x0025                 
80142a44: 90a20047 lbu r2,0x0047(r5)                
80142a48: 00000000 nop
80142a4c: 1453000a bne r2,r19,0x80142a78            #           and (battleUnit.XCoordinate == conditionalValue3)
80142a50: 34020025 ori r2,r0,0x0025                 
80142a54: 90a20048 lbu r2,0x0048(r5)                
80142a58: 00000000 nop
80142a5c: 14550006 bne r2,r21,0x80142a78            #           and (battleUnit.YCoordinate == conditionalValue4)
80142a60: 34020025 ori r2,r0,0x0025
80142a64: 94a20048 lhu r2,0x0048(r5)
80142a68: 00000000 nop
80142a6c: 000213c2 srl r2,r2,0x0f                   
80142a70: 1056002a beq r2,r22,0x80142b1c            #           and (battleUnit.UpperLevel == conditionalValue5)) return 1;
80142a74: 34020025 ori r2,r0,0x0025
80142a78: 16220024 bne r17,r2,0x80142b0c            #   } else if (conditionalValue1 == 0x25) {                 // 0x25 = IsAnyTeamUnitAtLocation(TeamID, X, Y, UpperLevel)
80142a7c: 34020019 ori r2,r0,0x0019
80142a80: 00008021 addu r16,r0,r0                   #       unitIndex = 0
80142a84: 2414ffff addiu r20,r0,-0x0001             #       -1
                                                    #       for (unitIndex = 0; unitIndex < 21; unitIndex++) {
80142a88: 0c0232ed jal 0x8008cbb4                   #           doesUnitExist = 0x8cbb4(unitIndex);
80142a8c: 02002021 addu r4,r16,r0
80142a90: 1040001a beq r2,r0,0x80142afc             #           if (!doesUnitExist) continue;
80142a94: 00000000 nop
80142a98: 0c023374 jal 0x8008cdd0                   #           result_0x8cdd0 = 0x8cdd0(unitIndex);
80142a9c: 02002021 addu r4,r16,r0
80142aa0: 00402021 addu r4,r2,r0                    #           result_0x8cdd0
80142aa4: 10940015 beq r4,r20,0x80142afc            #           if (result_0x8cdd0 == -1) continue;
80142aa8: 00000000 nop
80142aac: 0c0602bf jal 0x80180afc                   #           battleUnit = Get Unit's Data Pointer (result_0x8cdd0);
80142ab0: 00000000 nop
80142ab4: 00402821 addu r5,r2,r0                    #           battleUnit
80142ab8: 90a20047 lbu r2,0x0047(r5)                #           battleUnit.XCoordinate
80142abc: 00000000 nop
80142ac0: 1453000e bne r2,r19,0x80142afc            #           if (battleUnit.XCoordinate != conditionalValue3) continue;
80142ac4: 00000000 nop
80142ac8: 90a20048 lbu r2,0x0048(r5)                #           battleUnit.YCoordinate
80142acc: 00000000 nop
80142ad0: 1455000a bne r2,r21,0x80142afc            #           if (battleUnit.YCoordinate != conditionalValue4) continue;
80142ad4: 00000000 nop
80142ad8: 94a20048 lhu r2,0x0048(r5)
80142adc: 00000000 nop
80142ae0: 000213c2 srl r2,r2,0x0f                   #           battleUnit.UpperLevel
80142ae4: 14560005 bne r2,r22,0x80142afc            #           if (battleUnit.UpperLevel != conditionalValue5) continue;
80142ae8: 00000000 nop
80142aec: 90a20004 lbu r2,0x0004(r5)                #           battleUnit.TeamID
80142af0: 00000000 nop
80142af4: 1052000e beq r2,r18,0x80142b30            #           if (battleUnit.TeamID == conditionalValue2)
80142af8: 34020001 ori r2,r0,0x0001                 #               return 1;
80142afc: 26100001 addiu r16,r16,0x0001             
80142b00: 2a020015 slti r2,r16,0x0015
80142b04: 1440ffe0 bne r2,r0,0x80142a88
80142b08: 34020019 ori r2,r0,0x0019
                                                    #       }
                                                    #   }
80142b0c: 12220005 beq r17,r2,0x80142b24            #   if (conditionalValue1 != 0x19) {                            // 0x19 = RunScenario(ScenarioID)
80142b10: 34040027 ori r4,r0,0x0027
                                                    
80142b14: 08050acc j 0x80142b30
80142b18: 00001021 addu r2,r0,r0                    #       return 0;
                                                    #   }
80142b1c: 08050acc j 0x80142b30
80142b20: 34020001 ori r2,r0,0x0001
                                                    #   else {
80142b24: 0c04ed91 jal 0x8013b644                   #       Set Script Variable (0x27, conditionalValue2);      // Variable 0x27 = Current Event
80142b28: 02402821 addu r5,r18,r0
80142b2c: 34020002 ori r2,r0,0x0002                 #       return 2;
                                                    #   }
80142b30: 8fbf002c lw r31,0x002c(r29)
80142b34: 8fb60028 lw r22,0x0028(r29)
80142b38: 8fb50024 lw r21,0x0024(r29)
80142b3c: 8fb40020 lw r20,0x0020(r29)
80142b40: 8fb3001c lw r19,0x001c(r29)
80142b44: 8fb20018 lw r18,0x0018(r29)
80142b48: 8fb10014 lw r17,0x0014(r29)
80142b4c: 8fb00010 lw r16,0x0010(r29)
80142b50: 27bd0030 addiu r29,r29,0x0030
80142b54: 03e00008 jr r31
80142b58: 00000000 nop