Rebase magic teleports, fix superheat (#92)

* rebase teleport spells

* fix superheat rune requirements

* fixup ardougne laws required
This commit is contained in:
Danial authored and Daniel Ginovker committed 2019-10-24 14:42:02 -04:00
1 parent 14f162347e
commit 8de8b619a0
4 files changed
+56 -162

No files matched your search

@@ -6,7 +6,7 @@ public class CastRequirements {
public static boolean hasRunes(Client c, int[] runes, int[] amount) {
for (int i = 0; i < runes.length; i++) {
if (c.getItemAssistant().playerHasItem(runes[i], amount[i])) {
if (c.getItemAssistant().playerHasItem(runes[i], amount[i]) || MagicRequirements.wearingStaff(c, runes[i])) {
return true;
}
}
@@ -16,25 +16,19 @@ public class CastRequirements {
}
public static boolean hasRunes(Client c, int[][] runes) {
int hasRunes = 0;
for (int[] rune : runes) {
if (c.getItemAssistant().playerHasItem(rune[0], rune[1])) {
hasRunes++;
// if player doesn't have the required amount of runes or a staff for that rune
if (!c.getItemAssistant().playerHasItem(rune[0], rune[1]) && !MagicRequirements.wearingStaff(c, rune[0])) {
return false;
}
}
if (hasRunes == runes.length) {
deleteRunes(c, runes);
return true;
}
c.getActionSender().sendMessage(
"You don't have the required runes to cast this spell.");
return false;
return true;
}
public static void deleteRunes(Client c, int[][] runes) {
for (int[] rune : runes) {
if (!MagicRequirements.wearingStaff(c, rune[0])) {
c.getItemAssistant().deleteItem(rune[0], rune[1]);
c.getItemAssistant().deleteItem2(rune[0], rune[1]);
}
}
}
@@ -50,18 +44,18 @@ public class CastRequirements {
return c.playerLevel[6] >= i;
}
public static final int FIRE = 554;
public static final int WATER = 555;
public static final int AIR = 556;
public static final int EARTH = 557;
public static final int MIND = 558;
public static final int BODY = 559;
public static final int DEATH = 560;
public static final int NATURE = 561;
public static final int CHAOS = 562;
public static final int LAW = 563;
public static final int COSMIC = 564;
public static final int BLOOD = 565;
public static final int SOUL = 566;
public static final int ASTRAL = 9075;
public static final int FIRE = 554,
WATER = 555,
AIR = 556,
EARTH = 557,
MIND = 558,
BODY = 559,
DEATH = 560,
NATURE = 561,
CHAOS = 562,
LAW = 563,
COSMIC = 564,
BLOOD = 565,
SOUL = 566,
ASTRAL = 9075;
}