Potion Dose Mixing

0 comments

This works great.

I'm not specifying how to add it, figure it out it's extremely easy.

Credits - Yarnova


Code: [Select]
        public static final int potions[][] = {
                {229, 125, 123, 121, 2428}, {229, 6691, 6689, 6687, 6685},
                {229, 179, 177, 175, 2446}, {229, 119, 117, 115, 113},
                {229, 131, 129, 127, 2430}, {229, 137, 135, 133, 2432},
                {229, 143, 141, 139, 2434}, {229, 149, 147, 145, 2436},
                {229, 161, 159, 157, 2440}, {229, 3030, 3028, 3026, 3024},
                {229, 167, 165, 163, 2442}
        };


Code: [Select]
                        potionLoop: for (int i2 = 0; i2 < potions.length; i2++) {
                                for (int i3 = 1; i3 < potions[i2].length; i3++) {
                                        if (itemUsed == potions[i2][i3]) {
                                                for (int i4 = 1; i4 < potions[i2].length; i4++) {
                                                        if (useWith == potions[i2][i4]) {
                                                                int newDosage1 = 0;
                                                                int newDosage2 = i3 + i4;
                                                                if (newDosage2 >= potions[i2].length) {
                                                                        newDosage1 = (newDosage2)
                                                                        - (potions[i2].length - 1);
                                                                        newDosage2 = potions[i2].length - 1;
                                                                }
                                                                playerItems[itemUsedSlot] = potions[i2][newDosage1] + 1;
                                                                playerItems[usedWithSlot] = potions[i2][newDosage2] + 1;
                                                                resetItems(3214);
                                                                break potionLoop;
                                                        }
                                                }
                                                break potionLoop;
                                        }
                                }
                        }



Enjoy, this is better then a million lines of if-statements.

comments (0)

Post a Comment