mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Misc changes (#129)
* fixup "cantattack" command * remove duplicate code * fix brimhaven vines * fixup cluescroll drops * add clicktotele alias * check player has an axe * remove duplicate item id
This commit is contained in:
@@ -175,7 +175,7 @@ public class Woodcutting {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasAxe(Client player) {
|
||||
public static boolean hasAxe(Client player) {
|
||||
for (int i = 0; i < Axe_Settings.length; i++) {
|
||||
if (player.getItemAssistant().playerHasItem(Axe_Settings[i][0]) || player.playerEquipment[player.playerWeapon] == Axe_Settings[i][0]) {
|
||||
return true;
|
||||
|
||||
@@ -88,7 +88,7 @@ public class Item {
|
||||
6062 };
|
||||
public static int rings[] = { 8082, 773, 1635, 1637, 1639, 1641, 1643,
|
||||
1645, 2550, 2552, 2554, 2556, 2558, 2560, 2562, 2564, 2566, 2568,
|
||||
2570, 2572, 4202, 4657, 6465, 6737, 6731, 6735, 6735, 6583, 6733 };
|
||||
2570, 2572, 4202, 4657, 6465, 6737, 6731, 6735, 6583, 6733 };
|
||||
public static int body[] = { 7608, 2520, 430, 7362, 7364, 636, 638, 640,
|
||||
642, 644, 8064, 426, 430, 1005, 1757, 7592, 8031, 8027, 6617, 8019,
|
||||
8014, 8002, 7376, 544, 7372, 7370, 577, 7974, 7970, 7965, 7961,
|
||||
|
||||
@@ -935,7 +935,7 @@ public class NpcHandler {
|
||||
break;
|
||||
}
|
||||
if (Misc.random(1, 256) == 1) {
|
||||
int level = npcs[i].combatLevel;
|
||||
int level = getNpcListCombat(npcs[i].npcType);
|
||||
if (level >= 2 && level <= 24) // easy
|
||||
Server.itemHandler.createGroundItem(c, 2677, npcs[i].absX, npcs[i].absY, 1, c.playerId);
|
||||
else if (level <= 40) // easy → medium
|
||||
@@ -944,8 +944,8 @@ public class NpcHandler {
|
||||
Server.itemHandler.createGroundItem(c, 2678, npcs[i].absX, npcs[i].absY, 1, c.playerId);
|
||||
else if (level <= 150) // medium → hard
|
||||
Server.itemHandler.createGroundItem(c, 2678 + Misc.random(0, 1), npcs[i].absX, npcs[i].absY, 1, c.playerId);
|
||||
else // hard
|
||||
Server.itemHandler.createGroundItem(c, 2678 + Misc.random(0, 1), npcs[i].absX, npcs[i].absY, 1, c.playerId);
|
||||
else if (level > 150)// hard
|
||||
Server.itemHandler.createGroundItem(c, 2679, npcs[i].absX, npcs[i].absY, 1, c.playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1387,16 +1387,10 @@ public class NpcHandler {
|
||||
token = token.trim();
|
||||
token2 = line.substring(spot + 1);
|
||||
token2 = token2.trim();
|
||||
token2_2 = token2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2.replaceAll("\t+", "\t");
|
||||
token3 = token2_2.split("\t");
|
||||
if (token.equals("npc")) {
|
||||
newNPCList(Integer.parseInt(token3[0]), token3[1],
|
||||
Integer.parseInt(token3[2]),
|
||||
Integer.parseInt(token3[3]));
|
||||
newNPCList(Integer.parseInt(token3[0]), token3[1], Integer.parseInt(token3[2]), Integer.parseInt(token3[3]));
|
||||
}
|
||||
} else {
|
||||
if (line.equals("[ENDOFNPCLIST]")) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package redone.game.objects.impl;
|
||||
|
||||
import redone.game.content.skills.core.Woodcutting;
|
||||
import redone.game.players.Client;
|
||||
|
||||
/**
|
||||
@@ -8,6 +9,11 @@ import redone.game.players.Client;
|
||||
public class BrimhavenVines {
|
||||
|
||||
public static void handleBrimhavenVines(Client c, int objectType) {
|
||||
if (!Woodcutting.hasAxe(c)) {
|
||||
c.getActionSender().sendMessage("You will need an axe to chop through these!");
|
||||
return;
|
||||
}
|
||||
c.getActionSender().sendMessage("You chop your way through the vines.");
|
||||
switch (objectType) {
|
||||
case 12987:
|
||||
case 12986:
|
||||
@@ -31,21 +37,23 @@ public class BrimhavenVines {
|
||||
}
|
||||
}
|
||||
|
||||
public static void moveThroughVinesX(Client c, int originX, int x1, int y1,
|
||||
int x2, int y2) {
|
||||
public static void moveThroughVinesX(Client c, int originX, int x1, int y1, int x2, int y2) {
|
||||
int x = c.getX();
|
||||
int y = c.getY();
|
||||
if (c.absX <= originX) {
|
||||
c.getPlayerAssistant().walkTo(x1, y1);
|
||||
c.getPlayerAssistant().movePlayer(x + x1, y + y1, 0);
|
||||
} else {
|
||||
c.getPlayerAssistant().walkTo(x2, y2);
|
||||
c.getPlayerAssistant().movePlayer(x + x2, y + y2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public static void moveThroughVinesY(Client c, int originY, int x1, int y1,
|
||||
int x2, int y2) {
|
||||
public static void moveThroughVinesY(Client c, int originY, int x1, int y1, int x2, int y2) {
|
||||
int x = c.getX();
|
||||
int y = c.getY();
|
||||
if (c.absY <= originY) {
|
||||
c.getPlayerAssistant().walkTo(x1, y1);
|
||||
c.getPlayerAssistant().movePlayer(x + x1, y + y1, 0);
|
||||
} else {
|
||||
c.getPlayerAssistant().walkTo(x2, y2);
|
||||
c.getPlayerAssistant().movePlayer(x + x2, y + y2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -522,6 +522,7 @@ public class Commands implements PacketType {
|
||||
public static void developerCommands(Client player, String playerCommand, String[] arguments) {
|
||||
switch (playerCommand.toLowerCase()) {
|
||||
case "clicktotele":
|
||||
case "ctt": // alias
|
||||
player.clickToTele = !player.clickToTele;
|
||||
player.getActionSender().sendMessage("Click to teleport: " + (player.clickToTele ? "Enabled" : "Disabled"));
|
||||
break;
|
||||
@@ -627,7 +628,7 @@ public class Commands implements PacketType {
|
||||
}
|
||||
} catch (Exception ಠ_ಠ) {}
|
||||
break;
|
||||
case "cantAttack":
|
||||
case "cantattack":
|
||||
player.npcCanAttack = !player.npcCanAttack;
|
||||
player.getActionSender().sendMessage("Npcs " + (player.npcCanAttack ? "can" : "can no longer") + " attack you.");
|
||||
break;
|
||||
|
||||
@@ -305,9 +305,7 @@ public int itemAmount(String name, int itemId, int itemX, int itemY) {
|
||||
|
||||
public ItemList ItemList[] = new ItemList[Constants.ITEM_LIMIT];
|
||||
|
||||
public void newItemList(int ItemId, String ItemName,
|
||||
String ItemDescription, double ShopValue, double LowAlch,
|
||||
double HighAlch, int Bonuses[]) {
|
||||
public void newItemList(int ItemId, String ItemName, String ItemDescription, double ShopValue, double LowAlch, double HighAlch, int Bonuses[]) {
|
||||
// first, search for a free slot
|
||||
int slot = -1;
|
||||
for (int i = 0; i < 11740; i++) {
|
||||
@@ -386,11 +384,7 @@ public int itemAmount(String name, int itemId, int itemX, int itemY) {
|
||||
token = token.trim();
|
||||
token2 = line.substring(spot + 1);
|
||||
token2 = token2.trim();
|
||||
token2_2 = token2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2_2.replaceAll("\t\t", "\t");
|
||||
token2_2 = token2.replaceAll("\t+", "\t");
|
||||
token3 = token2_2.split("\t");
|
||||
if (token.equals("item")) {
|
||||
int[] Bonuses = new int[12];
|
||||
@@ -412,8 +406,7 @@ public int itemAmount(String name, int itemId, int itemX, int itemY) {
|
||||
if (line.equals("[ENDOFITEMLIST]")) {
|
||||
try {
|
||||
characterfile.close();
|
||||
} catch (IOException ioexception) {
|
||||
}
|
||||
} catch (IOException ಠ_ಠ) {}
|
||||
//return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user