Handle War Trophies and Bonus Money
Jump to navigation
Jump to search
801c7170: 27bdffc0 addiu r29,r29,-0x0040 801c7174: afb00028 sw r16,0x0028(r29) 801c7178: 3c10801e lui r16,0x801e 801c717c: 26108704 addiu r16,r16,-0x78fc # 0x801d8704 801c7180: afbf0038 sw r31,0x0038(r29) 801c7184: afb30034 sw r19,0x0034(r29) 801c7188: afb20030 sw r18,0x0030(r29) 801c718c: afb1002c sw r17,0x002c(r29) 801c7190: 3c01801e lui r1,0x801e 801c7194: ac2087a8 sw r0,-0x7858(r1) # *0x801d87a8 = 0 801c7198: 0c060380 jal 0x80180e00 # Find War Trophies and Bonus Money (0x801d8704); 801c719c: 02002021 addu r4,r16,r0 801c71a0: 3c06801e lui r6,0x801e 801c71a4: 24c68768 addiu r6,r6,-0x7898 # 0x801d8768 801c71a8: 3c05801e lui r5,0x801e 801c71ac: 8ca587a8 lw r5,-0x7858(r5) # *0x801d87a8 801c71b0: 3c02801e lui r2,0x801e 801c71b4: 8c42871c lw r2,-0x78e4(r2) # *0x801d871c 801c71b8: 00052080 sll r4,r5,0x02 # *0x801d87a8 * 4 801c71bc: 00861821 addu r3,r4,r6 # (*0x801d87a8 * 4) + 0x801d8768 801c71c0: ac620000 sw r2,0x0000(r3) # *((*0x801d87a8 * 4) + 0x801d8768) = *0x801d871c 801c71c4: 34020001 ori r2,r0,0x0001 # 1 801c71c8: 3c01801e lui r1,0x801e 801c71cc: 00240821 addu r1,r1,r4 801c71d0: ac228728 sw r2,-0x78d8(r1) # *(0x801d8728 + (*0x801d87a8 * 4)) = 1 801c71d4: 8c620000 lw r2,0x0000(r3) # *((*0x801d87a8 * 4) + 0x801d8768) 801c71d8: 3c03801e lui r3,0x801e 801c71dc: 24638728 addiu r3,r3,-0x78d8 # 0x801d8728 801c71e0: 10400004 beq r2,r0,0x801c71f4 801c71e4: 00008821 addu r17,r0,r0 # count = 0 # if (*((*0x801d87a8 * 4) + 0x801d8768) != 0) { 801c71e8: 24a20001 addiu r2,r5,0x0001 # *0x801d87a8 + 1 801c71ec: 3c01801e lui r1,0x801e 801c71f0: ac2287a8 sw r2,-0x7858(r1) # *0x801d87a8 = *0x801d87a8 + 1 # } 801c71f4: 3c02801e lui r2,0x801e 801c71f8: 90428719 lbu r2,-0x78e7(r2) # *0x801d8719 801c71fc: 00000000 nop 801c7200: 18400016 blez r2,0x801c725c # if (*0x801d8719 > 0) { 801c7204: 00000000 nop 801c7208: 00c04021 addu r8,r6,r0 # 0x801d8768 801c720c: 00603821 addu r7,r3,r0 # 0x801d8728 801c7210: 26060015 addiu r6,r16,0x0015 # 0x801d8719 # do { 801c7214: 3c04801e lui r4,0x801e 801c7218: 8c8487a8 lw r4,-0x7858(r4) # *0x801d87a8 801c721c: 3c01801e lui r1,0x801e 801c7220: 00310821 addu r1,r1,r17 801c7224: 90258704 lbu r5,-0x78fc(r1) # value = *(0x801d8704 + count) 801c7228: 26310001 addiu r17,r17,0x0001 # count = count + 1 801c722c: 00041880 sll r3,r4,0x02 # *0x801d87a8 * 4 801c7230: 00681021 addu r2,r3,r8 # (*0x801d87a8 * 4) + 0x801d8768 801c7234: 00671821 addu r3,r3,r7 # (*0x801d87a8 * 4) + 0x801d8728 801c7238: ac450000 sw r5,0x0000(r2) # *((*0x801d87a8 * 4) + 0x801d8768) = value 801c723c: ac600000 sw r0,0x0000(r3) # *((*0x801d87a8 * 4) + 0x801d8728) = 0 801c7240: 90c20000 lbu r2,0x0000(r6) # *0x801d8719 801c7244: 24840001 addiu r4,r4,0x0001 # *0x801d87a8 + 1 801c7248: 3c01801e lui r1,0x801e 801c724c: ac2487a8 sw r4,-0x7858(r1) # *0x801d87a8 = *0x801d87a8 + 1 801c7250: 0222102a slt r2,r17,r2 801c7254: 1440ffef bne r2,r0,0x801c7214 801c7258: 00000000 nop # } while (count < *0x801d8719); # } 801c725c: 3c02801e lui r2,0x801e 801c7260: 8c4287a8 lw r2,-0x7858(r2) # *0x801d87a8 801c7264: 00000000 nop 801c7268: 18400034 blez r2,0x801c733c 801c726c: 00008821 addu r17,r0,r0 # count = 0 # if (*0x801d87a8 > 0) { 801c7270: 3c12801e lui r18,0x801e 801c7274: 26528768 addiu r18,r18,-0x7898 # itemPtr = 0x801d8768 801c7278: 3c13801e lui r19,0x801e 801c727c: 26738728 addiu r19,r19,-0x78d8 # r19 = 0x801d8728 # do { 801c7280: 8e620000 lw r2,0x0000(r19) # *r19 801c7284: 00000000 nop 801c7288: 1440001e bne r2,r0,0x801c7304 # if (*r19 == 0) { 801c728c: 00000000 nop 801c7290: 92440000 lbu r4,0x0000(r18) # itemID = *itemPtr 801c7294: 0c0178a2 jal 0x8005e288 # quantity = Get Total Equipment Quantity (itemID, 1); 801c7298: 34050001 ori r5,r0,0x0001 801c729c: 34030063 ori r3,r0,0x0063 801c72a0: 1443000f bne r2,r3,0x801c72e0 # if (quantity == 99) { 801c72a4: 00000000 nop 801c72a8: 8e440000 lw r4,0x0000(r18) # itemID = *itemPtr 801c72ac: 0c016a21 jal 0x8005a884 # item = Get Item Data Pointer (itemID); 801c72b0: 00000000 nop 801c72b4: 94500008 lhu r16,0x0008(r2) # item.Price 801c72b8: 00000000 nop 801c72bc: 06010002 bgez r16,0x801c72c8 801c72c0: 02001021 addu r2,r16,r0 801c72c4: 26020003 addiu r2,r16,0x0003 801c72c8: 00028083 sra r16,r2,0x02 # item.Price / 4 801c72cc: 0c04ed64 jal 0x8013b590 801c72d0: 3404002c ori r4,r0,0x002c # warFunds = Get Script Variable (VARIABLE_WAR_FUNDS); 801c72d4: 3404002c ori r4,r0,0x002c 801c72d8: 08071cc6 j 0x801c7318 # Set Script Variable (VARIABLE_WAR_FUNDS, warFunds + (item.Price / 4)); 801c72dc: 00502821 addu r5,r2,r16 # } else { 801c72e0: 8e430000 lw r3,0x0000(r18) # itemID = *itemPtr 801c72e4: 3c028006 lui r2,0x8006 801c72e8: 244296e0 addiu r2,r2,-0x6920 # availableItemQuantities 801c72ec: 00621821 addu r3,r3,r2 801c72f0: 90620000 lbu r2,0x0000(r3) # availableItemQuantities[itemID] 801c72f4: 00000000 nop 801c72f8: 24420001 addiu r2,r2,0x0001 # availableItemQuantities[itemID] + 1 801c72fc: 08071cc8 j 0x801c7320 801c7300: a0620000 sb r2,0x0000(r3) # availableItemQuantities[itemID] = availableItemQuantities[itemID] + 1 # } # } else { 801c7304: 0c04ed64 jal 0x8013b590 801c7308: 3404002c ori r4,r0,0x002c # warFunds = Get Script Variable (VARIABLE_WAR_FUNDS); 801c730c: 8e450000 lw r5,0x0000(r18) # *itemPtr 801c7310: 3404002c ori r4,r0,0x002c 801c7314: 00452821 addu r5,r2,r5 801c7318: 0c04ed91 jal 0x8013b644 # Set Script Variable (VARIABLE_WAR_FUNDS, warFunds + *itemPtr); 801c731c: 00000000 nop # } 801c7320: 26520004 addiu r18,r18,0x0004 # itemPtr = itemPtr + 4 801c7324: 3c02801e lui r2,0x801e 801c7328: 8c4287a8 lw r2,-0x7858(r2) # *0x801d87a8 801c732c: 26310001 addiu r17,r17,0x0001 # count = count + 1 801c7330: 0222102a slt r2,r17,r2 801c7334: 1440ffd2 bne r2,r0,0x801c7280 801c7338: 26730004 addiu r19,r19,0x0004 # r19 = r19 + 4 # } while (count < *0x801d87a8); # } 801c733c: 8fbf0038 lw r31,0x0038(r29) 801c7340: 8fb30034 lw r19,0x0034(r29) 801c7344: 8fb20030 lw r18,0x0030(r29) 801c7348: 8fb1002c lw r17,0x002c(r29) 801c734c: 8fb00028 lw r16,0x0028(r29) 801c7350: 27bd0040 addiu r29,r29,0x0040 801c7354: 03e00008 jr r31 801c7358: 00000000 nop