mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
A few things (#401)
- Can't attack players or npcs through doors/walls anymore - Cleaned up a few small bits of code - Added a few new boundaries to the boundary system - Removed dialogue asking are you sure you want to empty your inventory for admins
This commit is contained in:
@@ -6,7 +6,7 @@ public class GameConstants {
|
||||
|
||||
public final static String SERVER_NAME = "2006rebotted", SERVER_VERSION = "Server Stage v " + GameConstants.TEST_VERSION + ".";
|
||||
|
||||
public final static double TEST_VERSION = 2.2;
|
||||
public final static double TEST_VERSION = 2.3;
|
||||
|
||||
public final static int ITEM_LIMIT = 15000, MAXITEM_AMOUNT = Integer.MAX_VALUE, CLIENT_VERSION = 999999,
|
||||
WORLD = 1, IPS_ALLOWED = 250, CONNECTION_DELAY = 100,
|
||||
|
||||
@@ -46,7 +46,7 @@ import com.rebotted.world.GlobalDropsHandler;
|
||||
import com.rebotted.world.ItemHandler;
|
||||
import com.rebotted.world.ObjectHandler;
|
||||
import com.rebotted.world.ObjectManager;
|
||||
import com.rebotted.world.clip.ObjectDef;
|
||||
import com.rebotted.world.clip.ObjectDefinition;
|
||||
import com.rebotted.world.clip.Region;
|
||||
|
||||
/**
|
||||
@@ -188,7 +188,7 @@ public class GameEngine {
|
||||
/**
|
||||
* Initialise Handlers
|
||||
*/
|
||||
ObjectDef.loadConfig();
|
||||
ObjectDefinition.loadConfig();
|
||||
Region.load();
|
||||
Doors.getSingleton().load();
|
||||
DoubleDoors.getSingleton().load();
|
||||
|
||||
+3
-40
@@ -400,8 +400,7 @@ public class CombatAssistant {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean projectile = player.usingBow || player.usingMagic || player.usingRangeWeapon;
|
||||
if (projectile && !PathFinder.isProjectilePathClear(player.getX(), player.getY(), player.heightLevel, NpcHandler.npcs[i].absX, NpcHandler.npcs[i].absY)) {
|
||||
if (!PathFinder.isProjectilePathClear(player.getX(), player.getY(), player.heightLevel, NpcHandler.npcs[i].absX, NpcHandler.npcs[i].absY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -460,8 +459,6 @@ public class CombatAssistant {
|
||||
}
|
||||
|
||||
public void attackNpc(int i) {
|
||||
// int equippedWeapon = c.playerEquipment[c.playerWeapon];
|
||||
// final int npcId = NPCHandler.npcs[i].npcType;
|
||||
if (NpcHandler.npcs[i] != null) {
|
||||
Npc npc = NpcHandler.npcs[i];
|
||||
if (NpcHandler.npcs[i].isDead || NpcHandler.npcs[i].MaxHP <= 0) {
|
||||
@@ -470,22 +467,6 @@ public class CombatAssistant {
|
||||
player.npcIndex = 0;
|
||||
return;
|
||||
}
|
||||
/*if (c.getY() == 3224 && NpcHandler.npcs[i].absY == 3225) {
|
||||
resetPlayerAttack();
|
||||
return;
|
||||
}
|
||||
if (c.getY() == 3226 && NpcHandler.npcs[i].absY == 3227) {
|
||||
resetPlayerAttack();
|
||||
return;
|
||||
}
|
||||
if (c.getY() == 3228 && NpcHandler.npcs[i].absY == 3227) {
|
||||
resetPlayerAttack();
|
||||
return;
|
||||
}
|
||||
if (c.getX() == 3252 && c.getY() > 3254 && c.getY() < 3272 || c.getY() == 3254 && c.getX() > 3252 && c.getX() < 3265) {
|
||||
resetPlayerAttack();
|
||||
return;
|
||||
}*/
|
||||
if (player.usingMagic && MagicData.MAGIC_SPELLS[player.spellId][0] == 1171) {
|
||||
if (!NpcHandler.isUndead(i)) {
|
||||
player.getPacketSender().sendMessage("This spell only affects skeletons, zombies, ghosts and shades.");
|
||||
@@ -502,22 +483,6 @@ public class CombatAssistant {
|
||||
if (!SlayerRequirements.itemNeededSlayer(player, i) || !player.getSlayer().canAttackNpc(i)) {
|
||||
return;
|
||||
}
|
||||
if (NpcHandler.npcs[i].npcType == 9) {
|
||||
if (player.getX() == 3225 && player.getY() > 3459 && player.getY() < 3465 || player.getX() > 3222 && player.getX() < 3226 && player.getY() > 3456 && player.getY() < 3460
|
||||
|| player.getX() > 3213 && player.getX() < 3223 && player.getY() == 3457 || player.getX() > 3202 && player.getX() < 3212 && player.getY() == 3457
|
||||
|| player.getX() > 3199 && player.getX() < 3203 && player.getY() > 3456 && player.getY() < 3460 || player.getX() == 3200 && player.getY() > 3459 && player.getY() < 3467) {
|
||||
resetPlayerAttack();
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (player.getX() == 3180 && player.getY() > 3433 && player.getY() < 3447) {
|
||||
resetPlayerAttack();
|
||||
return;
|
||||
}
|
||||
if (player.getX() > 2837 && player.getX() < 2840 && player.getY() == 9772) {
|
||||
resetPlayerAttack();
|
||||
return;
|
||||
}
|
||||
if (NpcHandler.npcs[i].npcType == 757 && player.vampSlayer > 2) {
|
||||
if (!player.getItemAssistant().playerHasItem(1549, 1) || !player.getItemAssistant().playerHasItem(2347, 1)) {
|
||||
player.getPacketSender().sendMessage("You need a stake and hammer to attack count draynor.");
|
||||
@@ -598,8 +563,7 @@ public class CombatAssistant {
|
||||
player.getPacketSender().sendSound(SoundList.SHOOT_ARROW, 100, 0);
|
||||
}
|
||||
|
||||
boolean projectile = player.usingBow || player.usingMagic || player.usingRangeWeapon;
|
||||
if (projectile && !PathFinder.isProjectilePathClear(player.getX(), player.getY(), player.heightLevel, npc.getX(), npc.getY())) {
|
||||
if (!PathFinder.isProjectilePathClear(player.getX(), player.getY(), player.heightLevel, npc.getX(), npc.getY())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -896,8 +860,7 @@ public class CombatAssistant {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean projectile = player.usingBow || player.usingMagic || player.usingRangeWeapon;
|
||||
if (projectile && !PathFinder.isProjectilePathClear(player.getX(), player.getY(), player.heightLevel, PlayerHandler.players[i].absX, PlayerHandler.players[i].absY)) {
|
||||
if (!PathFinder.isProjectilePathClear(player.getX(), player.getY(), player.heightLevel, PlayerHandler.players[i].absX, PlayerHandler.players[i].absY)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+1
-2
@@ -30,8 +30,7 @@ public class NpcCombat {
|
||||
NpcHandler.npcs[i].absX, NpcHandler.npcs[i].absY, 15)) {
|
||||
if (NpcHandler.npcs[i].attackType == 2) {
|
||||
if (!c.getPrayer().prayerActive[16]) {
|
||||
if (Misc.random(500) + 200 > Misc.random(c
|
||||
.getCombatAssistant().mageDef())) {
|
||||
if (Misc.random(500) + 200 > Misc.random(c.getCombatAssistant().mageDef())) {
|
||||
int dam = Misc.random(max);
|
||||
c.dealDamage(dam);
|
||||
c.handleHitMask(dam);
|
||||
|
||||
+35
-35
@@ -214,60 +214,60 @@ public class Pickpocket extends SkillHandler {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void attemptPickpocket(final Player c, final int npcId) {
|
||||
if (System.currentTimeMillis() - c.lastThieve < 2000 || c.playerStun) {
|
||||
public static void attemptPickpocket(final Player player, final int npcId) {
|
||||
if (System.currentTimeMillis() - player.lastThieve < 2000 || player.playerStun) {
|
||||
return;
|
||||
}
|
||||
if (c.underAttackBy > 0 || c.underAttackBy2 > 0) {
|
||||
c.getPacketSender().sendMessage("You can't pickpocket while in combat!");
|
||||
if (player.underAttackBy > 0 || player.underAttackBy2 > 0) {
|
||||
player.getPacketSender().sendMessage("You can't pickpocket while in combat!");
|
||||
return;
|
||||
}
|
||||
if (System.currentTimeMillis() - c.logoutDelay < 4000) {
|
||||
if (System.currentTimeMillis() - player.logoutDelay < 4000) {
|
||||
return;
|
||||
}
|
||||
if (!THIEVING) {
|
||||
c.getPacketSender().sendMessage("This skill is currently disabled.");
|
||||
player.getPacketSender().sendMessage("This skill is currently disabled.");
|
||||
return;
|
||||
}
|
||||
for (final npcData n : npcData.values()) {
|
||||
if (npcId == n.getNpc(npcId)) {
|
||||
if (c.playerLevel[c.playerThieving] < n.getLevel()) {
|
||||
c.getDialogueHandler().sendStatement("You need a Thieving level of " + n.getLevel() + " to pickpocket the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + ".");
|
||||
if (player.playerLevel[player.playerThieving] < n.getLevel()) {
|
||||
player.getDialogueHandler().sendStatement("You need a Thieving level of " + n.getLevel() + " to pickpocket the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + ".");
|
||||
return;
|
||||
}
|
||||
c.getPacketSender().sendMessage("You attempt to pick the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + "'s pocket.");
|
||||
c.startAnimation(881);
|
||||
if (Misc.random(c.playerLevel[17] + 5) < Misc.random(n.getLevel())) {
|
||||
RandomEventHandler.addRandom(c);
|
||||
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
|
||||
player.getPacketSender().sendMessage("You attempt to pick the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + "'s pocket.");
|
||||
player.startAnimation(881);
|
||||
if (Misc.random(player.playerLevel[17] + 5) < Misc.random(n.getLevel())) {
|
||||
RandomEventHandler.addRandom(player);
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (c.disconnected) {
|
||||
if (player.disconnected) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
c.playerStun = true;
|
||||
c.setHitDiff(n.getDamage());
|
||||
c.setHitUpdateRequired(true);
|
||||
c.playerLevel[3] -= n.getDamage();
|
||||
c.getPlayerAssistant().refreshSkill(3);
|
||||
c.gfx100(80);
|
||||
c.startAnimation(404);
|
||||
c.getPacketSender().sendSound(SoundList.STUNNED, 100, 0);
|
||||
player.playerStun = true;
|
||||
player.setHitDiff(n.getDamage());
|
||||
player.setHitUpdateRequired(true);
|
||||
player.playerLevel[3] -= n.getDamage();
|
||||
player.getPlayerAssistant().refreshSkill(3);
|
||||
player.gfx100(80);
|
||||
player.startAnimation(404);
|
||||
player.getPacketSender().sendSound(SoundList.STUNNED, 100, 0);
|
||||
for (int i = 0; i < NpcHandler.MAX_NPCS; i++) {
|
||||
if (NpcHandler.npcs[i] != null) {
|
||||
if (NpcHandler.npcs[i].npcType == npcId) {
|
||||
if (c.goodDistance(c.absX, c.absY, NpcHandler.npcs[i].absX, NpcHandler.npcs[i].absY, 1) && c.heightLevel == NpcHandler.npcs[i].heightLevel) {
|
||||
if (player.goodDistance(player.absX, player.absY, NpcHandler.npcs[i].absX, NpcHandler.npcs[i].absY, 1) && player.heightLevel == NpcHandler.npcs[i].heightLevel) {
|
||||
if (!NpcHandler.npcs[i].underAttack) {
|
||||
NpcHandler.npcs[i].forceChat("What do you think you're doing?");
|
||||
NpcHandler.npcs[i].facePlayer(c.playerId);
|
||||
NpcHandler.npcs[i].facePlayer(player.playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
c.lastThieve = System.currentTimeMillis() + 5000;
|
||||
c.getPacketSender().sendMessage("You fail to pick the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + "'s pocket.");
|
||||
player.lastThieve = System.currentTimeMillis() + 5000;
|
||||
player.getPacketSender().sendMessage("You fail to pick the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + "'s pocket.");
|
||||
container.stop();
|
||||
}
|
||||
@Override
|
||||
@@ -275,14 +275,14 @@ public class Pickpocket extends SkillHandler {
|
||||
|
||||
}
|
||||
}, 2);
|
||||
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
if (c.disconnected) {
|
||||
if (player.disconnected) {
|
||||
container.stop();
|
||||
return;
|
||||
}
|
||||
c.playerStun = false;
|
||||
player.playerStun = false;
|
||||
container.stop();
|
||||
}
|
||||
|
||||
@@ -294,14 +294,14 @@ public class Pickpocket extends SkillHandler {
|
||||
} else {
|
||||
String message = "You pick the " + NpcHandler.getNpcListName(n.getNpc(npcId)).toLowerCase() + "'s pocket.";
|
||||
final String message2 = message;
|
||||
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
c.getPacketSender().sendMessage(message2);
|
||||
c.getPlayerAssistant().addSkillXP((int) n.getXp(),
|
||||
c.playerThieving);
|
||||
player.getPacketSender().sendMessage(message2);
|
||||
player.getPlayerAssistant().addSkillXP((int) n.getXp(),
|
||||
player.playerThieving);
|
||||
int[] random = n.getPickPockets()[Misc.random(n.getPickPockets().length - 1)];
|
||||
c.getItemAssistant().addItem(random[0], random[1] + (random.length > 2 ? Misc.random(random[2]) : 0));
|
||||
player.getItemAssistant().addItem(random[0], random[1] + (random.length > 2 ? Misc.random(random[2]) : 0));
|
||||
container.stop();
|
||||
}
|
||||
@Override
|
||||
@@ -310,7 +310,7 @@ public class Pickpocket extends SkillHandler {
|
||||
}
|
||||
}, 2);
|
||||
}
|
||||
c.lastThieve = System.currentTimeMillis();
|
||||
player.lastThieve = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ package com.rebotted.game.globalworldobjects;
|
||||
import com.rebotted.game.objects.Object;
|
||||
import com.rebotted.game.objects.ObjectDefaults;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.world.clip.ObjectDef;
|
||||
import com.rebotted.world.clip.ObjectDefinition;
|
||||
import com.rebotted.world.clip.Region;
|
||||
|
||||
public class ClimbOther {
|
||||
@@ -40,7 +40,7 @@ public class ClimbOther {
|
||||
}
|
||||
|
||||
public static void useOther(Player player, int objectType) {
|
||||
final String objectName = ObjectDef.getObjectDef(objectType).name;
|
||||
final String objectName = ObjectDefinition.getObjectDef(objectType).name;
|
||||
if (System.currentTimeMillis() - player.climbDelay < 1800) {
|
||||
return;
|
||||
}
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import com.rebotted.game.content.music.sound.SoundList;
|
||||
import com.rebotted.game.objects.Objects;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.world.ObjectManager;
|
||||
import com.rebotted.world.clip.ObjectDef;
|
||||
import com.rebotted.world.clip.ObjectDefinition;
|
||||
import com.rebotted.world.clip.Region;
|
||||
|
||||
/**
|
||||
@@ -19,7 +19,7 @@ public class GateHandler {
|
||||
CLOSED = 0, PARTIAL_OPEN = 1, OPEN = 2;
|
||||
|
||||
public boolean isGate(int objectId) {
|
||||
String objectName = ObjectDef.getObjectDef(objectId).name;
|
||||
String objectName = ObjectDefinition.getObjectDef(objectId).name;
|
||||
try {
|
||||
return objectName.equalsIgnoreCase("gate") || objectName.equalsIgnoreCase("Gate");
|
||||
} catch (Exception e) {
|
||||
|
||||
@@ -108,14 +108,11 @@ public class Flowers {
|
||||
private static void moveOneStep(Player c) {
|
||||
if (Region.getClipping(c.getX() - 1, c.getY(), c.heightLevel, -1, 0)) {
|
||||
c.getPlayerAssistant().walkTo(-1, 0);
|
||||
} else if (Region.getClipping(c.getX() + 1, c.getY(), c.heightLevel, 1,
|
||||
0)) {
|
||||
} else if (Region.getClipping(c.getX() + 1, c.getY(), c.heightLevel, 1, 0)) {
|
||||
c.getPlayerAssistant().walkTo(1, 0);
|
||||
} else if (Region.getClipping(c.getX(), c.getY() - 1, c.heightLevel, 0,
|
||||
-1)) {
|
||||
} else if (Region.getClipping(c.getX(), c.getY() - 1, c.heightLevel, 0, -1)) {
|
||||
c.getPlayerAssistant().walkTo(0, -1);
|
||||
} else if (Region.getClipping(c.getX(), c.getY() + 1, c.heightLevel, 0,
|
||||
1)) {
|
||||
} else if (Region.getClipping(c.getX(), c.getY() + 1, c.heightLevel, 0, 1)) {
|
||||
c.getPlayerAssistant().walkTo(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.rebotted.game.objects;
|
||||
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.world.clip.ObjectDef;
|
||||
import com.rebotted.world.clip.ObjectDefinition;
|
||||
|
||||
/**
|
||||
* ObjectDefaults
|
||||
@@ -17,7 +17,7 @@ public class ObjectDefaults {
|
||||
WEST = 3;
|
||||
|
||||
public static int getObjectType(Player player, int objectType) {
|
||||
String objectName = ObjectDef.getObjectDef(objectType).name;
|
||||
String objectName = ObjectDefinition.getObjectDef(objectType).name;
|
||||
if (objectName.contains("Wardrobe") || objectName.contains("chest") || objectName.contains("Cupboard") || objectName.contains("Coffin")) {
|
||||
return 10;
|
||||
} else if (objectName.contains("Curtain")) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.rebotted.game.objects;
|
||||
|
||||
import com.rebotted.world.clip.ObjectDef;
|
||||
import com.rebotted.world.clip.ObjectDefinition;
|
||||
|
||||
public class Objects {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Objects {
|
||||
}
|
||||
|
||||
public int[] getObjectSize() {
|
||||
ObjectDef def = ObjectDef.getObjectDef(objectId);
|
||||
ObjectDefinition def = ObjectDefinition.getObjectDef(objectId);
|
||||
if (def == null) {
|
||||
return new int[] {1, 1};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import com.rebotted.event.CycleEvent;
|
||||
import com.rebotted.event.CycleEventContainer;
|
||||
import com.rebotted.event.CycleEventHandler;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.world.clip.ObjectDef;
|
||||
import com.rebotted.world.clip.ObjectDefinition;
|
||||
|
||||
/**
|
||||
* Levers
|
||||
@@ -22,7 +22,7 @@ public class Levers {
|
||||
};
|
||||
|
||||
public static void pullLever(final Player player, int objectType) {
|
||||
String objectName = ObjectDef.getObjectDef(objectType).name;
|
||||
String objectName = ObjectDefinition.getObjectDef(objectType).name;
|
||||
for (final int[] element : LEVERS) {
|
||||
if (player.objectX == element[0] && player.objectY == element[1] && objectName.equalsIgnoreCase("Lever")) {
|
||||
if (System.currentTimeMillis() - player.leverDelay > 3750) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import com.rebotted.game.content.traveling.DesertHeat;
|
||||
import com.rebotted.game.objects.ObjectDefaults;
|
||||
import com.rebotted.game.players.Player;
|
||||
import com.rebotted.util.Misc;
|
||||
import com.rebotted.world.clip.ObjectDef;
|
||||
import com.rebotted.world.clip.ObjectDefinition;
|
||||
import com.rebotted.world.clip.Region;
|
||||
|
||||
public class OtherObjects {
|
||||
@@ -117,7 +117,7 @@ public class OtherObjects {
|
||||
}
|
||||
|
||||
private static void handleSpecialObject(final Player player, final int objectType) {
|
||||
String objectName = ObjectDef.getObjectDef(objectType).name;
|
||||
String objectName = ObjectDefinition.getObjectDef(objectType).name;
|
||||
if (objectType == 160 && player.getX() == 3096) {
|
||||
player.getPlayerAssistant().walkTo(0, 1);
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
|
||||
@@ -4,6 +4,8 @@ package com.rebotted.game.players;
|
||||
* Easy access to common interface IDs
|
||||
*/
|
||||
public class MainFrameIDs {
|
||||
|
||||
public static final int DEPOSIT_BOX = 4465;
|
||||
public static final int BANK = 5292; //Might be incorrect!!
|
||||
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public abstract class Player {
|
||||
this.preaching = preaching;
|
||||
}
|
||||
|
||||
public boolean preaching = false;
|
||||
public boolean preaching;
|
||||
|
||||
public Compost getCompost() {
|
||||
return compost;
|
||||
@@ -441,7 +441,7 @@ public abstract class Player {
|
||||
|
||||
|
||||
private int tempInteger;
|
||||
public boolean tempBoolean = false;
|
||||
public boolean tempBoolean;
|
||||
|
||||
public void setTempInteger(int tempInteger) {
|
||||
this.tempInteger = tempInteger;
|
||||
@@ -735,7 +735,7 @@ public abstract class Player {
|
||||
|
||||
|
||||
public int packetSize = 0, packetType = -1;
|
||||
public boolean wildernessWarning = false;
|
||||
public boolean wildernessWarning;
|
||||
public int axeAnimation = -1;
|
||||
|
||||
public void antiFirePotion() {
|
||||
@@ -753,7 +753,7 @@ public abstract class Player {
|
||||
}, 200);
|
||||
}
|
||||
|
||||
public boolean isBusy = false;
|
||||
public boolean isBusy;
|
||||
|
||||
public boolean checkBusy() {
|
||||
return isBusy;
|
||||
@@ -1169,7 +1169,7 @@ public abstract class Player {
|
||||
public void correctCoordinates() {
|
||||
if (Boundary.isIn(this, Boundary.PC_GAME)) {
|
||||
getPlayerAssistant().movePlayer(2657, 2639, 0);
|
||||
} else if (FightPitsArea()) {
|
||||
} else if (Boundary.isIn(this, Boundary.FIGHT_PITS)) {
|
||||
getPlayerAssistant().movePlayer(2399, 5178, 0);
|
||||
} else if (getX() == 0 && getY() == 0) {
|
||||
getPlayerAssistant().movePlayer(3222, 3218, 0);
|
||||
@@ -1296,7 +1296,7 @@ public abstract class Player {
|
||||
|
||||
public String slayerMaster;
|
||||
|
||||
public boolean lostCannon = false, refresh = false, isBot = false;
|
||||
public boolean lostCannon, refresh, isBot;
|
||||
|
||||
public int CannonSetupStage;
|
||||
|
||||
@@ -1320,7 +1320,7 @@ public abstract class Player {
|
||||
doorDelay, doubleDoorDelay, buySlayerTimer, lastIncrease,
|
||||
boneDelay, leverDelay = 0, searchObjectDelay = 0, clickDelay = 0;
|
||||
|
||||
public boolean hideYell = false;
|
||||
public boolean hideYell;
|
||||
|
||||
|
||||
private Npc specialTarget = null;
|
||||
@@ -1335,35 +1335,35 @@ public abstract class Player {
|
||||
|
||||
public int miningAxe = -1, woodcuttingAxe = -1;
|
||||
|
||||
public boolean initialized = false, musicOn = true, luthas,
|
||||
playerIsCooking, disconnected = false, ruleAgreeButton = false,
|
||||
rebuildNPCList = false, isActive = false, isKicked = false,
|
||||
isSkulled = false, friendUpdate = false, newPlayer = false,
|
||||
hasMultiSign = false, saveCharacter = false, mouseButton = false,
|
||||
chatEffects = true, acceptAid = false, recievedMask,
|
||||
nextDialogue = false, autocasting = false, usedSpecial = false,
|
||||
mageFollow = false, dbowSpec = false, craftingLeather = false,
|
||||
properLogout = false, secDbow = false, isNpc,
|
||||
addStarter = false, accountFlagged = false, inPartyRoom = false, msbSpec = false,
|
||||
public boolean initialized, musicOn = true, luthas,
|
||||
playerIsCooking, disconnected, ruleAgreeButton,
|
||||
rebuildNPCList, isActive, isKicked,
|
||||
isSkulled, friendUpdate, newPlayer,
|
||||
hasMultiSign, saveCharacter, mouseButton,
|
||||
chatEffects = true, acceptAid, recievedMask,
|
||||
nextDialogue, autocasting, usedSpecial,
|
||||
mageFollow, dbowSpec, craftingLeather,
|
||||
properLogout, secDbow, isNpc,
|
||||
addStarter, accountFlagged, inPartyRoom, msbSpec,
|
||||
hasBankPin, enterdBankpin, firstPinEnter, requestPinDelete,
|
||||
secondPinEnter, thirdPinEnter, fourthPinEnter, hasBankpin,
|
||||
isBanking, isTeleporting = false, desertWarning,
|
||||
isPotionMaking = false, isGrinding = false, hasStarter, isSpinning,
|
||||
isBanking, isTeleporting, desertWarning,
|
||||
isPotionMaking, isGrinding, hasStarter, isSpinning,
|
||||
clickedSpinning, hasPaidBrim, playerStun, playerFletch, isWoodcutting, playerIsFiremaking,
|
||||
hasNpc = false, playerIsFishing = false, isOperate, below459 = true,
|
||||
splitChat, strongHold, village, needsNewTask = false,
|
||||
canSpeak = true, ignoreFrog, ratdied2 = false,
|
||||
fishingWhirlPool, lostDuel, diedOnTut = false, storing = false, rope, rope2,
|
||||
hasNpc, playerIsFishing, isOperate, below459 = true,
|
||||
splitChat, strongHold, village, needsNewTask,
|
||||
canSpeak = true, ignoreFrog, ratdied2,
|
||||
fishingWhirlPool, lostDuel, diedOnTut, storing, rope, rope2,
|
||||
canWalkTutorial, closeTutorialInterface, isCrafting, showedUnfire,
|
||||
showedFire, isPotCrafting, isFiremaking, playerIsFletching, milking,
|
||||
stopPlayerPacket, spiritTree = false, isSmelting,
|
||||
stopPlayerPacket, spiritTree, isSmelting,
|
||||
isSmithing, hasPaid, canTeleport, magicCharge,
|
||||
clickedVamp = false, allowFading, otherBank = false,
|
||||
recievedReward = false, poison, golemSpawned = false, zombieSpawned = false, shadeSpawned = false,
|
||||
treeSpiritSpawned = false, chickenSpawned = false, clickedTree = false, filter = true,
|
||||
stopPlayer = false, npcCanAttack = true, gliderOpen = false, hasSandwhichLady = false,
|
||||
isHarvesting, openDuel = false, killedJad = false, canHealersRespawn = true, playerIsBusy = false, miningRock,
|
||||
randomEventsEnabled = false, debugMode = false, clickToTele = false;
|
||||
clickedVamp, allowFading, otherBank,
|
||||
recievedReward, poison, golemSpawned, zombieSpawned, shadeSpawned,
|
||||
treeSpiritSpawned, chickenSpawned, clickedTree, filter = true,
|
||||
stopPlayer, npcCanAttack = true, gliderOpen, hasSandwhichLady,
|
||||
isHarvesting, openDuel, killedJad, canHealersRespawn = true, playerIsBusy, miningRock,
|
||||
randomEventsEnabled, debugMode, clickToTele = false;
|
||||
|
||||
public int votePoints, saveDelay, playerKilled, gertCat, restGhost,
|
||||
romeojuliet, runeMist, vampSlayer, cookAss, doricQuest, blackKnight, shieldArrav,
|
||||
@@ -1650,7 +1650,7 @@ public abstract class Player {
|
||||
public boolean isRunning2 = true;
|
||||
public boolean takeAsNote;
|
||||
public int combatLevel;
|
||||
public boolean saveFile = false;
|
||||
public boolean saveFile;
|
||||
public int playerAppearance[] = new int[13];
|
||||
public int actionID;
|
||||
public int wearItemTimer, wearId, wearSlot, interfaceId;
|
||||
@@ -1658,7 +1658,7 @@ public abstract class Player {
|
||||
|
||||
public boolean isMining;
|
||||
public boolean hasThievedStall;
|
||||
public boolean stopFiremaking = false, pickedUpFiremakingLog = false, logLit;
|
||||
public boolean stopFiremaking, pickedUpFiremakingLog, logLit;
|
||||
|
||||
public boolean hasThievedStall() {
|
||||
return hasThievedStall;
|
||||
@@ -1668,9 +1668,9 @@ public abstract class Player {
|
||||
this.hasThievedStall = hasThievedStall;
|
||||
}
|
||||
|
||||
public boolean antiFirePot = false;
|
||||
public boolean antiFirePot;
|
||||
|
||||
public boolean underWater = false;
|
||||
public boolean underWater;
|
||||
public boolean prevRunning2;
|
||||
public int prevPrevPlayerRunIndex;
|
||||
public int prevPlayerStandIndex;
|
||||
@@ -1716,7 +1716,7 @@ public abstract class Player {
|
||||
/**
|
||||
* Fight Pits
|
||||
*/
|
||||
public boolean inPits = false;
|
||||
public boolean inPits;
|
||||
public int pitsStatus = 0;
|
||||
|
||||
/**
|
||||
@@ -1731,15 +1731,6 @@ public abstract class Player {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean FightPitsArea() {
|
||||
return absX >= 2378 && absX <= 2415 && absY >= 5133 && absY <= 5167
|
||||
|| absX >= 2394 && absX <= 2404 && absY >= 5169 && absY <= 5174;
|
||||
}
|
||||
|
||||
public boolean fightPitsArea() {
|
||||
return absX >= 2378 && absX <= 2415 && absY >= 5133 && absY <= 5167;
|
||||
}
|
||||
|
||||
public boolean inBarrows() {
|
||||
if (absX > 3520 && absX < 3598 && absY > 9653 && absY < 9750) {
|
||||
return true;
|
||||
|
||||
@@ -9,7 +9,9 @@ public class PlayerAction {
|
||||
}
|
||||
|
||||
public boolean inAction = false;
|
||||
|
||||
public boolean canWalk = true;
|
||||
|
||||
public boolean canEat = true;
|
||||
|
||||
public boolean setAction(boolean action) {
|
||||
|
||||
@@ -868,8 +868,12 @@ public class PlayerAssistant {
|
||||
}
|
||||
|
||||
public void handleEmpty() {
|
||||
player.getDialogueHandler().sendOption("Yes, empty my inventory please.", "No, don't empty my inventory.");
|
||||
player.dialogueAction = 855;
|
||||
if (player.playerRights != 3) {
|
||||
player.getDialogueHandler().sendOption("Yes, empty my inventory please.", "No, don't empty my inventory.");
|
||||
player.dialogueAction = 855;
|
||||
} else {
|
||||
player.getItemAssistant().removeAllItems();
|
||||
}
|
||||
}
|
||||
|
||||
public void resetTzhaar() {
|
||||
@@ -1416,8 +1420,7 @@ public class PlayerAssistant {
|
||||
&& !PestControl.isInPcBoat(player) // Pest Control
|
||||
&& player.tutorialProgress > 35 // Tutorial Island
|
||||
&& FightPits.getState(player) == null // Fight Pits
|
||||
&& !player.inFightCaves() // Fight Caves
|
||||
) {
|
||||
&& !player.inFightCaves()) { // Fight Caves
|
||||
player.getItemAssistant().resetKeepItems();
|
||||
// admin and bots do not lose/drop items
|
||||
if (player.playerRights != 3 && !player.isBot) {
|
||||
@@ -1454,7 +1457,7 @@ public class PlayerAssistant {
|
||||
}
|
||||
if (FightPits.getState(player) != null) {
|
||||
FightPits.handleDeath(player);
|
||||
} else if (player.fightPitsArea()) {
|
||||
} else if (Boundary.isIn(player, Boundary.FIGHT_PITS)) {
|
||||
player.getPlayerAssistant().movePlayer(2399, 5178, 0);
|
||||
} else if (player.inCw()) {
|
||||
if (CastleWars.getTeamNumber(player) == 1) {
|
||||
@@ -2179,8 +2182,7 @@ public class PlayerAssistant {
|
||||
* @param i3
|
||||
* @param i4
|
||||
*/
|
||||
public void sendCameraShake(int i1, int i2, int i3, int i4)
|
||||
{
|
||||
public void sendCameraShake(int i1, int i2, int i3, int i4) {
|
||||
player.getOutStream().createFrame(35); //Not sure of each specific integer, but some cannot be greater than 5 (maybe less)
|
||||
player.getOutStream().writeByte(i1);
|
||||
player.getOutStream().writeByte(i2);
|
||||
@@ -2201,4 +2203,5 @@ public class PlayerAssistant {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
package com.rebotted.util;
|
||||
|
||||
/**
|
||||
* Easy access to common interface IDs
|
||||
*/
|
||||
public class MainFrameIDs {
|
||||
public static final int DEPOSIT_BOX = 4465;
|
||||
public static final int BANK = 5292; //Might be incorrect!!
|
||||
}
|
||||
+7
-7
@@ -1,8 +1,8 @@
|
||||
package com.rebotted.world.clip;
|
||||
|
||||
public final class ObjectDef {
|
||||
public final class ObjectDefinition {
|
||||
|
||||
public static ObjectDef getObjectDef(int i) {
|
||||
public static ObjectDefinition getObjectDef(int i) {
|
||||
for (int j = 0; j < 20; j++) {
|
||||
if (cache[j].type == i) {
|
||||
return cache[j];
|
||||
@@ -10,7 +10,7 @@ public final class ObjectDef {
|
||||
}
|
||||
|
||||
cacheIndex = (cacheIndex + 1) % 20;
|
||||
ObjectDef class46 = cache[cacheIndex];
|
||||
ObjectDefinition class46 = cache[cacheIndex];
|
||||
class46.type = i;
|
||||
class46.setDefaults();
|
||||
byte[] buffer = archive.get(i);
|
||||
@@ -50,9 +50,9 @@ public final class ObjectDef {
|
||||
public static void loadConfig() {
|
||||
archive = new MemoryArchive(new ByteStream(getBuffer("loc.dat")),
|
||||
new ByteStream(getBuffer("loc.idx")));
|
||||
cache = new ObjectDef[20];
|
||||
cache = new ObjectDefinition[20];
|
||||
for (int k = 0; k < 20; k++) {
|
||||
cache[k] = new ObjectDef();
|
||||
cache[k] = new ObjectDefinition();
|
||||
}
|
||||
System.out.println("[ObjectDef] DONE LOADING OBJECT CONFIGURATION");
|
||||
}
|
||||
@@ -251,7 +251,7 @@ public final class ObjectDef {
|
||||
}
|
||||
}
|
||||
|
||||
private ObjectDef() {
|
||||
private ObjectDefinition() {
|
||||
type = -1;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@ public final class ObjectDef {
|
||||
public boolean hasActions;
|
||||
public boolean aBoolean779;
|
||||
public int anInt781;
|
||||
private static ObjectDef[] cache;
|
||||
private static ObjectDefinition[] cache;
|
||||
private int[] modifiedModelColors;
|
||||
public String actions[];
|
||||
private static MemoryArchive archive;
|
||||
@@ -580,40 +580,40 @@ public class Region {
|
||||
}
|
||||
|
||||
public static void addObject(int objectId, int x, int y, int height, int type, int direction, boolean startUp) {
|
||||
if (ObjectDef.getObjectDef(objectId) == null) {
|
||||
if (ObjectDefinition.getObjectDef(objectId) == null) {
|
||||
}
|
||||
int xLength;
|
||||
int yLength;
|
||||
if (direction != 1 && direction != 3) {
|
||||
xLength = ObjectDef.getObjectDef(objectId).xLength();
|
||||
yLength = ObjectDef.getObjectDef(objectId).yLength();
|
||||
xLength = ObjectDefinition.getObjectDef(objectId).xLength();
|
||||
yLength = ObjectDefinition.getObjectDef(objectId).yLength();
|
||||
} else {
|
||||
xLength = ObjectDef.getObjectDef(objectId).yLength();
|
||||
yLength = ObjectDef.getObjectDef(objectId).xLength();
|
||||
xLength = ObjectDefinition.getObjectDef(objectId).yLength();
|
||||
yLength = ObjectDefinition.getObjectDef(objectId).xLength();
|
||||
}
|
||||
if (type == 22) {
|
||||
if (ObjectDef.getObjectDef(objectId).hasActions()
|
||||
&& ObjectDef.getObjectDef(objectId).aBoolean767()) {
|
||||
if (ObjectDefinition.getObjectDef(objectId).hasActions()
|
||||
&& ObjectDefinition.getObjectDef(objectId).aBoolean767()) {
|
||||
addClipping(x, y, height, 0x200000);
|
||||
if (ObjectDef.getObjectDef(objectId).isUnshootable()) {
|
||||
if (ObjectDefinition.getObjectDef(objectId).isUnshootable()) {
|
||||
addProjectileClipping(x, y, height, 0x200000);
|
||||
}
|
||||
}
|
||||
} else if (type >= 9) {
|
||||
if (ObjectDef.getObjectDef(objectId).aBoolean767()) {
|
||||
if (ObjectDefinition.getObjectDef(objectId).aBoolean767()) {
|
||||
addClippingForSolidObject(x, y, height, xLength, yLength,
|
||||
ObjectDef.getObjectDef(objectId).solid());
|
||||
if (ObjectDef.getObjectDef(objectId).isUnshootable()) {
|
||||
ObjectDefinition.getObjectDef(objectId).solid());
|
||||
if (ObjectDefinition.getObjectDef(objectId).isUnshootable()) {
|
||||
addProjectileClippingForSolidObject(x, y, height, xLength, yLength,
|
||||
ObjectDef.getObjectDef(objectId).solid());
|
||||
ObjectDefinition.getObjectDef(objectId).solid());
|
||||
}
|
||||
}
|
||||
} else if (type >= 0 && type <= 3) {
|
||||
if (ObjectDef.getObjectDef(objectId).aBoolean767()) {
|
||||
if (ObjectDefinition.getObjectDef(objectId).aBoolean767()) {
|
||||
addClippingForVariableObject(x, y, height, type, direction,
|
||||
ObjectDef.getObjectDef(objectId).solid());
|
||||
if (ObjectDef.getObjectDef(objectId).isUnshootable()) {
|
||||
addProjectileClippingForVariableObject(x, y, height, type, direction, ObjectDef.getObjectDef(objectId).solid());
|
||||
ObjectDefinition.getObjectDef(objectId).solid());
|
||||
if (ObjectDefinition.getObjectDef(objectId).isUnshootable()) {
|
||||
addProjectileClippingForVariableObject(x, y, height, type, direction, ObjectDefinition.getObjectDef(objectId).solid());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -656,8 +656,7 @@ public class Region {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static boolean getClipping(int x, int y, int height, int moveTypeX,
|
||||
int moveTypeY) {
|
||||
public static boolean getClipping(int x, int y, int height, int moveTypeX, int moveTypeY) {
|
||||
try {
|
||||
if (height > 3) {
|
||||
height = 0;
|
||||
|
||||
Reference in New Issue
Block a user