Compare commits

...

24 Commits

Author SHA1 Message Date
dginovker 92688def31 noip, thanks @Dark98 :) 2019-11-19 23:24:45 -05:00
Gptaqbc c0c6b40387 Fixed stuff related to shop trading (#202)
> Refactored stuff to facilitate resolving an issue regarding sellnig item to a full shop
> Removed double value message in shop
2019-11-19 13:11:16 -05:00
dginovker 820c6fafba Latest compile + crash fix 2019-11-18 16:31:10 -05:00
Danial 27b5f075bc bunch o changes (#200)
* Create cluescrolls.txt

* tidy up

* fixup ::item command

* tidy up

* fixup fight caves checker
2019-11-18 16:28:00 -05:00
dginovker 925c91406d Latest compile 2019-11-18 12:09:13 -05:00
Danial e5a0f84fcc Update Slayer (#196)
* tidy up

* Update DialogueHandler.java

* Slayer master gives specific difficulty tasks

* int

* tidy up
2019-11-18 12:01:03 -05:00
Danial 26ff191af3 Update drop handling, Allow rares, Remove some logging (#193)
* Fix local Parabot instructions

* Add kick command, and force logout function

* Allow rare items (phats etc)

* remove random server logging

* implement random drop amount

* fixup random events message
2019-11-17 19:31:18 -05:00
Mr Extremez 2b6ff7db02 Global drops/monks/al kharid furnance (#192)
closes #177
closes #136 (hp restoring works, couldn't find the anim tho)
closes #178 (should fix all the issues, let me know for sure)
Also removed the object does not exist message ingame for non admins and got rid of the isBotting code when clicking objects
2019-11-17 18:30:08 -05:00
dginovker 855f4b9ab7 Red's compile 2019-11-17 15:34:30 -05:00
Danial 4a2358945c Update Scrolls (#191)
* Fix local Parabot instructions

* Add kick command, and force logout function

* Update scroll handling
2019-11-17 15:33:10 -05:00
dginovker 92c5ac1f7e Latest compile 2019-11-17 14:59:20 -05:00
Gptaqbc e28bada221 New stuff again (#190)
* Fixes some agreesive monsters that should be unaggressive

Fixes some agreesive monsters that should be unaggressive

* more items

more items

* Update Item.java

* Fixed some items visual bugs - Helmet

Fixed some items visual bugs - Helmet

* Fixed trading issues.

Fuck up players couldnt trade because they were considered busy. Also fixed the trade screen that stays opened even when other player is out of it.

* removed shit that occured while fixing the conflict.

removed shit that occured while fixing the conflict.
2019-11-17 14:38:33 -05:00
Danial 8570b5f531 Minor tidy up, Update specials stats (#189)
* Fix local Parabot instructions

* Add kick command, and force logout function

* fixup abyss

* fixup tokkull selling

* tidy up

* update abyssal whip special accuracy

* update specials from wiki

* eh

* remove system log
2019-11-17 14:23:28 -05:00
dginovker 9dcc1eee0b Latest compile 2019-11-17 01:50:36 -05:00
Gptaqbc 9ed8ea8ae7 Next branch again (#187)
* Faster shop restocking - Brought back normal stack of items in shops - Added chat message to camoe transport system

Faster shop restocking - Brought back normal stack of items in shops - Added chat message to camoe transport system

* Fixed typo

Fixed typo

* Fixed item fuck up when wearing them. For example full helm trimmed and robes trimmed

Fixed item fuck up when wearing them. For example full helm trimmed and robes trimmed
2019-11-17 01:45:48 -05:00
Gptaqbc e8cbb975bc Fixes some agreesive monsters that should be unaggressive (#188)
Fixes some agreesive monsters that should be unaggressive
2019-11-17 01:45:10 -05:00
dginovker 3592cb7af9 Latest compile 2019-11-16 20:51:28 -05:00
Danial b13fa89de2 Fix Abyss, Fix selling for tokkull (#186)
* Fix local Parabot instructions

* Add kick command, and force logout function

* fixup abyss

* fixup tokkull selling
2019-11-16 20:50:13 -05:00
Daniel Ginovker 165f156814 Fix dark wizzies aggro, add more togglerender commands and add it to ::commands itself, fixed spam clicking tree gives a ton of logs (#185)
* Finish #167

* Fix #182

* Fixed #183
2019-11-16 18:17:54 -05:00
dginovker 7366de67e1 Fix localhost/live serv parabot jars 2019-11-14 13:39:08 -05:00
dginovker 982ae74d37 gitignore update 2019-11-11 15:49:24 -05:00
mikeysasse c827d46ca0 Projectile clipping, PassDoor fix (#176)
* Numbered packet sizes.
Corrected sound packet length to 6 from 5.
Corrected sound packet in server.
Teleport sound now plays correctly.
Corrected modern teleport animation playthrough.
Removed redundant teleport delay.

* Changed sendSound packet size back to 5 and removed type attribute to maintain compatibility with Parabot.

* After running around an object to attack the player will no longer wait a number of ticks to start attacking again.
Fixed an issue where walkTo being called from CycleEvents would not execute correctly.
Player will no longer face a killed npc after it respawns.
Added projectile clipping.
Added a new algorithm for player->player/npc following that accounts for projectile clipping.
2019-11-11 15:20:02 -05:00
dginovker a4e4b89d99 Latest compile! 2019-11-11 00:30:09 -05:00
Mr Extremez d14f4e5044 Changesftw (#172)
* Npc definitions/npc aggressiveness

Let me know how it works

* Error fix

fixes error
2019-11-11 00:26:47 -05:00
166 changed files with 139058 additions and 3348 deletions
+2
View File
@@ -1,3 +1,5 @@
2006Redone\ Server/data/characters/
.idea/
.idea/workspace.xml
**/.idea/workspace.xml
**/.idea/*
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CheckStyle-IDEA">
<option name="configuration">
<map>
<entry key="checkstyle-version" value="8.25" />
<entry key="copy-libs" value="true" />
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
<entry key="scan-before-checkin" value="false" />
<entry key="scanscope" value="JavaOnly" />
<entry key="suppress-errors" value="false" />
</map>
</option>
</component>
</project>
+5
View File
@@ -76,6 +76,11 @@
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="-7" />
<option name="width" value="1294" />
<option name="height" value="1407" />
</component>
<component name="ProjectId" id="1Sr1PyvKre5eWJ6XgOrqWrHM5hp" />
<component name="PropertiesComponent">
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
+2
View File
@@ -0,0 +1,2 @@
/Client.class
/LocalGame.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+7
View File
@@ -0,0 +1,7 @@
/* AUTOMATICALLY GENERATED ON Tue Apr 16 17:20:59 EDT 2002*/
/* DO NOT EDIT */
grant {
permission java.security.AllPermission;
};
+3 -4
View File
@@ -18,12 +18,11 @@ public class ClientSettings {
/**
* The Servers Ip
*
* You dont have to change this, the client will automatically connect to the server
* on localhost
* You don't have to change this, the client will automatically connect to the server
* on localhost (Assuming you're running Client and LocalGame respectively)
*
*/
//public static String SERVER_IP = "35.226.247.68"; //NOW SET IN Main,java
public static String SERVER_IP = "127.0.0.1";
public static String SERVER_IP = "2006rebotted.hopto.org";
/**
* The Npc Bits for the Server
*/
+8 -4
View File
@@ -4771,7 +4771,7 @@ public class Game extends RSApplet {
inputTaken = true;
}
if ((j == 13 || j == 10) && inputString.length() > 0) {
if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx")) {
if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx") || inputString.equals("::togglerender") || inputString.equals("::togglegfx")) {
graphicsEnabled = !graphicsEnabled;
}
if (myPrivilege == 2) {
@@ -9774,8 +9774,10 @@ public class Game extends RSApplet {
int j13 = stream.readUnsignedByte();
int k15 = anInt1268 + (j13 >> 4 & 7);
int l16 = anInt1269 + (j13 & 7);
if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104)
if (k15 >= 0 && l16 >= 0 && k15 < 104 && l16 < 104) {
method130(-1, -1, j8, i11, l16, k5, plane, k15, 0);
}
return;
}
if (j == 151) {
@@ -9787,6 +9789,7 @@ public class Game extends RSApplet {
int i15 = k12 >> 2;
int k16 = k12 & 3;
int l17 = anIntArray1177[i15];
//System.out.println("id: " + j10 + " x:" + (this.baseX + anInt1268) + " y:" + (this.baseY + anInt1269));
if (l4 >= 0 && k7 >= 0 && l4 < 104 && k7 < 104)
method130(-1, j10, k16, l17, k7, i15, plane, l4, 0);
return;
@@ -10645,7 +10648,7 @@ public class Game extends RSApplet {
}
if (pktType == 174) {
int id = inStream.readUnsignedWord();
int type = inStream.readUnsignedByte();
int type = /*inStream.readUnsignedByte()*/1;
int delay = inStream.readUnsignedWord();
int volume = inStream.readUnsignedByte();
sound[currentSound] = id;
@@ -11420,6 +11423,7 @@ public class Game extends RSApplet {
Signlink.reporterror(s2);
resetLogout();
exception.printStackTrace();
}
return true;
}
@@ -12167,7 +12171,7 @@ public class Game extends RSApplet {
this.anInt1187 += (j << 1);
}
public final void keyPressed(KeyEvent keyevent)
public void keyPressed(KeyEvent keyevent)
{
super.keyPressed(keyevent);
switch (keyevent.getKeyCode())
+1 -1
View File
@@ -23,6 +23,6 @@ import java.util.Date;
public class LocalGame extends Game {
public LocalGame() {
super();
server = ClientSettings.SERVER_IP;
server = "127.0.0.1";
}
}
+1 -1
View File
@@ -16,7 +16,7 @@ public final class Main {
*/
public static void main(String[] args) {
ClientSettings.SERVER_IP = "35.226.247.68";
ClientSettings.SERVER_IP = "2006rebotted.hopto.org";
if (args.length > 1)
{
System.out.println("Running local");
+1 -1
View File
@@ -284,7 +284,7 @@ public class RSApplet extends Applet implements Runnable, MouseListener, MouseMo
}
@Override
public final void mouseMoved(MouseEvent mouseevent) {
public void mouseMoved(MouseEvent mouseevent) {
int i = mouseevent.getX();
int j = mouseevent.getY();
if (gameFrame != null) {
+26 -26
View File
@@ -34,31 +34,31 @@ final class SizeConstants {
173, 228, 121, 83, 133, 68, 0
};
public static final int[] packetSizes = {
0, 0, 0, 0, 6, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, -2, 4, 3, 0, 0, 0,
0, 0, 0, 0, 5, 0, 0, 6, 0, 0,
9, 0, 0, -2, 0, 0, 0, 0, 0, 0,
-2, 1, 0, 0, 2, -2, 0, 0, 0, 0,
6, 3, 2, 4, 2, 4, 0, 0, 0, 4,
0, -2, 0, 0, 7, 2, 0, 6, 0, 0,
0, 0, 0, 0, 0, 0, 0, 2, 0, 1,
0, 2, 0, 0, -1, 4, 1, 0, 0, 0,
1, 0, 0, 0, 2, 0, 0, 15, 0, 0,
0, 4, 4, 0, 0, 0, -2, 0, 0, 0,
0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 0, 14, 0, 0,
0, 4, 0, 0, 0, 0, 3, 0, 0, 0,
4, 0, 0, 0, 2, 0, 6, 0, 0, 0,
0, 3, 0, 0, 5, 0, 10, 6, 0, 0,
0, 0, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, -1, 0, 0, 0,
4, 0, 0, 0, 0, 0, 3, 0, 2, 0,
0, 0, 0, 0, -2, 7, 0, 0, 2, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
8, 0, 0, 0, 0, 0, 0, 0, 0, 0,
2, -2, 0, 0, 0, 0, 6, 0, 4, 3,
0, 0, 0, -1, 6, 0, 0
0, 0, 0, 0, 6, 0, 0, 0, 4, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, //10
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, //20
0, 0, 0, 0, -2, 4, 3, 0, 0, 0, //30
0, 0, 0, 0, 5, 0, 0, 6, 0, 0, //40
9, 0, 0, -2, 0, 0, 0, 0, 0, 0, //50
-2, 1, 0, 0, 2, -2, 0, 0, 0, 0, //60
6, 3, 2, 4, 2, 4, 0, 0, 0, 4, //70
0, -2, 0, 0, 7, 2, 0, 6, 0, 0, //80
0, 0, 0, 0, 0, 0, 0, 2, 0, 1, //90
0, 2, 0, 0, -1, 4, 1, 0, 0, 0, //100
1, 0, 0, 0, 2, 0, 0, 15, 0, 0, //110
0, 4, 4, 0, 0, 0, -2, 0, 0, 0, //120
0, 0, 0, 0, 6, 0, 0, 0, 0, 0, //130
0, 0, 2, 0, 0, 0, 0, 14, 0, 0, //140
0, 4, 0, 0, 0, 0, 3, 0, 0, 0, //150
4, 0, 0, 0, 2, 0, 6, 0, 0, 0, //160
0, 3, 0, 0, 5, 0, 10, 6, 0, 0, //170
0, 0, 0, 0, 0, 2, 0, 0, 0, 0, //180
0, 0, 0, 0, 0, 0, -1, 0, 0, 0, //190
4, 0, 0, 0, 0, 0, 3, 0, 2, 0, //200
0, 0, 0, 0, -2, 7, 0, 0, 2, 0, //210
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, //220
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, //230
2, -2, 0, 0, 0, 0, 6, 0, 4, 3, //240
0, 0, 0, -1, 6, 0, 0//250
};
}
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -1179,7 +1179,7 @@ spawn = 78 2910 9841 0 1 3 20 20 GiantBat TavDung
spawn = 78 2908 9828 0 1 3 20 20 GiantBat TavDung
spawn = 78 2918 9829 0 1 3 20 20 GiantBat TavDung
spawn = 78 2923 9831 0 1 3 20 20 GiantBat TavDung
spawn = 178 3089 3230 0 1 5 20 11 BlackKnight
spawn = 179 3089 3230 0 1 5 20 11 BlackKnight
spawn = 178 2939 9811 0 1 5 20 11 BlackKnight TavDung
spawn = 178 2938 9815 0 1 5 20 11 BlackKnight TavDung
spawn = 178 2941 9805 0 1 5 20 11 BlackKnight TavDung
@@ -0,0 +1,415 @@
[ACCOUNT]
character-username = cluescrolls
character-password = 067zHK1XT1Blxhq+Y2VTtRLMvazQ61qq+R+Fr+iqWbU=
[CHARACTER]
character-height = 0
character-posx = 3233
character-posy = 3229
character-rights = 3
hasStarter = false
bankPin1 = 0
bankPin2 = 0
bankPin3 = 0
bankPin4 = 0
hasBankpin = false
pinRegisteredDeleteDay = 0
requestPinDelete = false
lastLoginDate = 20191018
setPin = false
hasPaid = false
lostCannon = false
cannonX = 0
cannonY = 0
myBalls = 0
poison = false
spiritTree = false
npcCanAttack = true
rope = false
rope2 = false
recievedMask = false
recievedReward = false
isBotting = false
global-damage = 0
brightness = 3
closeTutorialInterface = true
canWalkTutorial = true
village = false
lastThieve = 0
homeTele = 0
strongHold = false
character-energy = 100
crystal-bow-shots = 0
splitChat = false
canSpeak = true
barrowsNpcs = 0 0
barrowsNpcs = 1 0
barrowsNpcs = 2 0
barrowsNpcs = 3 0
barrowsNpcs = 4 0
barrowsNpcs = 5 0
questStages = 0
SlayerMaster = 0
music = false false false false false false true false false false false false false false false false false false false false false false false false false false false false true false false false false false false false false false false false false false false false false false false false false false
randomActions = 0
blackMarks = 0
tutorial-progress = 36
skull-timer = 0
recoilHits = 0
lastX = 3233
lastY = 3229
lastH = 0
removedTask0 = -1
removedTask1 = -1
removedTask2 = -1
removedTask3 = -1
creationAddress =
has-npc = false
summonId = 0
thankedForDonation = 0
membership = false
questPoints = 23
votePoints = 0
bananas = 0
magic-book = 0
special-amount = 10.0
musicOn = true
needsNewTask = false
luthas = false
selected-coffin = 0
runeMist = 0
blackKnight = 0
shieldArrav = 0
cookAss = 0
pirateTreasure = 0
ptjob = 0
doricQuest = 0
dragonSlayerQuestStage = 0
impsC = 0
knightS = 0
sheepShear = 0
romeo-juliet = 0
gertCat = 0
cw-games = 0
witchspot = 0
restGhost = 0
vampSlayer = 0
RatDied2 = false
debugMode = false
randomToggle = false
teleblock-length = 0
pc-points = 0
lastYell = 0
slayerTask = 0
taskAmount = 0
magePoints = 0
autoRet = 1
barrowsKillCount = 0
slayerPoints = 0
flagged = false
wave = 0
gwkc = 0
isRunning = false
fightMode = 0
void = 0 0 0 0 0
[EQUIPMENT]
character-equip = 0 1050 1
character-equip = 1 -1 1
character-equip = 2 -1 1
character-equip = 3 -1 0
character-equip = 4 -1 1
character-equip = 5 -1 1
character-equip = 6 -1 0
character-equip = 7 -1 1
character-equip = 8 -1 0
character-equip = 9 -1 1
character-equip = 10 -1 1
character-equip = 11 -1 0
character-equip = 12 -1 1
character-equip = 13 -1 0
[LOOK]
character-look = 0 0
character-look = 1 0
character-look = 2 18
character-look = 3 26
character-look = 4 33
character-look = 5 36
character-look = 6 42
character-look = 7 10
character-look = 8 0
character-look = 9 0
character-look = 10 0
character-look = 11 0
character-look = 12 0
[SKILLS]
character-skill = 0 1 0
character-skill = 1 1 0
character-skill = 2 1 0
character-skill = 3 10 1300
character-skill = 4 1 0
character-skill = 5 1 0
character-skill = 6 1 0
character-skill = 7 1 0
character-skill = 8 1 0
character-skill = 9 1 0
character-skill = 10 1 0
character-skill = 11 1 0
character-skill = 12 1 0
character-skill = 13 1 0
character-skill = 14 1 0
character-skill = 15 3 175
character-skill = 16 1 0
character-skill = 17 1 0
character-skill = 18 1 0
character-skill = 19 1 0
character-skill = 20 1 0
character-skill = 21 1 0
character-skill = 22 1 0
character-skill = 23 1 0
character-skill = 24 1 0
[ITEMS]
[BANK]
character-bank = 0 2678 1
character-bank = 1 854 1
character-bank = 2 852 1
character-bank = 3 1328 1
character-bank = 4 1234 1
character-bank = 5 5683 1
character-bank = 6 5701 1
character-bank = 7 6612 1
character-bank = 8 6592 1
character-bank = 9 6594 1
character-bank = 10 6596 1
character-bank = 11 6598 1
character-bank = 12 6600 1
character-bank = 13 6604 1
character-bank = 14 6620 1
character-bank = 15 6616 1
character-bank = 16 6624 1
character-bank = 17 6630 1
character-bank = 18 6634 1
character-bank = 19 6618 1
character-bank = 20 6626 1
character-bank = 21 6628 1
character-bank = 22 6632 1
character-bank = 23 2588 1
character-bank = 24 2590 1
character-bank = 25 2584 1
character-bank = 26 2586 1
character-bank = 27 3473 1
character-bank = 28 2596 1
character-bank = 29 2598 1
character-bank = 30 2592 1
character-bank = 31 2594 1
character-bank = 32 3474 1
character-bank = 33 7389 1
character-bank = 34 7397 1
character-bank = 35 7393 1
character-bank = 36 7387 1
character-bank = 37 7395 1
character-bank = 38 7391 1
character-bank = 39 7365 1
character-bank = 40 7369 1
character-bank = 41 7363 1
character-bank = 42 7367 1
character-bank = 43 1640 1
character-bank = 44 1642 1
character-bank = 45 1638 1
character-bank = 46 2525 1
character-bank = 47 2521 1
character-bank = 48 2527 1
character-bank = 49 2523 1
character-bank = 50 6542 1
character-bank = 51 7772 1
character-bank = 52 7768 1
character-bank = 53 7764 1
character-bank = 54 3722 1
character-bank = 55 7760 1
character-bank = 56 6857 1
character-bank = 57 2979 1
character-bank = 58 2980 1
character-bank = 59 2981 1
character-bank = 60 2982 1
character-bank = 61 2983 1
character-bank = 62 2984 1
character-bank = 63 2985 1
character-bank = 64 2986 1
character-bank = 65 2987 1
character-bank = 66 2988 1
character-bank = 67 2989 1
character-bank = 68 2990 1
character-bank = 69 2991 1
character-bank = 70 2992 1
character-bank = 71 2993 1
character-bank = 72 2994 1
character-bank = 73 2995 1
character-bank = 74 2996 1
character-bank = 75 6346 1
character-bank = 76 6356 1
character-bank = 77 6366 1
character-bank = 78 6376 1
character-bank = 79 6863 1
character-bank = 80 6861 1
character-bank = 81 6859 1
character-bank = 82 6183 1
character-bank = 83 6548 1
character-bank = 84 6549 1
character-bank = 85 6666 1
character-bank = 86 2679 1
character-bank = 87 1330 1
character-bank = 88 1332 1
character-bank = 89 1398 1
character-bank = 90 1400 1
character-bank = 91 1394 1
character-bank = 92 3054 1
character-bank = 93 6563 1
character-bank = 94 1396 1
character-bank = 95 858 1
character-bank = 96 856 1
character-bank = 97 2606 1
character-bank = 98 2604 1
character-bank = 99 2600 1
character-bank = 100 2602 1
character-bank = 101 3475 1
character-bank = 102 2614 1
character-bank = 103 2612 1
character-bank = 104 2608 1
character-bank = 105 2610 1
character-bank = 106 3476 1
character-bank = 107 7373 1
character-bank = 108 7381 1
character-bank = 109 7371 1
character-bank = 110 7379 1
character-bank = 111 2569 1
character-bank = 112 2571 1
character-bank = 113 2551 1
character-bank = 114 1728 1
character-bank = 115 1726 1
character-bank = 116 2582 1
character-bank = 117 2578 1
character-bank = 118 2652 1
character-bank = 119 2632 1
character-bank = 120 2680 1
character-bank = 121 1334 1
character-bank = 122 1230 1
character-bank = 123 5679 1
character-bank = 124 5697 1
character-bank = 125 1216 1
character-bank = 126 1232 1
character-bank = 127 5681 1
character-bank = 128 5699 1
character-bank = 129 1250 1
character-bank = 130 3177 1
character-bank = 131 1264 1
character-bank = 132 5717 1
character-bank = 133 5731 1
character-bank = 134 1360 1
character-bank = 135 6740 1
character-bank = 136 3055 1
character-bank = 137 6564 1
character-bank = 138 1404 1
character-bank = 139 1406 1
character-bank = 140 1408 1
character-bank = 141 1402 1
character-bank = 142 862 1
character-bank = 143 860 1
character-bank = 144 3487 1
character-bank = 145 3489 1
character-bank = 146 3482 1
character-bank = 147 3484 1
character-bank = 148 3486 1
character-bank = 149 2628 1
character-bank = 150 2630 1
character-bank = 151 2624 1
character-bank = 152 2626 1
character-bank = 153 3478 1
character-bank = 154 2620 1
character-bank = 155 2622 1
character-bank = 156 2616 1
character-bank = 157 2618 1
character-bank = 158 3477 1
character-bank = 159 7401 1
character-bank = 160 7399 1
character-bank = 161 7400 1
character-bank = 162 6921 1
character-bank = 163 6925 1
character-bank = 164 6923 1
character-bank = 165 6919 1
character-bank = 166 6917 1
character-bank = 167 4098 1
character-bank = 168 4108 1
character-bank = 169 4118 1
character-bank = 170 4096 1
character-bank = 171 4106 1
character-bank = 172 4116 1
character-bank = 173 4090 1
character-bank = 174 4100 1
character-bank = 175 4110 1
character-bank = 176 4094 1
character-bank = 177 4104 1
character-bank = 178 4114 1
character-bank = 179 4092 1
character-bank = 180 4102 1
character-bank = 181 4112 1
character-bank = 182 7377 1
character-bank = 183 7385 1
character-bank = 184 7375 1
character-bank = 185 7383 1
character-bank = 186 2492 1
character-bank = 187 2498 1
character-bank = 188 2504 1
character-bank = 189 2514 1
character-bank = 190 1150 1
character-bank = 191 4088 1
character-bank = 192 4586 1
character-bank = 193 1188 1
character-bank = 194 2415 1
character-bank = 195 2658 1
character-bank = 196 2660 1
character-bank = 197 2654 1
character-bank = 198 2656 1
character-bank = 199 3479 1
character-bank = 200 2414 1
character-bank = 201 2674 1
character-bank = 202 2676 1
character-bank = 203 2670 1
character-bank = 204 2672 1
character-bank = 205 3481 1
character-bank = 206 2413 1
character-bank = 207 2666 1
character-bank = 208 2668 1
character-bank = 209 2662 1
character-bank = 210 2664 1
character-bank = 211 3480 1
character-bank = 212 1632 1
character-bank = 213 1616 1
character-bank = 214 1703 1
character-bank = 215 1646 1
character-bank = 216 2573 1
character-bank = 217 2553 1
character-bank = 218 6734 1
character-bank = 219 6738 1
character-bank = 220 6041 1
character-bank = 221 1498 1
character-bank = 222 1732 1
character-bank = 223 6586 1
character-bank = 224 7928 1
character-bank = 225 1051 1
character-bank = 226 1043 1
character-bank = 227 1045 1
character-bank = 228 1047 1
character-bank = 229 1039 1
character-bank = 230 1049 1
character-bank = 231 1041 1
[FRIENDS]
[IGNORES]
[EOF]
@@ -0,0 +1,7 @@
[2019/10/26] 21:23 michael2 clicked item bones
[2019/10/26] 21:25 michael2 clicked item bones
[2019/10/26] 21:26 michael2 clicked item bones
[2019/10/26] 21:28 michael2 clicked item bones
[2019/10/26] 21:30 michael2 clicked item bones
[2019/10/26] 21:30 michael2 clicked item bones
[2019/10/26] 21:30 michael2 clicked item bones
@@ -0,0 +1,2 @@
[2019/10/28] 15:43 michael8 clicked item herb
[2019/10/28] 15:43 michael8 clicked item bones
@@ -0,0 +1 @@
[2019/10/27] 16:16 michael used command: bank
@@ -0,0 +1 @@
[2019/10/28] 16:52 michael2 used command: bank
@@ -0,0 +1,16 @@
[2019/10/26] 21:23 michael2 dropped 3 iron arrow absX: 3248 absY: 3225
[2019/10/26] 21:24 michael2 dropped 17 bronze arrow absX: 3262 absY: 3228
[2019/10/26] 21:24 michael2 dropped 1 air talisman absX: 3262 absY: 3228
[2019/10/26] 21:26 michael2 dropped 1 bronze longsword absX: 3259 absY: 3229
[2019/10/26] 21:28 michael2 dropped 1 bronze med helm absX: 3251 absY: 3225
[2019/10/26] 21:28 michael2 dropped 1 air talisman absX: 3251 absY: 3225
[2019/10/26] 21:29 michael2 dropped 9 coins absX: 3255 absY: 3223
[2019/10/26] 21:29 michael2 dropped 6 water rune absX: 3255 absY: 3223
[2019/10/26] 21:29 michael2 dropped 1 goblin mail absX: 3255 absY: 3223
[2019/10/26] 21:31 michael2 dropped 1 bronze sq shield absX: 3260 absY: 3228
[2019/10/26] 21:32 michael2 dropped 9 coins absX: 3259 absY: 3227
[2019/10/26] 21:34 michael2 dropped 1 bronze sq shield absX: 3262 absY: 3229
[2019/10/26] 21:34 michael2 dropped 1 bronze sq shield absX: 3255 absY: 3223
[2019/10/26] 21:34 michael2 dropped 1 bronze longsword absX: 3255 absY: 3223
[2019/10/26] 21:35 michael2 dropped 1 raw chicken absX: 3260 absY: 3227
[2019/10/26] 21:51 michael2 dropped 1 ashes absX: 3234 absY: 3218
@@ -0,0 +1,21 @@
[2019/10/27] 18:50 michael5 dropped 1 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:50 michael5 dropped 1 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:50 michael5 dropped 1 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:50 michael5 dropped 2 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:50 michael5 dropped 3 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:50 michael5 dropped 4 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:50 michael5 dropped 5 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:50 michael5 dropped 6 bronze arrow absX: 3247 absY: 3226
[2019/10/27] 18:51 michael5 dropped 2 air rune absX: 3248 absY: 3226
[2019/10/27] 18:51 michael5 dropped 5 iron arrow absX: 3248 absY: 3226
[2019/10/27] 18:51 michael5 dropped 1 bronze arrow absX: 3251 absY: 3226
[2019/10/27] 18:51 michael5 dropped 1 bronze arrow absX: 3253 absY: 3225
[2019/10/27] 18:51 michael5 dropped 2 bronze arrow absX: 3252 absY: 3225
[2019/10/27] 18:51 michael5 dropped 3 bronze arrow absX: 3252 absY: 3225
[2019/10/27] 18:51 michael5 dropped 1 bronze arrow absX: 3242 absY: 3225
[2019/10/27] 18:51 michael5 dropped 2 bronze arrow absX: 3242 absY: 3225
[2019/10/27] 18:52 michael5 dropped 3 bronze arrow absX: 3242 absY: 3225
[2019/10/27] 18:52 michael5 dropped 4 bronze arrow absX: 3242 absY: 3225
[2019/10/27] 18:52 michael5 dropped 5 bronze arrow absX: 3242 absY: 3225
[2019/10/27] 18:52 michael5 dropped 6 bronze arrow absX: 3242 absY: 3225
[2019/10/27] 18:55 michael5 dropped 1 ashes absX: 3234 absY: 3230
@@ -0,0 +1,27 @@
[2019/10/28] 13:45 michael6 dropped 1 bronze arrow absX: 3224 absY: 3222
[2019/10/28] 13:45 michael6 dropped 1 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:45 michael6 dropped 2 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:45 michael6 dropped 3 bronze arrow absX: 3224 absY: 3222
[2019/10/28] 13:45 michael6 dropped 4 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:45 michael6 dropped 5 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:45 michael6 dropped 6 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:45 michael6 dropped 7 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:46 michael6 dropped 8 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:46 michael6 dropped 9 bronze arrow absX: 3224 absY: 3222
[2019/10/28] 13:46 michael6 dropped 10 bronze arrow absX: 3224 absY: 3224
[2019/10/28] 13:48 michael6 dropped 1 bronze arrow absX: 3220 absY: 3224
[2019/10/28] 13:48 michael6 dropped 1 bronze arrow absX: 3219 absY: 3223
[2019/10/28] 13:48 michael6 dropped 2 bronze arrow absX: 3221 absY: 3223
[2019/10/28] 13:48 michael6 dropped 1 bronze arrow absX: 3221 absY: 3225
[2019/10/28] 13:48 michael6 dropped 1 bronze arrow absX: 3222 absY: 3221
[2019/10/28] 13:48 michael6 dropped 2 bronze arrow absX: 3222 absY: 3221
[2019/10/28] 13:48 michael6 dropped 3 bronze arrow absX: 3222 absY: 3221
[2019/10/28] 13:48 michael6 dropped 4 bronze arrow absX: 3222 absY: 3221
[2019/10/28] 13:48 michael6 dropped 5 bronze arrow absX: 3222 absY: 3221
[2019/10/28] 13:48 michael6 dropped 6 bronze arrow absX: 3222 absY: 3221
[2019/10/28] 13:52 michael6 dropped 1 bronze arrow absX: 3221 absY: 3219
[2019/10/28] 13:52 michael6 dropped 1 bronze arrow absX: 3232 absY: 3219
[2019/10/28] 14:01 michael6 dropped 1 bronze arrow absX: 3217 absY: 3244
[2019/10/28] 14:01 michael6 dropped 1 bronze arrow absX: 3228 absY: 3218
[2019/10/28] 14:01 michael6 dropped 1 bronze arrow absX: 3230 absY: 3218
[2019/10/28] 14:02 michael6 dropped 1 bronze arrow absX: 3232 absY: 3217
@@ -0,0 +1,29 @@
[2019/10/28] 15:09 michael7 dropped 1 bronze arrow absX: 3225 absY: 3223
[2019/10/28] 15:13 michael7 dropped 1 bronze arrow absX: 3225 absY: 3224
[2019/10/28] 15:13 michael7 dropped 1 bronze arrow absX: 3225 absY: 3222
[2019/10/28] 15:18 michael7 dropped 1 bronze arrow absX: 3230 absY: 3219
[2019/10/28] 15:19 michael7 dropped 2 bronze arrow absX: 3230 absY: 3219
[2019/10/28] 15:19 michael7 dropped 1 bronze arrow absX: 3234 absY: 3217
[2019/10/28] 15:19 michael7 dropped 1 bronze arrow absX: 3235 absY: 3221
[2019/10/28] 15:19 michael7 dropped 2 bronze arrow absX: 3235 absY: 3221
[2019/10/28] 15:19 michael7 dropped 1 bronze arrow absX: 3236 absY: 3222
[2019/10/28] 15:19 michael7 dropped 1 bronze arrow absX: 3233 absY: 3222
[2019/10/28] 15:19 michael7 dropped 2 bronze arrow absX: 3233 absY: 3222
[2019/10/28] 15:19 michael7 dropped 3 bronze arrow absX: 3233 absY: 3222
[2019/10/28] 15:19 michael7 dropped 4 bronze arrow absX: 3233 absY: 3222
[2019/10/28] 15:19 michael7 dropped 5 bronze arrow absX: 3233 absY: 3222
[2019/10/28] 15:19 michael7 dropped 6 bronze arrow absX: 3233 absY: 3222
[2019/10/28] 15:19 michael7 dropped 1 bronze arrow absX: 3232 absY: 3220
[2019/10/28] 15:19 michael7 dropped 1 bronze arrow absX: 3233 absY: 3220
[2019/10/28] 15:19 michael7 dropped 2 bronze arrow absX: 3233 absY: 3220
[2019/10/28] 15:20 michael7 dropped 1 bronze arrow absX: 3234 absY: 3218
[2019/10/28] 15:20 michael7 dropped 1 ashes absX: 3230 absY: 3218
[2019/10/28] 15:20 michael7 dropped 3 bronze arrow absX: 3230 absY: 3219
[2019/10/28] 15:20 michael7 dropped 1 bronze arrow absX: 3223 absY: 3228
[2019/10/28] 15:23 michael7 dropped 1 bronze arrow absX: 3223 absY: 3227
[2019/10/28] 15:23 michael7 dropped 2 bronze arrow absX: 3223 absY: 3229
[2019/10/28] 15:23 michael7 dropped 1 bronze arrow absX: 3234 absY: 3218
[2019/10/28] 15:23 michael7 dropped 1 bronze arrow absX: 3236 absY: 3218
[2019/10/28] 15:23 michael7 dropped 1 bronze arrow absX: 3234 absY: 3218
[2019/10/28] 15:23 michael7 dropped 2 bronze arrow absX: 3234 absY: 3218
[2019/10/28] 15:23 michael7 dropped 3 bronze arrow absX: 3234 absY: 3218
@@ -0,0 +1,20 @@
[2019/10/28] 15:25 michael8 dropped 1 bronze arrow absX: 3234 absY: 3226
[2019/10/28] 15:25 michael8 dropped 1 bronze arrow absX: 3234 absY: 3226
[2019/10/28] 15:25 michael8 dropped 1 bronze arrow absX: 3234 absY: 3226
[2019/10/28] 15:29 michael8 dropped 1 bronze arrow absX: 3228 absY: 3219
[2019/10/28] 15:29 michael8 dropped 1 bronze arrow absX: 3226 absY: 3220
[2019/10/28] 15:29 michael8 dropped 2 bronze arrow absX: 3226 absY: 3220
[2019/10/28] 15:29 michael8 dropped 3 bronze arrow absX: 3226 absY: 3220
[2019/10/28] 15:29 michael8 dropped 4 bronze arrow absX: 3228 absY: 3220
[2019/10/28] 15:30 michael8 dropped 1 bronze arrow absX: 3229 absY: 3217
[2019/10/28] 15:30 michael8 dropped 1 bronze arrow absX: 3226 absY: 3218
[2019/10/28] 15:31 michael8 dropped 5 bronze arrow absX: 3226 absY: 3220
[2019/10/28] 15:31 michael8 dropped 6 bronze arrow absX: 3226 absY: 3220
[2019/10/28] 15:31 michael8 dropped 7 bronze arrow absX: 3226 absY: 3220
[2019/10/28] 15:31 michael8 dropped 1 iron dagger absX: 3226 absY: 3220
[2019/10/28] 15:36 michael8 dropped 1 bronze arrow absX: 3219 absY: 3222
[2019/10/28] 15:36 michael8 dropped 2 bronze arrow absX: 3219 absY: 3222
[2019/10/28] 15:36 michael8 dropped 3 bronze arrow absX: 3219 absY: 3222
[2019/10/28] 15:36 michael8 dropped 4 bronze arrow absX: 3219 absY: 3222
[2019/10/28] 15:41 michael8 dropped 1 air talisman absX: 3220 absY: 3222
[2019/10/28] 15:41 michael8 dropped 1 herb absX: 3220 absY: 3222
@@ -0,0 +1,4 @@
[2019/11/17] 15:52 andrew22 picked up knife itemX: 3224, itemY: 3202
[2019/11/17] 15:52 andrew22 picked up knife itemX: 3224, itemY: 3202
[2019/11/17] 15:54 andrew22 picked up knife itemX: 3224, itemY: 3202
[2019/11/17] 15:56 andrew22 picked up knife itemX: 3224, itemY: 3202
@@ -0,0 +1,20 @@
[2019/10/26] 21:23 michael2 picked up iron arrow itemX: 3249, itemY: 3225
[2019/10/26] 21:23 michael2 picked up bones itemX: 3249, itemY: 3225
[2019/10/26] 21:24 michael2 picked up bronze arrow itemX: 3261, itemY: 3228
[2019/10/26] 21:24 michael2 picked up bones itemX: 3261, itemY: 3228
[2019/10/26] 21:24 michael2 picked up air talisman itemX: 3261, itemY: 3228
[2019/10/26] 21:26 michael2 picked up bones itemX: 3251, itemY: 3225
[2019/10/26] 21:26 michael2 picked up bones itemX: 3260, itemY: 3229
[2019/10/26] 21:26 michael2 picked up bronze longsword itemX: 3260, itemY: 3229
[2019/10/26] 21:27 michael2 picked up bones itemX: 3262, itemY: 3229
[2019/10/26] 21:28 michael2 picked up bronze med helm itemX: 3250, itemY: 3225
[2019/10/26] 21:28 michael2 picked up bones itemX: 3250, itemY: 3225
[2019/10/26] 21:28 michael2 picked up air talisman itemX: 3250, itemY: 3225
[2019/10/26] 21:30 michael2 picked up bones itemX: 3250, itemY: 3225
[2019/10/26] 21:30 michael2 picked up goblin mail itemX: 3254, itemY: 3223
[2019/10/26] 21:31 michael2 picked up bronze sq shield itemX: 3260, itemY: 3229
[2019/10/26] 21:31 michael2 picked up bones itemX: 3260, itemY: 3229
[2019/10/26] 21:33 michael2 picked up coins itemX: 3261, itemY: 3229
[2019/10/26] 21:34 michael2 picked up bronze sq shield itemX: 3262, itemY: 3230
[2019/10/26] 21:34 michael2 picked up bronze sq shield itemX: 3254, itemY: 3223
[2019/10/26] 21:34 michael2 picked up bronze longsword itemX: 3254, itemY: 3223
@@ -0,0 +1,5 @@
[2019/10/27] 18:51 michael5 picked up bronze arrow itemX: 3248, itemY: 3226
[2019/10/27] 18:51 michael5 picked up air rune itemX: 3248, itemY: 3226
[2019/10/27] 18:51 michael5 picked up bones itemX: 3248, itemY: 3226
[2019/10/27] 18:51 michael5 picked up iron arrow itemX: 3248, itemY: 3226
[2019/10/27] 18:51 michael5 picked up bronze arrow itemX: 3249, itemY: 3226
@@ -0,0 +1,5 @@
[2019/10/28] 13:46 michael6 picked up bronze arrow itemX: 3224, itemY: 3223
[2019/10/28] 13:48 michael6 picked up bronze arrow itemX: 3220, itemY: 3223
[2019/10/28] 13:48 michael6 picked up bronze arrow itemX: 3222, itemY: 3222
[2019/10/28] 13:48 michael6 picked up bronze arrow itemX: 3220, itemY: 3225
[2019/10/28] 13:48 michael6 picked up bronze arrow itemX: 3220, itemY: 3226
@@ -0,0 +1,5 @@
[2019/10/28] 15:19 michael7 picked up bronze arrow itemX: 3234, itemY: 3222
[2019/10/28] 15:19 michael7 picked up bronze arrow itemX: 3234, itemY: 3221
[2019/10/28] 15:19 michael7 picked up bronze arrow itemX: 3234, itemY: 3220
[2019/10/28] 15:19 michael7 picked up bronze arrow itemX: 3235, itemY: 3220
[2019/10/28] 15:19 michael7 picked up bronze arrow itemX: 3234, itemY: 3218
@@ -0,0 +1,4 @@
[2019/10/28] 15:36 michael8 picked up bronze arrow itemX: 3219, itemY: 3221
[2019/10/28] 15:43 michael8 picked up air talisman itemX: 3219, itemY: 3222
[2019/10/28] 15:43 michael8 picked up herb itemX: 3219, itemY: 3222
[2019/10/28] 15:43 michael8 picked up bones itemX: 3219, itemY: 3222
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Client
@@ -21,6 +21,7 @@ import redone.game.content.music.sound.CombatSounds;
import redone.game.content.music.sound.SoundList;
import redone.game.content.skills.slayer.SlayerRequirements;
import redone.game.items.ItemAssistant;
import redone.game.npcs.Npc;
import redone.game.npcs.NpcHandler;
import redone.game.players.Client;
import redone.game.players.Player;
@@ -430,21 +431,91 @@ public class CombatAssistant {
}
}
public void attackingNpcTick() {
int i = c.npcIndex;
if (i > 0 && NpcHandler.npcs[i] != null) {
if (NpcHandler.npcs[i].isDead) {
c.npcIndex = 0;
c.followId2 = 0;
c.faceNpc(0);
return;
}
boolean projectile = c.usingBow || c.usingMagic || c.usingRangeWeapon;
if (projectile && !PathFinder.isProjectilePathClear(c.absX, c.absY, c.heightLevel, NpcHandler.npcs[i].absX, NpcHandler.npcs[i].absY)) {
return;
}
if (!c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 2) && RangeData.usingHally(c) && !c.usingRangeWeapon && !c.usingBow && !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 4) && c.usingRangeWeapon&& !c.usingBow && !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 1)&& !c.usingRangeWeapon && !RangeData.usingHally(c) && !c.usingBow && !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 8) && (c.usingBow || c.usingMagic)) {
return;
} else {
c.stopMovement();
}
}
}
public void attackingPlayerTick() {
int i = c.playerIndex;
if (i > 0 && PlayerHandler.players[i] != null) {
if (PlayerHandler.players[i].isDead) {
c.playerIndex = 0;
c.followId = 0;
c.faceNpc(0);
return;
}
boolean projectile = c.usingBow || c.usingMagic || c.usingRangeWeapon;
if (projectile && !PathFinder.isProjectilePathClear(c.absX, c.absY, c.heightLevel, PlayerHandler.players[i].absX, PlayerHandler.players[i].absY)) {
return;
}
if (!c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 4)
&& c.usingRangeWeapon
&& !c.usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 2)
&& !c.usingRangeWeapon
&& RangeData.usingHally(c)
&& !c.usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(),
getRequiredDistance())
&& !c.usingRangeWeapon
&& !RangeData.usingHally(c)
&& !c.usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 10)
&& (c.usingBow || c.usingMagic)) {
return;
} else {
c.stopMovement();
}
}
}
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) {
c.usingMagic = false;
c.faceUpdate(0);
c.npcIndex = 0;
return;
}
if (c.absY == 3228 && NpcHandler.npcs[i].absY == 3227) {
resetPlayerAttack();
return;
}
if (c.absY == 3224 && NpcHandler.npcs[i].absY == 3225) {
/*if (c.absY == 3224 && NpcHandler.npcs[i].absY == 3225) {
resetPlayerAttack();
return;
}
@@ -459,7 +530,7 @@ public class CombatAssistant {
if (c.absX == 3252 && c.absY > 3254 && c.absY < 3272 || c.absY == 3254 && c.absX > 3252 && c.absX < 3265) {
resetPlayerAttack();
return;
}
}*/
if (c.usingMagic && MagicData.MAGIC_SPELLS[c.spellId][0] == 1171) {
if (!NpcHandler.isUndead(i)) {
c.getActionSender().sendMessage("This spell only affects skeletons, zombies, ghosts and shades.");
@@ -546,12 +617,13 @@ public class CombatAssistant {
c.getActionSender().sendMessage("This monster was not spawned for you.");
return;
}
c.followId2 = i;
c.followId = 0;
if (c.attackTimer <= 0) {
boolean usingBow = false;
c.usingBow = false;
c.usingRangeWeapon = false;
boolean usingArrows = false;
boolean usingOtherRangeWeapons = false;
boolean usingCross = c.playerEquipment[c.playerWeapon] == 9185;
c.bonusAttack = 0;
c.rangeItemUsed = 0;
@@ -563,13 +635,13 @@ public class CombatAssistant {
if (c.spellId > 0) {
c.usingMagic = true;
}
c.attackTimer = getAttackDelay();
c.specAccuracy = 1.0;
c.specDamage = 1.0;
if (!c.usingMagic) {
for (int bowId : RangeData.BOWS) {
if (c.playerEquipment[c.playerWeapon] == bowId) {
usingBow = true;
c.usingBow = true;
for (int arrowId : RangeData.ARROWS) {
if (c.playerEquipment[c.playerArrows] == arrowId) {
usingArrows = true;
@@ -580,44 +652,41 @@ public class CombatAssistant {
for (int otherRangeId : RangeData.OTHER_RANGE_WEAPONS) {
if (c.playerEquipment[c.playerWeapon] == otherRangeId) {
usingOtherRangeWeapons = true;
c.usingRangeWeapon = true;
}
}
}
if (armaNpc(i) && !usingCross && !usingBow && !c.usingMagic
&& !RangeData.usingCrystalBow(c) && !usingOtherRangeWeapons) {
if (armaNpc(i) && !usingCross && !c.usingBow && !c.usingMagic
&& !RangeData.usingCrystalBow(c) && !c.usingRangeWeapon) {
resetPlayerAttack();
return;
}
if (usingOtherRangeWeapons || usingBow
if (c.usingRangeWeapon || c.usingBow
&& Constants.combatSounds
&& NpcHandler.npcs[i].npcType < 3177
&& NpcHandler.npcs[i].npcType > 3180) {
c.getActionSender().sendSound(SoundList.SHOOT_ARROW,
100, 0);
}
if (!c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 2) && RangeData.usingHally(c) && !usingOtherRangeWeapons && !usingBow && !c.usingMagic || !c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 4)
&& usingOtherRangeWeapons
&& !usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
NpcHandler.npcs[i].getX(),
NpcHandler.npcs[i].getY(), 1)
&& !usingOtherRangeWeapons
&& !RangeData.usingHally(c)
&& !usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
NpcHandler.npcs[i].getX(),
NpcHandler.npcs[i].getY(), 8)
&& (usingBow || c.usingMagic)) {
c.attackTimer = 2;
boolean projectile = c.usingBow || c.usingMagic || c.usingRangeWeapon;
if (projectile && !PathFinder.isProjectilePathClear(c.absX, c.absY, c.heightLevel, npc.absX, npc.absY)) {
return;
}
if (!c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 2) && RangeData.usingHally(c) && !c.usingRangeWeapon && !c.usingBow && !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 4) && c.usingRangeWeapon && !c.usingBow && !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 1)&& !c.usingRangeWeapon && !RangeData.usingHally(c) && !c.usingBow && !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(), NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), 8) && (c.usingBow || c.usingMagic)) {
return;
} else {
c.stopMovement();
}
if (!usingCross
&& !usingArrows
&& usingBow
&& c.usingBow
&& (c.playerEquipment[c.playerWeapon] < 4212 || c.playerEquipment[c.playerWeapon] > 4223)) {
c.getActionSender().sendMessage(
"There is no ammo left in your quiver.");
@@ -626,7 +695,7 @@ public class CombatAssistant {
return;
}
if (RangeData.correctBowAndArrows(c) < c.playerEquipment[c.playerArrows]
&& Constants.CORRECT_ARROWS && usingBow
&& Constants.CORRECT_ARROWS && c.usingBow
&& !RangeData.usingCrystalBow(c)
&& c.playerEquipment[c.playerWeapon] != 9185) {
c.getItemAssistant();
@@ -653,30 +722,14 @@ public class CombatAssistant {
return;
}
if (usingBow
if (c.usingBow
|| c.usingMagic
|| usingOtherRangeWeapons
|| c.usingRangeWeapon
|| c.goodDistance(c.getX(), c.getY(),
NpcHandler.npcs[i].getX(),
NpcHandler.npcs[i].getY(), 2) && RangeData.usingHally(c)) {
c.stopMovement();
}
/**
* Npc projectiles
*/
if (PlayerAssistant.pathBlocked(c, NpcHandler.npcs[i])) {
if((c.usingBow || c.usingMagic || usingOtherRangeWeapons || c.autocasting)) {
PathFinder.getPathFinder().findRoute(c, NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), true, 8, 8);
if(!c.usingBow && !c.usingMagic && !usingOtherRangeWeapons && !c.autocasting) {
PathFinder.getPathFinder().findRoute(c,NpcHandler.npcs[i].getX(), NpcHandler.npcs[i].getY(), true, 1, 1);
c.attackTimer = 0;
return;
}
}
}
if (!checkMagicReqs(c.spellId)) {
c.stopMovement();
@@ -685,6 +738,7 @@ public class CombatAssistant {
}
c.faceUpdate(i);
c.attackTimer = getAttackDelay();
NpcHandler.npcs[i].underAttackBy = c.playerId;
NpcHandler.npcs[i].lastDamageTaken = System.currentTimeMillis();
if (c.usingSpecial && !c.usingMagic) {
@@ -729,7 +783,7 @@ public class CombatAssistant {
}
c.lastWeaponUsed = c.playerEquipment[c.playerWeapon];
c.lastArrowUsed = c.playerEquipment[c.playerArrows];
if (!usingBow && !c.usingMagic && !usingOtherRangeWeapons) { // melee
if (!c.usingBow && !c.usingMagic && !c.usingRangeWeapon) { // melee
// hit
// delay
c.hitDelay = getHitDelay();
@@ -737,7 +791,7 @@ public class CombatAssistant {
c.oldNpcIndex = i;
}
if (usingBow && !usingOtherRangeWeapons && !c.usingMagic
if (c.usingBow && !c.usingRangeWeapon && !c.usingMagic
|| usingCross) { // range hit delay
if (usingCross) {
c.usingBow = true;
@@ -763,7 +817,7 @@ public class CombatAssistant {
fireProjectileNpc();
}
if (usingOtherRangeWeapons && !c.usingMagic && !usingBow) { // knives,
if (c.usingRangeWeapon && !c.usingMagic && !c.usingBow) { // knives,
// darts,
// etc
// hit
@@ -813,7 +867,7 @@ public class CombatAssistant {
}
}
if (usingBow && Constants.CRYSTAL_BOW_DEGRADES) { // crystal
if (c.usingBow && Constants.CRYSTAL_BOW_DEGRADES) { // crystal
// bow
// degrading
if (c.playerEquipment[c.playerWeapon] == 4212) { // new
@@ -871,13 +925,13 @@ public class CombatAssistant {
int equippedWeapon = c.playerEquipment[c.playerWeapon];
if (PlayerHandler.players[i] != null) {
if (c.usingMagic && MagicData.MAGIC_SPELLS[c.spellId][0] == 1171) {
c.getActionSender().sendMessage("This spell only affects skeletons, zombies, ghosts and shades, not humans.");
resetPlayerAttack();
c.stopMovement();
return;
}
if (c.usingMagic && MagicData.MAGIC_SPELLS[c.spellId][0] == 1171) {
c.getActionSender().sendMessage("This spell only affects skeletons, zombies, ghosts and shades, not humans.");
resetPlayerAttack();
c.stopMovement();
return;
}
if (CastleWars.isInCw(PlayerHandler.players[i])
&& CastleWars.isInCw(c)) {
@@ -935,9 +989,7 @@ public class CombatAssistant {
c.specEffect = 0;
c.usingRangeWeapon = false;
c.rangeItemUsed = 0;
boolean usingBow = false;
boolean usingArrows = false;
boolean usingOtherRangeWeapons = false;
boolean usingCross = c.playerEquipment[c.playerWeapon] == 9185;
c.projectileStage = 0;
if (c.absX == PlayerHandler.players[i].absX
@@ -953,7 +1005,7 @@ public class CombatAssistant {
if (!c.usingMagic) {
for (int bowId : RangeData.BOWS) {
if (c.playerEquipment[c.playerWeapon] == bowId) {
usingBow = true;
c.usingBow = true;
for (int arrowId : RangeData.ARROWS) {
if (c.playerEquipment[c.playerArrows] == arrowId) {
usingArrows = true;
@@ -964,7 +1016,7 @@ public class CombatAssistant {
for (int otherRangeId : RangeData.OTHER_RANGE_WEAPONS) {
if (c.playerEquipment[c.playerWeapon] == otherRangeId) {
usingOtherRangeWeapons = true;
c.usingRangeWeapon = true;
}
}
}
@@ -975,7 +1027,7 @@ public class CombatAssistant {
if (c.spellId > 0) {
c.usingMagic = true;
}
c.attackTimer = getAttackDelay();
if (c.duelRule[9]) {
boolean canUseWeapon = false;
@@ -991,12 +1043,13 @@ public class CombatAssistant {
return;
}
}
if (c.duelRule[2] && (usingBow || usingOtherRangeWeapons)) {
if (c.duelRule[2] && (c.usingBow || c.usingRangeWeapon)) {
c.getActionSender().sendMessage(
"Range has been disabled in this duel!");
return;
}
if (c.duelRule[3] && !usingBow && !usingOtherRangeWeapons
if (c.duelRule[3] && !c.usingBow && !c.usingRangeWeapon
&& !c.usingMagic) {
c.getActionSender().sendMessage(
"Melee has been disabled in this duel!");
@@ -1010,34 +1063,40 @@ public class CombatAssistant {
return;
}
boolean projectile = c.usingBow || c.usingMagic || c.usingRangeWeapon;
if (projectile && !PathFinder.isProjectilePathClear(c.absX, c.absY, c.heightLevel, PlayerHandler.players[i].absX, PlayerHandler.players[i].absY)) {
return;
}
if (!c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 4)
&& usingOtherRangeWeapons
&& !usingBow
&& c.usingRangeWeapon
&& !c.usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 2)
&& !usingOtherRangeWeapons
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 2)
&& !c.usingRangeWeapon
&& RangeData.usingHally(c)
&& !usingBow
&& !c.usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(),
getRequiredDistance())
&& !usingOtherRangeWeapons
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(),
getRequiredDistance())
&& !c.usingRangeWeapon
&& !RangeData.usingHally(c)
&& !usingBow
&& !c.usingBow
&& !c.usingMagic
|| !c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 10)
&& (usingBow || c.usingMagic)) {
PlayerHandler.players[i].getX(),
PlayerHandler.players[i].getY(), 10)
&& (c.usingBow || c.usingMagic)) {
// c.getPacketDispatcher().sendMessage("Setting attack timer to 1");
c.attackTimer = 1;
if (!usingBow && !c.usingMagic && !usingOtherRangeWeapons
//c.attackTimer = 1;
if (!c.usingBow && !c.usingMagic && !c.usingRangeWeapon
&& c.freezeTimer > 0) {
resetPlayerAttack();
}
@@ -1046,7 +1105,7 @@ public class CombatAssistant {
if (!usingCross
&& !usingArrows
&& usingBow
&& c.usingBow
&& (c.playerEquipment[c.playerWeapon] < 4212 || c.playerEquipment[c.playerWeapon] > 4223)
&& !c.usingMagic) {
c.getActionSender().sendMessage(
@@ -1056,7 +1115,7 @@ public class CombatAssistant {
return;
}
if (RangeData.correctBowAndArrows(c) < c.playerEquipment[c.playerArrows]
&& Constants.CORRECT_ARROWS && usingBow
&& Constants.CORRECT_ARROWS && c.usingBow
&& !RangeData.usingCrystalBow(c)
&& c.playerEquipment[c.playerWeapon] != 9185
&& !c.usingMagic) {
@@ -1065,12 +1124,12 @@ public class CombatAssistant {
c.getActionSender().sendMessage(
"You can't use "
+ ItemAssistant.getItemName(
c.playerEquipment[c.playerArrows])
.toLowerCase()
c.playerEquipment[c.playerArrows])
.toLowerCase()
+ "s with a "
+ ItemAssistant.getItemName(
c.playerEquipment[c.playerWeapon])
.toLowerCase() + ".");
c.playerEquipment[c.playerWeapon])
.toLowerCase() + ".");
c.stopMovement();
resetPlayerAttack();
return;
@@ -1084,25 +1143,11 @@ public class CombatAssistant {
return;
}
if (usingBow || c.usingMagic || usingOtherRangeWeapons
if (c.usingBow || c.usingMagic || c.usingRangeWeapon
|| RangeData.usingHally(c)) {
c.stopMovement();
}
/**
* Player projectiles
*/
if(PlayerAssistant.pathBlocked(c, o)) {
if((c.usingBow || c.usingMagic || usingOtherRangeWeapons || c.autocasting)) {
PathFinder.getPathFinder().findRoute(c, o.absX, o.absY, true, 8, 8);
if(!c.usingBow && !c.usingMagic && !usingOtherRangeWeapons && !c.autocasting) {
PathFinder.getPathFinder().findRoute(c, o.absX, o.absY, true, 1, 1);
c.attackTimer = 0;
return;
}
}
}
if (!checkMagicReqs(c.spellId)) {
c.stopMovement();
resetPlayerAttack();
@@ -1116,7 +1161,7 @@ public class CombatAssistant {
&& FightPits.getState(c) == null) {
if (!c.attackedPlayers.contains(c.playerIndex)
&& !PlayerHandler.players[c.playerIndex].attackedPlayers
.contains(c.playerId)) {
.contains(c.playerId)) {
c.attackedPlayers.add(c.playerIndex);
c.isSkulled = true;
c.skullTimer = Constants.SKULL_TIMER;
@@ -1183,24 +1228,26 @@ public class CombatAssistant {
0);
}
}
c.attackTimer = getAttackDelay();
PlayerHandler.players[i].underAttackBy = c.playerId;
PlayerHandler.players[i].logoutDelay = System.currentTimeMillis();
PlayerHandler.players[i].singleCombatDelay = System.currentTimeMillis();
PlayerHandler.players[i].killerId = c.playerId;
c.lastArrowUsed = 0;
c.rangeItemUsed = 0;
if (!usingBow && !c.usingMagic && !usingOtherRangeWeapons) { // melee
// hit
// delay;
if (!c.usingBow && !c.usingMagic && !c.usingRangeWeapon) { // melee
// hit
// delay;
c.followId = PlayerHandler.players[c.playerIndex].playerId;
c.getPlayerAssistant().followPlayer();
//c.getPlayerAssistant().followPlayer();
c.hitDelay = getHitDelay();
c.delayedDamage = Misc.random(meleeMaxHit());
c.projectileStage = 0;
c.oldPlayerIndex = i;
}
if (usingBow && !usingOtherRangeWeapons && !c.usingMagic
if (c.usingBow && !c.usingRangeWeapon && !c.usingMagic
|| usingCross) { // range hit delay
if (c.playerEquipment[c.playerWeapon] >= 4212
&& c.playerEquipment[c.playerWeapon] <= 4223) {
@@ -1219,7 +1266,7 @@ public class CombatAssistant {
c.usingBow = true;
c.followId = PlayerHandler.players[c.playerIndex].playerId;
c.getPlayerAssistant().followPlayer();
//c.getPlayerAssistant().followPlayer();
c.lastWeaponUsed = c.playerEquipment[c.playerWeapon];
c.lastArrowUsed = c.playerEquipment[c.playerArrows];
c.gfx100(RangeData.getRangeStartGFX(c));
@@ -1229,12 +1276,12 @@ public class CombatAssistant {
fireProjectilePlayer();
}
if (usingOtherRangeWeapons) { // knives, darts, etc hit delay
if (c.usingRangeWeapon) { // knives, darts, etc hit delay
c.rangeItemUsed = c.playerEquipment[c.playerWeapon];
c.getItemAssistant().deleteEquipment();
c.usingRangeWeapon = true;
c.followId = PlayerHandler.players[c.playerIndex].playerId;
c.getPlayerAssistant().followPlayer();
//c.getPlayerAssistant().followPlayer();
c.gfx100(RangeData.getRangeStartGFX(c));
if (c.fightMode == 2) {
c.attackTimer--;
@@ -1307,42 +1354,42 @@ public class CombatAssistant {
}
}
if (usingBow && Constants.CRYSTAL_BOW_DEGRADES) { // crystal
// bow
// degrading
if (c.usingBow && Constants.CRYSTAL_BOW_DEGRADES) { // crystal
// bow
// degrading
if (c.playerEquipment[c.playerWeapon] == 4212) { // new
// crystal
// bow
// becomes
// full
// bow
// on
// the
// first
// shot
// crystal
// bow
// becomes
// full
// bow
// on
// the
// first
// shot
c.getItemAssistant().wearItem(4214, 1, 3);
}
if (c.crystalBowArrowCount >= 250) {
switch (c.playerEquipment[c.playerWeapon]) {
case 4223: // 1/10 bow
c.getItemAssistant().wearItem(-1, 1, 3);
c.getActionSender().sendMessage(
"Your crystal bow has fully degraded.");
if (!c.getItemAssistant().addItem(4207, 1)) {
Server.itemHandler.createGroundItem(c, 4207,
c.getX(), c.getY(), 1, c.getId());
}
c.crystalBowArrowCount = 0;
break;
case 4223: // 1/10 bow
c.getItemAssistant().wearItem(-1, 1, 3);
c.getActionSender().sendMessage(
"Your crystal bow has fully degraded.");
if (!c.getItemAssistant().addItem(4207, 1)) {
Server.itemHandler.createGroundItem(c, 4207,
c.getX(), c.getY(), 1, c.getId());
}
c.crystalBowArrowCount = 0;
break;
default:
c.getItemAssistant().wearItem(
++c.playerEquipment[c.playerWeapon], 1, 3);
c.getActionSender().sendMessage(
"Your crystal bow degrades.");
c.crystalBowArrowCount = 0;
break;
default:
c.getItemAssistant().wearItem(
++c.playerEquipment[c.playerWeapon], 1, 3);
c.getActionSender().sendMessage(
"Your crystal bow degrades.");
c.crystalBowArrowCount = 0;
break;
}
}
}
@@ -23,15 +23,15 @@ public class Specials {
// ItemName(ItemId, SpecDamage, SpecAccuracy, SpecAmount, Anim, GFX0,
// GFX100, DoubleHit, SsSpec, SpecEffect)
ABYSSAL_WHIP(4151, 1, 1, 5, 1658, 341, -1, false, false, 0),
DRAGON_DAGGER(1215, .95, 1.15, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_DAGGER_P(1231, .85, 1.15, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_DAGGER_PP(5698, .85, 1.15, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_DAGGER_PPP(5680, .85, 1.15, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_LONG(1305, 1.20, 1.10, 2.5, 1058, -1, 248, false, false, 0),
DRAGON_MACE(1434, 1.55, .85, 2.5, 1060, -1, 251, false, false, 0),
DRAGON_SCIMITAR(4587, 1, 1, 5.5, 1872, -1, 347, false, false, 1),
DRAGON_HALBERD(3204, 1.25, .85, 3.3, 1203, -1, 282, true, false, 0),
ABYSSAL_WHIP(4151, 1, 1.25, 5, 1658, 341, -1, false, false, 0),
DRAGON_DAGGER(1215, 1.15, 1.25, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_DAGGER_P(1231, 1.15, 1.25, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_DAGGER_PP(5698, 1.15, 1.25, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_DAGGER_PPP(5680, 1.15, 1.25, 2.5, 1062, -1, 252, true, false, 0),
DRAGON_LONG(1305, 1.20, 1.10, 2.5, 1058, -1, 248, false, false, 0),
DRAGON_MACE(1434, 1.55, 1.25, 2.5, 1060, -1, 251, false, false, 0),
DRAGON_SCIMITAR(4587, 1, 1.25, 5.5, 1872, -1, 347, false, false, 1),
DRAGON_HALBERD(3204, 1.25, .85, 3, 1203, -1, 282, true, false, 0),
GRANITE_MAUL(4153, 1.10, .85, 5, 1667, -1, 337, false, false, 0),
MAGIC_SHORTBOW(861, 1.05, .95, 5.5, 1074, -1, -1, true, false, 0),
MAGIC_LONGBOW(859, 1.20, 1.05, 5.5, 426, -1, -1, false, false, 0);
@@ -359,7 +359,7 @@ public class Specials {
player.playerLevel[2] = player.getLevelForXP(player.playerXP[2]) + player.getLevelForXP(player.playerXP[2]) * 15 / 100;
player.getPlayerAssistant().refreshSkill(2);
player.getItemAssistant().updateSpecialBar();
} else {
} else {
player.getActionSender().sendMessage("You don't have the required special energy to use this attack.");
}
}
@@ -51,31 +51,37 @@ public class MagicTeleports {
public static final boolean MAGIC_LEVEL_REQUIRED = true, RUNES_REQUIRED = true;
public static boolean teleportCheck(Client player) {
if (player.teleTimer > 0) {
return false;
}
return true;
}
public static void paddewwaTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 1}, {AIR_RUNE, 1}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 54) {
player.getActionSender().sendMessage("You need a magic level of 54 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 1}, {AIR_RUNE, 1}});
player.getPlayerAssistant().startTeleport(PADDEWWA_X + Misc.random(2), PADDEWWA_Y - Misc.random(2), 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(64, player.playerMagic);
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 1}, {AIR_RUNE, 1}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 54) {
player.getActionSender().sendMessage("You need a magic level of 54 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 1}, {AIR_RUNE, 1}});
player.getPlayerAssistant().startTeleport(PADDEWWA_X + Misc.random(2), PADDEWWA_Y - Misc.random(2), 0, "ancient");
player.getPlayerAssistant().addSkillXP(64, player.playerMagic);
}
public static void senntisenTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
@@ -93,12 +99,11 @@ public class MagicTeleports {
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {SOUL_RUNE, 1}});
player.getPlayerAssistant().startTeleport(SENNTISTEN_X + Misc.random(1), SENNTISTEN_Y - Misc.random(1), 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(70, player.playerMagic);
}
public static void kharyllTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
@@ -116,60 +121,57 @@ public class MagicTeleports {
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {BLOOD_RUNE, 1}});
player.getPlayerAssistant().startTeleport(KHARYRLL_X, KHARYRLL_Y, 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(76, player.playerMagic);
}
public static void lassarTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 4}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 4}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 72) {
player.getActionSender().sendMessage("You need a magic level of 72 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 4}});
player.getPlayerAssistant().startTeleport(LASSAR_X + Misc.random(2), LASSAR_Y - Misc.random(2), 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(82, player.playerMagic);
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 72) {
player.getActionSender().sendMessage("You need a magic level of 72 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 4}});
player.getPlayerAssistant().startTeleport(LASSAR_X + Misc.random(2), LASSAR_Y - Misc.random(2), 0, "ancient");
player.getPlayerAssistant().addSkillXP(82, player.playerMagic);
}
public static void dareeyakTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 3}, {AIR_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 78) {
player.getActionSender().sendMessage("You need a magic level of 78 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 3}, {AIR_RUNE, 2}});
player.getPlayerAssistant().startTeleport(
DAREEYAK_X + Misc.random(1),
DAREEYAK_Y - Misc.random(1), 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(88, player.playerMagic);
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 3}, {AIR_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 78) {
player.getActionSender().sendMessage("You need a magic level of 78 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 3}, {AIR_RUNE, 2}});
player.getPlayerAssistant().startTeleport(
DAREEYAK_X + Misc.random(1),
DAREEYAK_Y - Misc.random(1), 0, "ancient");
player.getPlayerAssistant().addSkillXP(88, player.playerMagic);
}
public static void carrallangarTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
@@ -189,12 +191,11 @@ public class MagicTeleports {
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {SOUL_RUNE, 2}});
player.getPlayerAssistant().startTeleport(CARRALLANGAR_X + Misc.random(2), CARRALLANGAR_Y - Misc.random(2), 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(94, player.playerMagic);
}
public static void annakarlTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
@@ -212,224 +213,214 @@ public class MagicTeleports {
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {BLOOD_RUNE, 2}});
player.getPlayerAssistant().startTeleport(ANNAKARL_X + Misc.random(1), ANNAKARL_Y - Misc.random(1), 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(100, player.playerMagic);
}
public static void ghorrockTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 8}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 8}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 96) {
player.getActionSender().sendMessage("You need a magic level of 96 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 8}});
player.getPlayerAssistant().startTeleport(GHORROCK_X + Misc.random(3),
GHORROCK_Y - Misc.random(3), 0, "ancient");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(106, player.playerMagic);
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 96) {
player.getActionSender().sendMessage("You need a magic level of 96 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 8}});
player.getPlayerAssistant().startTeleport(GHORROCK_X + Misc.random(3),
GHORROCK_Y - Misc.random(3), 0, "ancient");
player.getPlayerAssistant().addSkillXP(106, player.playerMagic);
}
public static void varrockTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {FIRE_RUNE, 1}, {AIR_RUNE, 3}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 25) {
player.getActionSender().sendMessage("You need a magic level of 25 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {FIRE_RUNE, 1}, {AIR_RUNE, 3}});
player.getPlayerAssistant().startTeleport(VARROCK_X + Misc.random(2), VARROCK_Y - Misc.random(2), 0, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(35, player.playerMagic);
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {FIRE_RUNE, 1}, {AIR_RUNE, 3}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 25) {
player.getActionSender().sendMessage("You need a magic level of 25 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {FIRE_RUNE, 1}, {AIR_RUNE, 3}});
player.getPlayerAssistant().startTeleport(VARROCK_X + Misc.random(2), VARROCK_Y - Misc.random(2), 0, "modern");
player.getPlayerAssistant().addSkillXP(35, player.playerMagic);
}
public static void lumbridgeTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {EARTH_RUNE, 1}, {AIR_RUNE, 3}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 32) {
player.getActionSender().sendMessage("You need a magic level of 32 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {EARTH_RUNE, 1}, {AIR_RUNE, 3}});
player.getPlayerAssistant().startTeleport(LUMBRIDGE_X, LUMBRIDGE_Y, 0, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(35, player.playerMagic);
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {EARTH_RUNE, 1}, {AIR_RUNE, 3}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 32) {
player.getActionSender().sendMessage("You need a magic level of 32 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {EARTH_RUNE, 1}, {AIR_RUNE, 3}});
player.getPlayerAssistant().startTeleport(LUMBRIDGE_X, LUMBRIDGE_Y, 0, "modern");
player.getPlayerAssistant().addSkillXP(35, player.playerMagic);
}
public static void faladorTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {WATER_RUNE, 1}, {AIR_RUNE, 3}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 37) {
player.getActionSender().sendMessage("You need a magic level of 37 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {WATER_RUNE, 1}, {AIR_RUNE, 3}});
player.getPlayerAssistant().startTeleport(FALADOR_X + Misc.random(4), FALADOR_Y - Misc.random(4), 0, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(48, player.playerMagic);
/*if (!teleportCheck(player)) {
return;
}*/
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {WATER_RUNE, 1}, {AIR_RUNE, 3}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 37) {
player.getActionSender().sendMessage("You need a magic level of 37 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {WATER_RUNE, 1}, {AIR_RUNE, 3}});
player.getPlayerAssistant().startTeleport(FALADOR_X + Misc.random(4), FALADOR_Y - Misc.random(4), 0, "modern");
player.getPlayerAssistant().addSkillXP(48, player.playerMagic);
}
public static void camelotTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {AIR_RUNE, 5}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 1}, {AIR_RUNE, 5}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 45) {
player.getActionSender().sendMessage("You need a magic level of 45 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {AIR_RUNE, 5}});
// 2757, 3479
player.getPlayerAssistant().startTeleport(CAMELOT_X + Misc.random(1), CAMELOT_Y - Misc.random(1), 0, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(55.5, player.playerMagic);
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 45) {
player.getActionSender().sendMessage("You need a magic level of 45 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 1}, {AIR_RUNE, 5}});
// 2757, 3479
player.getPlayerAssistant().startTeleport(CAMELOT_X + Misc.random(1), CAMELOT_Y - Misc.random(1), 0, "modern");
player.getPlayerAssistant().addSkillXP(55.5, player.playerMagic);
}
public static void ardougneTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 51) {
player.getActionSender().sendMessage("You need a magic level of 51 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 2}});
player.getPlayerAssistant().startTeleport(ARDOUGNE_X + Misc.random(4),
ARDOUGNE_Y - Misc.random(4), 0, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(61, player.playerMagic);
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 51) {
player.getActionSender().sendMessage("You need a magic level of 51 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {WATER_RUNE, 2}});
player.getPlayerAssistant().startTeleport(ARDOUGNE_X + Misc.random(4),
ARDOUGNE_Y - Misc.random(4), 0, "modern");
player.getPlayerAssistant().addSkillXP(61, player.playerMagic);
}
public static void watchTowerTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {EARTH_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {EARTH_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 58) {
player.getActionSender().sendMessage(
"You need a magic level of 58 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {EARTH_RUNE, 2}});
player.getPlayerAssistant().startTeleport(WATCHTOWER_X, WATCHTOWER_Y, 1, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(68, player.playerMagic);
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 58) {
player.getActionSender().sendMessage(
"You need a magic level of 58 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {EARTH_RUNE, 2}});
player.getPlayerAssistant().startTeleport(WATCHTOWER_X, WATCHTOWER_Y, 1, "modern");
player.getPlayerAssistant().addSkillXP(68, player.playerMagic);
}
public static void trollhiemTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}})) {
player.getActionSender().sendMessage("You don't have the required runes to cast this spell.");
return;
}
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 61) {
player.getActionSender().sendMessage("You need a magic level of 61 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}});
player.getPlayerAssistant().startTeleport(2892 + Misc.random(2),
3679 - Misc.random(2), 0, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(68, player.playerMagic);
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 61) {
player.getActionSender().sendMessage("You need a magic level of 61 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}});
player.getPlayerAssistant().startTeleport(2892 + Misc.random(2),
3679 - Misc.random(2), 0, "modern");
player.getPlayerAssistant().addSkillXP(68, player.playerMagic);
}
public static void apeAtollTeleport(Client player) {
if (System.currentTimeMillis() - player.lastCast < 5000) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}, {WATER_RUNE, 2}}) || !player.getItemAssistant().playerHasItem(BANANA, 1)) {
player.getActionSender().sendMessage("You don't have the required items to cast this spell.");
return;
}
}
if (player.questPoints < 19) {
player.getActionSender().sendMessage("You need " + 19 + " quest points to teleport here.");
return;
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 64) {
player.getActionSender().sendMessage("You need a magic level of 64 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}, {WATER_RUNE, 2}});
player.getItemAssistant().deleteItem2(BANANA, 1);
player.getPlayerAssistant().startTeleport(2798 + Misc.random(1), 2798 - Misc.random(1), 1, "modern");
player.lastCast = System.currentTimeMillis();
player.getPlayerAssistant().addSkillXP(76, player.playerMagic);
if (!teleportCheck(player)) {
return;
}
RandomEventHandler.addRandom(player);
if (RUNES_REQUIRED) {
if (!CastRequirements.hasRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}, {WATER_RUNE, 2}}) || !player.getItemAssistant().playerHasItem(BANANA, 1)) {
player.getActionSender().sendMessage("You don't have the required items to cast this spell.");
return;
}
}
if (player.questPoints < 19) {
player.getActionSender().sendMessage("You need " + 19 + " quest points to teleport here.");
return;
}
if (MAGIC_LEVEL_REQUIRED) {
if (player.playerLevel[player.playerMagic] < 64) {
player.getActionSender().sendMessage("You need a magic level of 64 to cast this spell.");
return;
}
}
CastRequirements.deleteRunes(player, new int[][]{{LAW_RUNE, 2}, {FIRE_RUNE, 2}, {WATER_RUNE, 2}});
player.getItemAssistant().deleteItem2(BANANA, 1);
player.getPlayerAssistant().startTeleport(2798 + Misc.random(1), 2798 - Misc.random(1), 1, "modern");
player.getPlayerAssistant().addSkillXP(76, player.playerMagic);
}
}
@@ -12,8 +12,8 @@ public class NpcAggressive {
private static final int[] AGGRESSIVE_MONSTERS = {
1155, 374, 1157, 1158, 1159, 1160, 141, 1459, 1456, 96, 97, 142,
2550, 2551, 2552, 2553, 2558, 2559, 2560, 2561, 2562, 2563,
2564, 2565, 2892, 2894, 2881, 2882, 2883, 172, 1593, 144, 112, 84, 3068,
50, 1590, 1591, 1592, 53, 54, 55, 178, 49, 174, 2455, 2456, 2454,
2564, 2565, 2892, 2894, 2881, 2882, 2883, 1593, 144, 112, 84, 3068,
50, 1590, 1591, 1592, 53, 54, 55, 178, 49, 2455, 2456, 2454,
82, 752, 1608, 1609, 1610, 1827, 2783, 1926, 1931, 2457, 412, 1604, 1612,
110, 1611, 83, 941, 49, 117, 111, 125, 1154, 107, 1342, 1338, 447, 448, 449, 917,
1265, 1267
@@ -231,6 +231,14 @@ public class NpcCombat {
NpcHandler.npcs[i].projectileId, 43, 31,
-c.getId() - 1, 65);
}
int random = Misc.random(10);
if (NpcHandler.npcs[i].npcType == 222 && (NpcHandler.npcs[i].killerId > 0 && NpcHandler.npcs[i].underAttack) && !NpcHandler.npcs[i].isDead && (NpcHandler.npcs[i].HP < NpcHandler.npcs[i].MaxHP + 1)) {
if (random < 3) {
NpcHandler.npcs[i].HP += 2;
//NpcHandler.npcs[i].startAnimation(84);
NpcHandler.npcs[i].updateRequired = true;
}
}
c.underAttackBy2 = i;
c.singleCombatDelay2 = System.currentTimeMillis();
NpcHandler.npcs[i].oldIndex = c.playerId;
@@ -412,7 +412,7 @@ public class DwarfCannon {
private Npc targetNpc() {
for (int i = 0; i < NpcHandler.maxNPCs; i++) {
for (int i = 0; i < NpcHandler.MAX_NPCS; i++) {
if (NpcHandler.npcs[i] == null) {
continue;
}
@@ -89,12 +89,9 @@ public class SandwhichLady {
if (itemType == 5) {
player.getPlayerAssistant().closeAllWindows();
player.getItemAssistant().addItem(6965, 1);
player.getActionSender()
.sendMessage(
"Congratulations, you have completed the random event!");
player.getActionSender().sendMessage("Congratulations, you have completed the random event!");
} else {
player.getActionSender().sendMessage(
"You have chosen the wrong item!");
player.getActionSender().sendMessage("You have chosen the wrong item!");
RandomEventHandler.failEvent(player);
}
player.hasSandwhichLady = false;
@@ -104,9 +101,7 @@ public class SandwhichLady {
if (itemType == 6) {
player.getPlayerAssistant().closeAllWindows();
player.getItemAssistant().addItem(2309, 1);
player.getActionSender()
.sendMessage(
"Congratulations, you have completed the random event!");
player.getActionSender().sendMessage("Congratulations, you have completed the random event!");
} else {
player.getActionSender().sendMessage("You have chosen the wrong item!");
RandomEventHandler.failEvent(player);
@@ -202,6 +202,7 @@ public class Woodcutting {
}
public static void startWoodcutting(final Client player, final int j, final int x, final int y, final int type) {
CycleEventHandler.getSingleton().stopEvents(player, "WoodcuttingEvent".hashCode());
if (player.isWoodcutting || player.isFletching || player.isFiremaking || player.playerIsFletching) {
return;
}
@@ -236,7 +237,7 @@ public class Woodcutting {
return;
}
if (Misc.goodDistance(player.objectX, player.objectY, player.absX, player.absY, 3)) {
if (player.isWoodcutting == true) {
if (player.isWoodcutting) {
player.getActionSender().sendMessage("You are already woodcutting!");
return;
}
@@ -258,7 +259,7 @@ public class Woodcutting {
} else {
player.getActionSender().sendMessage("You swing your axe at the tree.");
}
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
CycleEventHandler.getSingleton().addEvent("WoodcuttingEvent".hashCode(), player, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -6,10 +6,10 @@ public class AbyssalHandler {
public static void handleAbyssalTeleport(Client c, int objectId) {
switch (objectId) {
case 7147:// added
case 7147: // squeeze through gap
c.getPlayerAssistant().movePlayer(3030, 4842, 0);
break;
case 7133:// added nature
case 7133: // nature
c.getPlayerAssistant().startTeleport(2395, 4841, 0, "modern");
break;
case 7132: // cosmic
@@ -30,31 +30,23 @@ public class AbyssalHandler {
case 7139: // air
c.getPlayerAssistant().startTeleport(2844, 4837, 0, "modern");
break;
case 7138: // soul
c.getActionSender().sendMessage("This altar is disabled atm.");
break;
case 7141: // blood
c.getActionSender().sendMessage("This altar is disabled atm.");
break;
case 7137: // water
c.getPlayerAssistant().startTeleport(2722, 4833, 0, "modern");
break;
case 7136: // death
c.getPlayerAssistant().startTeleport(2205, 4834, 0, "modern");
break;
case 7135:
case 7135: // law
c.getPlayerAssistant().startTeleport(2464, 4830, 0, "modern");
break;
case 7134: // chaos
c.getPlayerAssistant().startTeleport(2274, 4842, 0, "modern");
break;
default:
c.getActionSender().sendMessage(
"If you see this message, please PM an Administrator.");
case 7138: // soul
case 7141: // blood
c.getActionSender().sendMessage("This altar is currently disabled.");
break;
}
c.getActionSender().sendMessage(
"As you click the object, you teleport to a mystical place...");
}
}
@@ -33,22 +33,21 @@ public class Runecrafting {
if (c.absY <= yPos) {
Y = "North";
}
c.getActionSender().sendMessage(
"You need to travel " + Y + "-" + X + ".");
c.getActionSender().sendMessage("You need to travel " + Y + "-" + X + ".");
}
private enum Altars {
AIR_ALTAR(2452, new int[] { 1438, 5527 }, new int[] { 2842, 4829 }), MIND_ALTAR(
2453, new int[] { 1448, 5529 }, new int[] { 2793, 4828 }), WATER_ALTAR(
2454, new int[] { 1444, 5531 }, new int[] { 2713, 4836 }), EARTH_ALTAR(
2455, new int[] { 1440, 5535 }, new int[] { 2655, 4831 }), FIRE_ALTAR(
2456, new int[] { 1442, 5537 }, new int[] { 2577, 4845 }), BODY_ALTAR(
2457, new int[] { 1446, 5533 }, new int[] { 2521, 4834 }), COSMIC_ALTAR(
2458, new int[] { 1454, 5539 }, new int[] { 2162, 4833 }), CHAOS_ALTAR(
2461, new int[] { 1452, 5543 }, new int[] { 2268, 4842 }),
NATURE_ALTAR(2460, new int[] { 1462, 5541 }, new int[] { 2400, 4835 }), LAW_ALTAR(
2459, new int[] { 1458, 5545 }, new int[] { 2464, 4819 }), DEATH_ALTAR(
2462, new int[] { 1456, 5547 }, new int[] { 2208, 4831 });
AIR_ALTAR(2452, new int[] { 1438, 5527 }, new int[] { 2842, 4829 }),
MIND_ALTAR(2453, new int[] { 1448, 5529 }, new int[] { 2793, 4828 }),
WATER_ALTAR(2454, new int[] { 1444, 5531 }, new int[] { 2713, 4836 }),
EARTH_ALTAR(2455, new int[] { 1440, 5535 }, new int[] { 2655, 4831 }),
FIRE_ALTAR(2456, new int[] { 1442, 5537 }, new int[] { 2577, 4845 }),
BODY_ALTAR(2457, new int[] { 1446, 5533 }, new int[] { 2521, 4834 }),
COSMIC_ALTAR(2458, new int[] { 1454, 5539 }, new int[] { 2162, 4833 }),
CHAOS_ALTAR(2461, new int[] { 1452, 5543 }, new int[] { 2268, 4842 }),
NATURE_ALTAR(2460, new int[] { 1462, 5541 }, new int[] { 2400, 4835 }),
LAW_ALTAR(2459, new int[] { 1458, 5545 }, new int[] { 2464, 4819 }),
DEATH_ALTAR(2462, new int[] { 1456, 5547 }, new int[] { 2208, 4831 });
int objId;
int[] keys, loc;
@@ -81,50 +80,35 @@ public class Runecrafting {
c.nextChat = 0;
return;
}*/
if (a.getKeys()[1] == c.playerEquipment[c.playerHat]
|| a.getKeys()[0] == itemUse) {
c.getPlayerAssistant().movePlayer(a.getNewLoc()[0],
a.getNewLoc()[1], 0);
c.getActionSender().sendMessage(
"You enter the mysterious ruins.");
if (a.getKeys()[1] == c.playerEquipment[c.playerHat] || a.getKeys()[0] == itemUse) {
c.getPlayerAssistant().movePlayer(a.getNewLoc()[0], a.getNewLoc()[1], 0);
c.getActionSender().sendMessage("You enter the mysterious ruins.");
} else {
c.getActionSender().sendMessage(
"Nothing interesting happens.");
c.getActionSender().sendMessage("Nothing interesting happens.");
}
}
}
private enum Altar_Data {
AIR(2478, 1, 6, 556, new int[][] { { 11, 2 }, { 22, 3 }, { 33, 4 },
{ 44, 5 }, { 55, 6 }, { 66, 7 }, { 77, 8 }, { 88, 9 },
{ 99, 9 } }), MIND(2479, 5, 6, 558, new int[][] { { 14, 2 },
{ 28, 3 }, { 42, 4 }, { 56, 5 }, { 70, 6 }, { 84, 7 },
{ 98, 8 } }), WATER(2480, 9, 7, 555, new int[][] { { 19, 2 },
{ 38, 3 }, { 57, 4 }, { 76, 5 }, { 95, 6 } }), EARTH(2481, 9,
7, 557, new int[][] { { 26, 2 }, { 52, 3 }, { 78, 4 } }), FIRE(
2482, 14, 7, 554,
new int[][] { { 26, 2 }, { 52, 3 }, { 78, 4 } }), BODY(2483,
20, 8, 559, new int[][] { { 35, 2 }, { 70, 3 } }), COSMIC(2484,
27, 9, 564, new int[][] { { 59, 2 } }), CHAOS(2487, 35, 9, 562,
new int[][] { { 74, 2 } }), // was 2485, 35,
// 9, 562, new
// int[][]{{74,
// 2}}
NATURE(2486, 44, 10, 561, new int[][] { { 91, 2 } }), LAW(2485, 54, 11,
563, new int[][] { { 100, 2 } }), // was 2487, 54,
// 11, 563, new
// int[][]{{100,
// 2}})
DEATH(2488, 65, 13, 560, new int[][] { { 100, 2 } }), BLOOD(2489, 77,
15, 565, new int[][] { { 100, 2 } }), SOUL(2490, 90, 17, 566,
new int[][] { { 100, 2 } }), ASTRAL(17010, 40, 10, 9075,
new int[][] { { 82, 2 } });
AIR(2478, 1, 6, 556, new int[][] { { 11, 2 }, { 22, 3 }, { 33, 4 }, { 44, 5 }, { 55, 6 }, { 66, 7 }, { 77, 8 }, { 88, 9 }, { 99, 9 } }),
MIND(2479, 5, 6, 558, new int[][] { { 14, 2 }, { 28, 3 }, { 42, 4 }, { 56, 5 }, { 70, 6 }, { 84, 7 }, { 98, 8 } }),
WATER(2480, 9, 7, 555, new int[][] { { 19, 2 }, { 38, 3 }, { 57, 4 }, { 76, 5 }, { 95, 6 } }),
EARTH(2481, 9, 7, 557, new int[][] { { 26, 2 }, { 52, 3 }, { 78, 4 } }),
FIRE(2482, 14, 7, 554, new int[][] { { 26, 2 }, { 52, 3 }, { 78, 4 } }),
BODY(2483, 20, 8, 559, new int[][] { { 35, 2 }, { 70, 3 } }),
COSMIC(2484, 27, 9, 564, new int[][] { { 59, 2 } }),
CHAOS(2487, 35, 9, 562, new int[][] { { 74, 2 } }),
NATURE(2486, 44, 10, 561, new int[][] { { 91, 2 } }),
LAW(2485, 54, 11, 563, new int[][] {}),
DEATH(2488, 65, 13, 560, new int[][] {}),
BLOOD(2489, 77, 15, 565, new int[][] {}),
SOUL(2490, 90, 17, 566, new int[][] {}),
ASTRAL(17010, 40, 10, 9075, new int[][] { { 82, 2 } });
int altarID, levelReq, xp, rewardedRune;
int[][] multiRunes;
private Altar_Data(int altarID, int levelReq, int xp, int rewardedRune,
int[][] multiRunes) {
private Altar_Data(int altarID, int levelReq, int xp, int rewardedRune, int[][] multiRunes) {
this.altarID = altarID;
this.levelReq = levelReq;
this.xp = xp;
@@ -159,20 +143,16 @@ public class Runecrafting {
if (ad != null) {
RandomEventHandler.addRandom(c);
if (!SkillHandler.RUNECRAFTING) {
c.getActionSender().sendMessage(
"This skill is currently disabled.");
c.getActionSender().sendMessage("This skill is currently disabled.");
return false;
}
if (c.playerLevel[c.playerRunecrafting] >= ad.levelReq) {
getMultiSupport(obj);
c.startAnimation(791);
c.gfx100(186);
c.getActionSender().sendSound(SoundList.RUNECRAFTING, 100,
0);
c.getActionSender().sendSound(SoundList.RUNECRAFTING, 100, 0);
} else {
c.getActionSender().sendMessage(
"You need a runecrafting level of at least "
+ ad.levelReq + " to make runes here.");
c.getActionSender().sendMessage("You need a runecrafting level of at least " + ad.levelReq + " to make runes here.");
}
}
return false;
@@ -184,47 +164,22 @@ public class Runecrafting {
int amount = c.getItemAssistant().getItemCount(7936);
int amount2 = c.getItemAssistant().getItemCount(1436);
if (amount2 > 0 && amount > 0) {
c.getItemAssistant().deleteItem(7936,
c.getItemAssistant().getItemCount(7936));
c.getItemAssistant().addItem(
ad.rewardedRune,
amount
* (getMultiplier(ad) == 1 ? getMultiplier(ad)
: getMultiplier(ad) - 1));
c.getPlayerAssistant().addSkillXP(ad.xp * amount,
c.playerRunecrafting);
c.getItemAssistant().deleteItem(1436,
c.getItemAssistant().getItemCount(1436));
c.getItemAssistant().addItem(
ad.rewardedRune,
amount2
* (getMultiplier(ad) == 1 ? getMultiplier(ad)
: getMultiplier(ad) - 1));
c.getPlayerAssistant().addSkillXP(ad.xp * amount2,
c.playerRunecrafting);
c.getItemAssistant().deleteItem(7936, c.getItemAssistant().getItemCount(7936));
c.getItemAssistant().addItem(ad.rewardedRune, amount * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount, c.playerRunecrafting);
c.getItemAssistant().deleteItem(1436, c.getItemAssistant().getItemCount(1436));
c.getItemAssistant().addItem(ad.rewardedRune, amount2 * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount2, c.playerRunecrafting);
} else if (amount > 0) {
c.getItemAssistant().deleteItem(7936,
c.getItemAssistant().getItemCount(7936));
c.getItemAssistant().addItem(
ad.rewardedRune,
amount
* (getMultiplier(ad) == 1 ? getMultiplier(ad)
: getMultiplier(ad) - 1));
c.getPlayerAssistant().addSkillXP(ad.xp * amount,
c.playerRunecrafting);
c.getItemAssistant().deleteItem(7936, c.getItemAssistant().getItemCount(7936));
c.getItemAssistant().addItem(ad.rewardedRune, amount * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount, c.playerRunecrafting);
} else if (amount2 > 0) {
c.getItemAssistant().deleteItem(1436,
c.getItemAssistant().getItemCount(1436));
c.getItemAssistant().addItem(
ad.rewardedRune,
amount2
* (getMultiplier(ad) == 1 ? getMultiplier(ad)
: getMultiplier(ad) - 1));
c.getPlayerAssistant().addSkillXP(ad.xp * amount2,
c.playerRunecrafting);
c.getItemAssistant().deleteItem(1436, c.getItemAssistant().getItemCount(1436));
c.getItemAssistant().addItem(ad.rewardedRune, amount2 * (getMultiplier(ad) <= 1 ? 1 : getMultiplier(ad)));
c.getPlayerAssistant().addSkillXP(ad.xp * amount2, c.playerRunecrafting);
} else {
c.getActionSender().sendMessage(
"You don't have any essence left.");
c.getActionSender().sendMessage("You don't have any essence left.");
}
}
}
@@ -8,10 +8,17 @@ import redone.util.Misc;
public class Slayer {
public static final int VERY_EASY_TASK = 0, EASY_TASK = 1, MEDIUM_TASK = 2,
HARD_TASK = 3, VERY_HARD_TASK = 4, VERY_EASY_AMOUNT = 15 + r(25),
EASY_AMOUNT = 25 + r(25), MEDIUM_AMOUNT = 50 + r(25),
HARD_AMOUNT = 100 + r(50), VERY_HARD_AMOUNT = 130 + r(70),
public static final int
VERY_EASY_TASK = 0,
EASY_TASK = 1,
MEDIUM_TASK = 2,
HARD_TASK = 3,
VERY_HARD_TASK = 4,
VERY_EASY_AMOUNT = 15 + r(25),
EASY_AMOUNT = 25 + r(25),
MEDIUM_AMOUNT = 50 + r(25),
HARD_AMOUNT = 100 + r(50),
VERY_HARD_AMOUNT = 130 + r(70),
DRAGON_AMOUNT = 10 + r(40);
public static ArrayList<Integer> veryEasyTask = new ArrayList<Integer>();
@@ -27,18 +34,19 @@ public class Slayer {
}
public enum SlayerMasters {
TURAEL(70, 1, "Taverly", "Turael"), MAZCHNA(1596, 20, "Canifis",
"Mazchna"), VANNAKA(1597, 40, "Edgeville", "Vannaka"), CHAELDAR(
1598, 70, "Zanaris", "Chaeldar"), DURADEL(1599, 100,
"Shilo Village", "Duradel");
TURAEL(70, 1, VERY_EASY_TASK,"Taverly", "Turael"),
MAZCHNA(1596, 20, EASY_TASK, "Canifis", "Mazchna"),
VANNAKA(1597, 40, MEDIUM_TASK, "Edgeville", "Vannaka"),
CHAELDAR(1598, 70, HARD_TASK, "Zanaris", "Chaeldar"),
DURADEL(1599, 100, VERY_HARD_TASK, "Shilo Village", "Duradel");
private int masterId, combatReq;
private int masterId, combatReq, diffuculty;
private String masterLocation, masterName;
private SlayerMasters(int masterId, int combatReq,
String masterLocation, String masterName) {
private SlayerMasters(int masterId, int combatReq, int diffuculty, String masterLocation, String masterName) {
this.masterId = masterId;
this.combatReq = combatReq;
this.diffuculty = diffuculty;
this.masterLocation = masterLocation;
this.masterName = masterName;
}
@@ -59,13 +67,17 @@ public class Slayer {
return masterName;
}
public int getDifficulty() {
return diffuculty;
}
}
//dark beast, red dragon, skeleton
public enum Task {
ABERRANT_SPECTRE(1604, 60, 90, 3, "Slayer Tower"),
ABYSSAL_DEMON(1615, 85, 150, 4, "Slayer Tower"),
BANSHEE(1612, 15, 22, 0 + r(2), "Slayer Tower"),
BANSHEE(1612, 15, 22, 0 + r(1), "Slayer Tower"),
BASILISK(1616, 40, 75, 2, "Fremennik Slayer Dungeon"),
BAT(412, 1, 8, 1, "Road to Paterdomus"),
BLACK_DEMON(84, 1, 157, 3, "Taverly Dungeon"),
@@ -74,10 +86,10 @@ public class Slayer {
BLUE_DRAGON(55, 1, 107, 3, "Taverly Dungeon"),
BRONZE_DRAGON(1590, 1, 125, 3, "Brimhaven Dungeon"),
CAVE_CRAWLER(1600, 10, 22, 1, "Fremennik Slayer Dungeon"),
COCKATRICE(1620, 25, 37, 2, "Fremennik Slayer Dungeon"),
COCKATRICE(1620, 25, 37, 2, "Fremennik Slayer Dungeon"),
CRAWLING_HAND(1648, 5, 16 + r(3), 1 + r(1), "Slayer Tower"),
DAGANNOTH_74(1338, 1, 70 + r(50), 3, "Lighthouse Basement"),
DAGANNOTH_92(1342, 1, 70 + r(50), 3, "Lighthouse Basement"),
DAGANNOTH_92(1342, 1, 80 + r(50), 3, "Lighthouse Basement"),
DARK_BEAST(2783, 90, 180, 4, "Slayer Tower"),
DUST_DEVIL(1624, 65, 105, 2, "Slayer Tower"),
EARTH_WARRIOR(124, 1, 54, 2, "Edgeville Dungeon"),
@@ -92,7 +104,7 @@ public class Slayer {
ICE_WARRIOR(125, 1, 59, 2, "Asgarnian Ice Caves or the Wilderness"),
SKELETAL_WYVERN(3068, 72, 210, 4, "Asgarnian Ice Caves"),
INFERNAL_MAGE(1643, 45, 60, 2, "Slayer Tower"),
IRON_DRAGON(1591, 1, (int) 173.2, 4, "Brimhaven Dungeon"),
IRON_DRAGON(1591, 1, 174, 4, "Brimhaven Dungeon"),
JELLY(1637, 52, 75, 2, "Fremennik Slayer Dungeon"),
KALPHITE_WORKER(1156, 1, 40, 1 + r(1), "Kalphite Lair"),
KALPHITE_SOLDIER(1154, 1, 90, 3, "Kalphite Lair"),
@@ -103,12 +115,12 @@ public class Slayer {
NECHRYAELS(1613, 80, 1, 3, "Slayer Tower"),
PYREFIEND(1633, 30, 1, 1, "Fremennik Slayer Dungeon"),
RED_DRAGON(53, 1, 120, 3, "Brimhaven Dungeon"),
ROCKSLUG(1622, 20, 27, 1, "Fremennik Slayer Dungeon"),
SKELETON(90, 1, 30, 0 + r(2), "Edgeville Dungeon or Taverly Dungeon"),
ROCKSLUG(1622, 20, 27, 1, "Fremennik Slayer Dungeon"),
SKELETON(90, 1, 30, 0 + r(2), "Edgeville Dungeon or Taverly Dungeon"),
KARAMAJA_SKELETON(91, 1, 30, 0 + r(2), "Karamaja"),
WILDERNESS_SKELETON(92, 1, 30, 0 + r(2), "Wilderness"),
STEEL_DRAGON(1592, 1, 221, 4, "Brimhaven Dungeon"),
GRIZZLY_BEAR(105, 1, 27, 0, "Goblin Village"),
WILDERNESS_SKELETON(92, 1, 30, 0 + r(2), "Wilderness"),
STEEL_DRAGON(1592, 1, 221, 4, "Brimhaven Dungeon"),
BEAR(105, 1, 27, 0, "Goblin Village"),
GREEN_GOBLIN(298, 1, 6, 0, "Goblin Village"),
RED_GOBLIN(299, 1, 6, 0, "Goblin Village"),
SCORPION(107, 1, 17, 0, "Goblin Village"),
@@ -122,7 +134,7 @@ public class Slayer {
this.exp = exp;
this.levelReq = levelReq;
this.location = location;
diff = difficulty;
this.diff = difficulty;
}
public int getNpcId() {
@@ -198,13 +210,11 @@ public class Slayer {
}
}
public boolean getMasterRequirment(int id) {
public static boolean getMasterRequirment(Client c, int id) {
for (SlayerMasters slayermasters : SlayerMasters.values()) {
if (c.combatLevel < slayermasters.getCombatRequirement()
&& slayermasters.getId() == id) {
c.getActionSender().sendMessage(
"You need " + slayermasters.getCombatRequirement()
+ " combat to use this slayer master.");
c.getActionSender().sendMessage("You need " + slayermasters.getCombatRequirement() + " combat to use this slayer master.");
return false;
}
}
@@ -309,8 +319,7 @@ public class Slayer {
public void generateTask() {
if (hasTask() && !c.needsNewTask) {
c.getDialogueHandler().sendDialogues(1226, c.npcType);// already have
// task
c.getDialogueHandler().sendDialogues(1226, c.npcType);// already have task
return;
}
if (hasTask() && c.needsNewTask) {// assigning new task
@@ -331,7 +340,7 @@ public class Slayer {
*/
}
}
int taskLevel = getSlayerDifficulty();
int taskLevel = getSlayerDifficulty(c);
// System.out.println("EASY :" + easyTask + "\nMEDIUM: " + mediumTask+
// "\nHARD: " + hardTask + "");
for (Task slayerTask : Task.values()) {
@@ -342,8 +351,7 @@ public class Slayer {
int task = getRandomTask(taskLevel);
for (int removedTask : c.removedTasks) {
if (task == removedTask) {
c.getActionSender().sendMessage(
"Unavailable task: " + task);
c.getActionSender().sendMessage("Unavailable task: " + task);
generateTask();
return;
}
@@ -354,8 +362,7 @@ public class Slayer {
int task = getRandomTask(getDifficulty(taskLevel - 1));
for (int removedTask : c.removedTasks) {
if (task == removedTask) {
c.getActionSender().sendMessage(
"Unavailable task: " + task);
c.getActionSender().sendMessage("Unavailable task: " + task);
generateTask();
return;
}
@@ -364,12 +371,8 @@ public class Slayer {
c.taskAmount = getTaskAmount(getDifficulty(c.slayerTask) - 1);
c.needsNewTask = false;
}
c.getDialogueHandler().sendDialogues(1237, c.npcType);// assign
// task
c.getActionSender().sendMessage(
"You have been assigned " + c.taskAmount + " "
+ getTaskName(c.slayerTask)
+ ", good luck " + c.playerName + ".");
c.getDialogueHandler().sendDialogues(1237, c.npcType);// assign task
c.getActionSender().sendMessage("You have been assigned " + c.taskAmount + " " + getTaskName(c.slayerTask) + ", good luck " + c.playerName + ".");
return;
}
}
@@ -392,18 +395,11 @@ public class Slayer {
return EASY_AMOUNT;
}
public int getSlayerDifficulty() {
if (c.combatLevel > 0 && c.combatLevel < 20) {
return VERY_EASY_TASK;
} else if (c.combatLevel >= 20 && c.combatLevel < 40) {
return EASY_TASK;
} else if (c.combatLevel >= 40 && c.combatLevel < 70) {
return MEDIUM_TASK;
} else if (c.combatLevel >= 70 && c.combatLevel < 100) {
return HARD_TASK;
} else if (c.combatLevel >= 100) {
return VERY_HARD_TASK;
}
public int getSlayerDifficulty(Client c) {
for(SlayerMasters master : SlayerMasters.values()){
if (master.getId() == c.SlayerMaster)
return master.getDifficulty();
}
return EASY_TASK;
}
@@ -424,16 +420,13 @@ public class Slayer {
public void handleInterface(String shop) {
if (shop.equalsIgnoreCase("buy")) {
c.getPlayerAssistant().sendFrame126(
"Slayer Points: " + c.slayerPoints, 41011);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints, 41011);
c.getPlayerAssistant().showInterface(41000);
} else if (shop.equalsIgnoreCase("learn")) {
c.getPlayerAssistant().sendFrame126(
"Slayer Points: " + c.slayerPoints, 41511);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints, 41511);
c.getPlayerAssistant().showInterface(41500);
} else if (shop.equalsIgnoreCase("assignment")) {
c.getPlayerAssistant().sendFrame126(
"Slayer Points: " + c.slayerPoints, 42011);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints, 42011);
updateCurrentlyRemoved();
c.getPlayerAssistant().showInterface(42000);
}
@@ -441,24 +434,18 @@ public class Slayer {
public void cancelTask() {
if (!hasTask()) {
c.getActionSender().sendMessage(
"You must have a task to cancel first.");
c.getActionSender().sendMessage("You must have a task to cancel first.");
return;
}
if (c.slayerPoints < 30) {
c.getActionSender()
.sendMessage(
"This requires atleast 30 slayer points, which you don't have.");
c.getDialogueHandler()
.sendNpcChat1(
"This requires atleast 30 slayer points, which you don't have.",
c.npcType, NpcHandler.getNpcListName(c.talkingNpc));
c.getActionSender().sendMessage("This requires atleast 30 slayer points, which you don't have.");
c.getDialogueHandler().sendNpcChat1("This requires atleast 30 slayer points, which you don't have.",
c.npcType,
NpcHandler.getNpcListName(c.talkingNpc));
c.nextChat = 0;
return;
}
c.getActionSender().sendMessage(
"You have cancelled your current task of " + c.taskAmount + " "
+ getTaskName(c.slayerTask) + ".");
c.getActionSender().sendMessage("You have cancelled your current task of " + c.taskAmount + " " + getTaskName(c.slayerTask) + ".");
c.slayerTask = -1;
c.taskAmount = 0;
c.slayerPoints -= 30;
@@ -467,18 +454,14 @@ public class Slayer {
public void removeTask() {
int counter = 0;
if (!hasTask()) {
c.getActionSender().sendMessage(
"You must have a task to remove first.");
c.getActionSender().sendMessage("You must have a task to remove first.");
return;
}
if (c.slayerPoints < 100) {
c.getActionSender()
.sendMessage(
"This requires atleast 100 slayer points, which you don't have.");
c.getDialogueHandler()
.sendNpcChat1(
"This requires atleast 100 slayer points, which you don't have.",
c.npcType, NpcHandler.getNpcListName(c.talkingNpc));
c.getActionSender().sendMessage("This requires atleast 100 slayer points, which you don't have.");
c.getDialogueHandler().sendNpcChat1("This requires atleast 100 slayer points, which you don't have.",
c.npcType,
NpcHandler.getNpcListName(c.talkingNpc));
c.nextChat = 0;
return;
}
@@ -487,8 +470,7 @@ public class Slayer {
counter++;
}
if (counter == 4) {
c.getActionSender().sendMessage(
"You don't have any open slots left to remove tasks.");
c.getActionSender().sendMessage("You don't have any open slots left to remove tasks.");
return;
}
if (c.removedTasks[i] == -1) {
@@ -496,9 +478,7 @@ public class Slayer {
c.slayerPoints -= 100;
c.slayerTask = -1;
c.taskAmount = 0;
c.getActionSender()
.sendMessage(
"Your current slayer task has been removed, you can't obtain this task again.");
c.getActionSender().sendMessage("Your current slayer task has been removed, you can't obtain this task again.");
updateCurrentlyRemoved();
return;
}
@@ -506,12 +486,9 @@ public class Slayer {
}
public void updatePoints() {
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints,
41011);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints,
41511);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints,
42011);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints, 41011);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints, 41511);
c.getPlayerAssistant().sendFrame126("Slayer Points: " + c.slayerPoints, 42011);
}
public void updateCurrentlyRemoved() {
@@ -531,17 +508,13 @@ public class Slayer {
return;
}
if (c.slayerPoints < 50) {
c.getActionSender()
.sendMessage(
"You need at least 50 slayer points to gain 32,500 Experience.");
c.getActionSender().sendMessage( "You need at least 50 slayer points to gain 32,500 Experience.");
return;
}
c.buySlayerTimer = System.currentTimeMillis();
c.slayerPoints -= 50;
c.getPlayerAssistant().addSkillXP(16250, 18);
c.getActionSender()
.sendMessage(
"You spend 50 slayer points and gain 16,250 experience in slayer.");
c.getPlayerAssistant().addSkillXP(32500, 18);
c.getActionSender().sendMessage("You spend 50 slayer points and gain 32,500 experience in slayer.");
updatePoints();
}
@@ -550,23 +523,19 @@ public class Slayer {
return;
}
if (c.slayerPoints < 35) {
c.getActionSender().sendMessage(
"You need at least 35 slayer points to buy Slayer darts.");
c.getActionSender().sendMessage("You need at least 35 slayer points to buy Slayer darts.");
return;
}
if (c.getItemAssistant().freeSlots() < 2
&& !c.getItemAssistant().playerHasItem(560)
&& !c.getItemAssistant().playerHasItem(558)) {
c.getActionSender().sendMessage(
"You need at least 2 free lots to purchase this.");
c.getActionSender().sendMessage("You need at least 2 free lots to purchase this.");
return;
}
c.buySlayerTimer = System.currentTimeMillis();
c.slayerPoints -= 35;
c.getActionSender()
.sendMessage(
"You spend 35 slayer points and aquire 250 casts of Slayer darts.");
c.getActionSender().sendMessage("You spend 35 slayer points and aquire 250 casts of Slayer darts.");
c.getItemAssistant().addItem(558, 1000);
c.getItemAssistant().addItem(560, 250);
updatePoints();
@@ -577,20 +546,17 @@ public class Slayer {
return;
}
if (c.slayerPoints < 25) {
c.getActionSender().sendMessage(
"You need at least 25 slayer points to buy Broad arrows.");
c.getActionSender().sendMessage("You need at least 25 slayer points to buy Broad arrows.");
return;
}
if (c.getItemAssistant().freeSlots() < 1
&& !c.getItemAssistant().playerHasItem(4160)) {
c.getActionSender().sendMessage(
"You need at least 1 free lot to purchase this.");
c.getActionSender().sendMessage("You need at least 1 free lot to purchase this.");
return;
}
c.buySlayerTimer = System.currentTimeMillis();
c.slayerPoints -= 25;
c.getActionSender().sendMessage(
"You spend 35 slayer points and aquire 250 Broad arrows.");
c.getActionSender().sendMessage("You spend 35 slayer points and aquire 250 Broad arrows.");
c.getItemAssistant().addItem(4160, 250);
updatePoints();
}
@@ -600,16 +566,12 @@ public class Slayer {
return;
}
if (c.slayerPoints < 25) {
c.getActionSender()
.sendMessage(
"You need at least 25 slayer points to buy Slayer's respite.");
c.getActionSender().sendMessage("You need at least 25 slayer points to buy Slayer's respite.");
return;
}
c.buySlayerTimer = System.currentTimeMillis();
c.slayerPoints -= 25;
c.getActionSender()
.sendMessage(
"You spend 25 slayer points and aquire a useful Slayer's respite.");
c.getActionSender().sendMessage("You spend 25 slayer points and aquire a useful Slayer's respite.");
c.getItemAssistant().addItem(5841, 1);
updatePoints();
}
@@ -217,7 +217,7 @@ public class Stalls {
}
private static void failGuards(final Client c) {
for (int i = 1; i < NpcHandler.maxNPCs; i ++) {
for (int i = 1; i < NpcHandler.MAX_NPCS; i ++) {
if (NpcHandler.npcs[i] != null) {
if (NpcHandler.npcs[i].npcType == 32
|| NpcHandler.npcs[i].npcType == 1317
@@ -6,6 +6,7 @@ import redone.game.content.quests.QuestRewards;
import redone.game.content.randomevents.FreakyForester;
import redone.game.content.randomevents.RandomEventHandler;
import redone.game.content.skills.SkillHandler;
import redone.game.content.skills.slayer.Slayer;
import redone.game.content.traveling.Sailing;
import redone.game.globalworldobjects.PassDoor;
import redone.game.items.ItemAssistant;
@@ -4221,6 +4222,7 @@ public class DialogueHandler {
sendNpcChat1("Hummph.", player.talkingNpc, "Saniboch");
player.nextChat = 0;
break;
// Slayer masters
case 1226:
sendNpcChat2("You already have a slayer task",
"please finish it talk to me again.", player.talkingNpc,
@@ -4235,10 +4237,13 @@ public class DialogueHandler {
player.nextChat = 0;
break;
case 1228:
sendNpcChat1("'Ello and what are you after then?",
player.talkingNpc,
NpcHandler.getNpcListName(player.talkingNpc));
player.nextChat = 1229;
if (!Slayer.getMasterRequirment(player, player.talkingNpc)) {
sendNpcChat1("Increase your combat level then come back.", player.talkingNpc, NpcHandler.getNpcListName(player.talkingNpc));
player.nextChat = 0;
} else {
sendNpcChat1("'Ello and what are you after then?", player.talkingNpc, NpcHandler.getNpcListName(player.talkingNpc));
player.nextChat = 1229;
}
break;
case 1229:
sendOption4("I need another assignement.",
@@ -4267,14 +4272,11 @@ public class DialogueHandler {
break;
case 1235:
if (player.getSlayer().hasTask()) {
sendNpcChat1("Your Slayer Task is located at "
+ player.getSlayer().getLocation(player.slayerTask)
+ ".", player.talkingNpc,
NpcHandler.getNpcListName(player.talkingNpc));
sendNpcChat1("Your Slayer Task is located at " + player.getSlayer().getLocation(player.slayerTask) + ".", player.talkingNpc, NpcHandler.getNpcListName(player.talkingNpc));
player.nextChat = 0;
} else {
sendNpcChat2("You don't have a slayer task",
"if you wish to get one talk to a slayer mask.",
"if you wish to get one talk to a slayer master.",
player.talkingNpc,
NpcHandler.getNpcListName(player.talkingNpc));
player.nextChat = 0;
@@ -4285,9 +4287,9 @@ public class DialogueHandler {
player.nextChat = 0;
break;
case 1237:
sendNpcChat2("You have been assigned " + player.taskAmount + " "
+ player.getSlayer().getTaskName(player.slayerTask) + ",",
"Good luck " + player.playerName + ".", player.talkingNpc,
sendNpcChat2("You have been assigned " + player.taskAmount + " " + player.getSlayer().getTaskName(player.slayerTask) + ",",
"Good luck " + player.playerName + ".",
player.talkingNpc,
NpcHandler.getNpcListName(player.talkingNpc));
player.nextChat = 0;
break;
@@ -36,6 +36,7 @@ public class GateHandler {
private static void openDoubleGate(Client player, int objectId, int objectId2, int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4, int face1, int face2) {
if (isGate(objectId) && isGate(objectId2) && gateAmount == 0) {
// open gate from default map object
spawnGate(-1, x3, y3, player.heightLevel, 0);
spawnGate(-1, x4, y4, player.heightLevel, 0);
spawnGate(objectId, x1, y1, player.heightLevel, face1);
@@ -47,6 +48,7 @@ public class GateHandler {
ObjectManager.doubleGateTicks(player, objectId, x3, y3, x1, y1, x2, y2, player.heightLevel, face2, gateTicks);
ObjectManager.doubleGateTicks(player, objectId2, x4, y4, x1, y1, x2, y2, player.heightLevel, face2, gateTicks);
} else if (isGate(objectId) && isGate(objectId2) && gateAmount == 2) {
// close gate back to default
ObjectManager.doubleGateTicks(player, objectId, x3, y3, x1, y1, x2, y2, player.heightLevel, face2, 0);
ObjectManager.doubleGateTicks(player, objectId2, x4, y4, x1, y1, x2, y2, player.heightLevel, face2, 0);
}
@@ -20,13 +20,17 @@ public class PassDoor {
client.getActionSender().sendMessage("You must wait longer to pass this door.");
return false;
}
client.getActionSender().object(objectType, client.objectX, client.objectY, height, face1, type);
final int objX = client.objectX;
final int objY = client.objectY;
client.getActionSender().object(objectType, objX, objY, height, face1, type);
client.getPlayerAssistant().walkTo(x, y);
client.stopPlayer = true;
CycleEventHandler.getSingleton().addEvent(client, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
client.getActionSender().object(objectType, client.objectX, client.objectY, height, face2, type);
client.getActionSender().object(objectType, objX, objY, height, face2, type);
container.stop();
}
@@ -96,6 +100,7 @@ public class PassDoor {
if (Position.checkPosition(client, 3108, 3162, 0)) {
passThroughDoor(client, objectType, 2, 1, 9, -1, -1, 0);
} else if (Position.checkPosition(client, 3107, 3163, 0)) {
// wizz tower
passThroughDoor(client, objectType, 2, 1, 9, -1, -1, 0);
} else {
if (client.heightLevel == 0) {
+267 -269
View File
@@ -1,269 +1,267 @@
package redone.game.items;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import redone.Constants;
import redone.Server;
public class Item {
public static int capes[] = { 2731, 2677, 2683, 2680, 2701, 2686, 2689,
2692, 2737, 2734, 2716, 2728, 2695, 2713, 2725, 2722, 2707, 2704,
2710, 2719, 2737, 2698, 14590, 2701, 8102, 8075, 8044, 8045, 8042,
8043, 8037, 8038, 8025, 8026, 8018, 7858, 7994, 7983, 7984, 7985,
7986, 7987, 7982, 7978, 3781, 3783, 3785, 3787, 3789, 3777, 3779,
3759, 3761, 3763, 3765, 6111, 6570, 6568, 1007, 1019, 1021, 1023,
1027, 1029, 1031, 1052, 2412, 2413, 2414, 4304, 4315, 4317, 4319,
4321, 4323, 4325, 4327, 4329, 4331, 4333, 4335, 4337, 4339, 4341,
4343, 4345, 4347, 4349, 4351, 4353, 4355, 4357, 4359, 4361, 4363,
4365, 4367, 4369, 4371, 4373, 4375, 4377, 4379, 4381, 4383, 4385,
4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401, 4403, 4405, 4407,
4409, 4411, 4413, 4514, 4516, 6070, 6568, 6570, 4304, 3759, 3761,
3763, 3765, 3777, 3779, 3781, 3783, 3785, 3787, 3789 };
public static int boots[] = { 7596, 8029, 6619, 8017, 7159, 7991, 6666,
6061, 6106, 88, 89, 626, 628, 630, 632, 634, 1061, 1837, 1846,
2577, 2579, 2894, 2904, 2914, 2924, 2934, 3061, 3105, 3107, 3791,
4097, 4107, 4117, 4119, 4121, 4123, 4125, 4127, 4129, 4131, 4310,
5064, 5345, 5557, 6069, 6106, 6143, 6145, 6147, 6328, 6920, 6349,
6357, 3393 };
public static int gloves[] = { 7595, 6629, 8021, 8016, 7964, 2491, 1065,
2487, 2489, 3060, 1495, 775, 777, 778, 6708, 1059, 1063, 1065,
1580, 2487, 2489, 2491, 2902, 2912, 2922, 2932, 2942, 3060, 3799,
4095, 4105, 4115, 4308, 5556, 6068, 6110, 6149, 6151, 6153, 6922,
7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 6330, 3391,
776 };
public static int shields[] = { 7676, 7342, 7348, 7354, 7360, 7334, 7340,
7347, 7352, 7358, 7356, 7350, 7344, 8087, 8058, 8059, 8060, 8061,
8062, 8063, 6633, 7977, 7976, 7972, 7959, 6591, 7332, 7338, 7336,
7360, 1171, 1173, 1175, 1177, 1179, 1181, 1183, 1185, 1187, 1189,
1191, 1193, 1195, 1197, 1199, 1201, 1540, 2589, 2597, 2603, 2611,
2621, 2629, 2659, 2667, 2675, 2890, 3122, 3488, 3758, 3839, 3840,
3841, 3842, 3843, 3844, 4072, 4156, 4224, 4225, 4226, 4227, 4228,
4229, 4230, 4231, 4232, 4233, 4234, 4302, 4507, 4512, 6215, 6217,
6219, 6221, 6223, 6225, 6227, 6229, 6231, 6233, 6235, 6237, 6239,
6241, 6243, 6245, 6247, 6249, 6251, 6253, 6255, 6257, 6259, 6261,
6263, 6265, 6267, 6269, 6271, 6273, 6275, 6277, 6279, 6524, 6889,
7051, 7053 };
public static int hats[] = { 2679, 1025, 2685, 4166, 2682, 2703, 2688,
2691, 2691, 2733, 2736, 2718, 2730, 2697, 2715, 2727, 2724, 2709,
2706, 2712, 2721, 2739, 2700, 2518, 2524, 2526, 7319, 7321, 7323,
7325, 7327, 1167, 8077, 8076, 8074, 4168, 1169, 8034, 8035, 8036,
8030, 6623, 8024, 8023, 8022, 8013, 1169, 7594, 7995, 7996, 7997,
7998, 7999, 8000, 8001, 7992, 7990, 7975, 7973, 7971, 7967, 7963,
6665, 6665, 7321, 6886, 6547, 6548, 2645, 2647, 2649, 4856, 4857,
4858, 4859, 4880, 4881, 4882, 4883, 4904, 4905, 4906, 4907, 4928,
4929, 4930, 4931, 4952, 4953, 4954, 4955, 4976, 4977, 4978, 4979,
4732, 4753, 4611, 6188, 6182, 4511, 4056, 4071, 4724, 2639, 2641,
2643, 2665, 6109, 5525, 5527, 5529, 5531, 5533, 5535, 5537, 5539,
5541, 5543, 5545, 5547, 5549, 5551, 74, 579, 656, 658, 660, 662,
664, 740, 1017, 1037, 1040, 1042, 1044, 1046, 1038, 1048, 1050,
1053, 1055, 1057, 1137, 1139, 1141, 1143, 1145, 1147, 1149, 1151,
1153, 1155, 1157, 1159, 1161, 1163, 1165, 1506, 1949, 2422, 2581,
2587, 2595, 2605, 2613, 2619, 2627, 2631, 2633, 2635, 2637, 2651,
2657, 2673, 2900, 2910, 2920, 2930, 2940, 2978, 2979, 2980, 2981,
2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992,
2993, 2994, 2995, 3057, 3385, 3486, 3748, 3749, 3751, 3753, 3797,
4041, 4042, 4071, 4089, 3755, 4099, 4109, 4164, 4302, 4506, 4511,
4513, 4515, 4551, 4567, 4708, 4716, 4724, 4745, 4753, 4857, 4858,
4859, 4880, 4881, 4882, 4883, 4904, 4905, 4906, 4907, 4952, 4953,
4954, 4955, 4976, 4977, 4978, 4979, 5013, 5014, 5554, 5574, 6109,
6128, 6131, 6137, 6182, 6188, 6335, 6337, 6339, 6345, 6355, 6365,
6375, 6382, 6392, 6400, 6918, 6656, 2581, 7539, 7394, 7396, 7534,
5574, 6885, 6858, 6860, 6862, 6856, 6326, 6128, 6137, 7400, 7323,
7325, 7327, 7003, 4168, 7112, 7124, 7130, 7136 };
public static int amulets[] = { 1654, 1656, 1658, 1660, 1662, 1664, 8081,
8033, 7968, 6585, 86, 87, 295, 421, 552, 589, 1478, 1692, 1694,
1696, 1698, 1700, 1702, 1704, 1706, 1708, 1710, 1712, 1725, 1727,
1729, 1731, 4021, 4081, 4250, 4677, 6040, 6041, 6208, 1718, 1722,
6859, 6863, 6857, 3853, 3855, 3857, 3859, 3861, 3863, 3865, 3867,
1718, 4306, 1702 };
public static int arrows[] = { 11212, 8052, 9211, 9010, 9209, 9208, 9207,
9206, 9205, 9203, 9301, 8065, 7919, 7906, 7988, 7989, 78, 598, 877,
878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890,
891, 892, 893, 942, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539,
2540, 2541, 2866, 4160, 4172, 4173, 4174, 4175, 4740, 5616, 5617,
5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 5627, 6061,
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, 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,
7960, 3793, 3775, 3773, 3771, 3769, 3767, 6139, 1135, 2499, 2501,
1035, 540, 5553, 4757, 1833, 6388, 6384, 4111, 4101, 4091, 6186,
6184, 6180, 3058, 4509, 4504, 4069, 4728, 4736, 4712, 6107, 2661,
3140, 1101, 1103, 1105, 1107, 1109, 1111, 1113, 1115, 1117, 1119,
1121, 1123, 1125, 1127, 1129, 1131, 1133, 2583, 2591, 2599, 2607,
2615, 2623, 2653, 2669, 3481, 4712, 4720, 4728, 4749, 4892, 4893,
4894, 4895, 4916, 4917, 4918, 4919, 4964, 4965, 4966, 4967, 6107,
6133, 6322, 6322, 6129, 75, 6916, 6916, 4111, 6654, 6654, 75, 7399,
7390, 7374, 5575, 2503, 6341, 6351, 3387, 5030, 5032, 5034, 5030,
5032, 5034, 7392, 546, 581 };
public static int legs[] = { 7609, 2522, 7378, 7380, 7382, 7368, 7366,
7388, 646, 648, 650, 652, 654, 428, 1097, 1095, 7593, 8032, 8028,
6625, 8020, 8015, 7384, 7969, 7966, 7962, 6141, 538, 1033, 5555,
4759, 6386, 6390, 2497, 2495, 2493, 1099, 4113, 4103, 4093, 6924,
6187, 6185, 6181, 3059, 4510, 4505, 4070, 6108, 542, 548, 1011,
1013, 1015, 1067, 1069, 1071, 1073, 1075, 1077, 1079, 1081, 1083,
1085, 1087, 1089, 1091, 1093, 2585, 2593, 2601, 2609, 2617, 2625,
2655, 2663, 2671, 3059, 3389, 3472, 3473, 3474, 3475, 3476, 3477,
3478, 3479, 3480, 3483, 3485, 3795, 4087, 4585, 4712, 4714, 4722,
4730, 4738, 4751, 4759, 4874, 4875, 4876, 4877, 4898, 4899, 4900,
4901, 4922, 4923, 4924, 4925, 4946, 4947, 4948, 4949, 4970, 4971,
4972, 4973, 4994, 4995, 4996, 4997, 5048, 5050, 5052, 5576, 6107,
6130, 6187, 6390, 6386, 6390, 6394, 6396, 6402, 6404, 6135, 6809, 6916, 4091,
4111, 6655, 6654, 7398, 7398, 7386, 6324, 6343, 6353, 6363, 6373, 3387, 5036,
5038, 5040, 5042, 5044, 5046, 5050, 5052, 4300, 1835, 7116, 7126, 6752,
7132, 7138 };
public static int platebody[] = { 10338, 7608, 2520, 430, 636, 638, 640,
642, 644, 426, 430, 8031, 8027, 6617, 8019, 8014, 8002, 544, 577,
7974, 7970, 7965, 7961, 7960, 3793, 3773, 3775, 3771, 3769, 3767,
6139, 1035, 540, 5553, 4757, 1833, 1835, 6388, 6384, 4111, 4101,
4868, 4869, 4870, 4871, 4892, 4893, 4894, 4895, 4916, 4917, 4918,
4919, 4940, 4941, 4942, 4943, 4964, 4965, 4966, 4967, 4988, 4989,
4990, 0x2f9a0eb, 6186, 6184, 6180, 3058, 4509, 4504, 4069, 4728,
4736, 4712, 6107, 2661, 3140, 1115, 1117, 1119, 1121, 1123, 1125,
1127, 2583, 2591, 2599, 2607, 2615, 6322, 2623, 2653, 2669, 3481,
4720, 4728, 4749, 2661, 6129, 6916, 4091, 6654, 6133, 75, 7399,
7390, 5575, 6341, 6351, 3387, 5024, 5030, 5032, 5034, 7392, 6786, 6788 };
/* Fullbody is an item that covers your arms. */
private static String[] fullbody = {
"top", "shirt", "platebody",
"Ahrims robetop", "Karils leathertop", "brassard", "Robe top",
"robetop", "platebody (t)", "platebody (g)", "chestplate", "torso",
"hauberk", "Dragon chainbody", "gown", "Shade robe", "Wizard robe",
"Druid's robe", "Black robe", "Fremennik robe", "Robe of elidinis",
"tunic", "blouse"
};
/* Fullhat covers your head but not your beard. */
private static String[] fullhat = { "med helm", "coif", "Dharok's helm",
"hood", "Initiate helm", "Coif", "Helm of neitiznot",
"Armadyl helmet", "Berserker helm", "Archer helm", "Farseer helm",
"Warrior helm", "Void" };
/* Fullmask covers your entire head. */
private static String[] fullmask = { "full helm", "mask", "Verac's helm",
"Guthan's helm", "Karil's coif", "mask", "Torag's helm", "Void",
"sallet", "Facemask" };
public static boolean isFullBody(int itemId) {
String weapon = getItemName(itemId);
if (weapon == null) {
return false;
}
for (String element : fullbody) {
if (weapon.endsWith(element)) {
return true;
}
}
return false;
}
public static boolean isFullHelm(int itemId) {
String weapon = getItemName(itemId);
if (weapon == null) {
return false;
}
for (String element : fullhat) {
if (weapon.endsWith(element)) {
return true;
}
}
return false;
}
public static boolean isFullMask(int itemId) {
String weapon = getItemName(itemId);
if (weapon == null) {
return false;
}
for (String element : fullmask) {
if (weapon.endsWith(element)) {
return true;
}
}
return false;
}
public static String getItemName(int id) {
for (ItemList element : Server.itemHandler.ItemList) {
if (element != null) {
if (element.itemId == id) {
return element.itemName;
}
}
}
return null;
}
public static boolean[] itemStackable = new boolean[Constants.ITEM_LIMIT];
public static boolean[] itemIsNote = new boolean[Constants.ITEM_LIMIT];
public static int[] targetSlots = new int[Constants.ITEM_LIMIT];
static {
int counter = 0;
int c;
try {
FileInputStream dataIn = new FileInputStream(new File("./data/data/stackable.dat"));
while ((c = dataIn.read()) != -1) {
if (c == 0) {
itemStackable[counter] = false;
itemStackable[291] = true;
} else {
itemStackable[counter] = true;
}
counter++;
}
dataIn.close();
} catch (IOException e) {
System.out.println("Critical error while loading stackabledata! Trace:");
e.printStackTrace();
}
counter = 0;
try {
FileInputStream dataIn = new FileInputStream(new File("./data/data/notes.dat"));
while ((c = dataIn.read()) != -1) {
if (c == 0) {
itemIsNote[counter] = true;
} else {
itemIsNote[counter] = false;
}
counter++;
}
dataIn.close();
} catch (IOException e) {
System.out.println("Critical error while loading notedata! Trace:");
e.printStackTrace();
}
counter = 0;
try {
FileInputStream dataIn = new FileInputStream(new File("./data/data/equipment.dat"));
while ((c = dataIn.read()) != -1) {
targetSlots[counter++] = c;
}
dataIn.close();
} catch (IOException e) {
System.out.println("Critical error while loading notedata! Trace:");
e.printStackTrace();
}
/*
* try { BufferedReader in = new BufferedReader(new
* FileReader("./data/data/equipment.dat")); String name = null; while
* ((name = in.readLine()) != null) { int itemId =
* Integer.parseInt(name.substring(0, name.indexOf(":"))); int equipId =
* Integer.parseInt(name.substring(name.indexOf(":") + 1));
* targetSlots[itemId] = equipId; } in.close(); in = null; } catch
* (Exception e) { System.out.println("Error loading equipment list.");
* }
*/
}
}
package redone.game.items;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import redone.Constants;
import redone.Server;
public class Item {
public static int capes[] = { 2731, 2677, 2683, 2680, 2701, 2686, 2689,
2692, 2737, 2734, 2716, 2728, 2695, 2713, 2725, 2722, 2707, 2704,
2710, 2719, 2737, 2698, 14590, 2701, 8102, 8075, 8044, 8045, 8042,
8043, 8037, 8038, 8025, 8026, 8018, 7858, 7994, 7983, 7984, 7985,
7986, 7987, 7982, 7978, 3781, 3783, 3785, 3787, 3789, 3777, 3779,
3759, 3761, 3763, 3765, 6111, 6570, 6568, 1007, 1019, 1021, 1023,
1027, 1029, 1031, 1052, 2412, 2413, 2414, 4304, 4315, 4317, 4319,
4321, 4323, 4325, 4327, 4329, 4331, 4333, 4335, 4337, 4339, 4341,
4343, 4345, 4347, 4349, 4351, 4353, 4355, 4357, 4359, 4361, 4363,
4365, 4367, 4369, 4371, 4373, 4375, 4377, 4379, 4381, 4383, 4385,
4387, 4389, 4391, 4393, 4395, 4397, 4399, 4401, 4403, 4405, 4407,
4409, 4411, 4413, 4514, 4516, 6070, 6568, 6570, 4304, 3759, 3761,
3763, 3765, 3777, 3779, 3781, 3783, 3785, 3787, 3789 };
public static int boots[] = { 7596, 8029, 6619, 8017, 7159, 7991, 6666,
6061, 6106, 88, 89, 626, 628, 630, 632, 634, 1061, 1837, 1846,
2577, 2579, 2894, 2904, 2914, 2924, 2934, 3061, 3105, 3107, 3791,
4097, 4107, 4117, 4119, 4121, 4123, 4125, 4127, 4129, 4131, 4310,
5064, 5345, 5557, 6069, 6106, 6143, 6145, 6147, 6328, 6920, 6349,
6357, 3393 };
public static int gloves[] = { 7595, 6629, 8021, 8016, 7964, 2491, 1065,
2487, 2489, 3060, 1495, 775, 777, 778, 6708, 1059, 1063, 1065,
1580, 2487, 2489, 2491, 2902, 2912, 2922, 2932, 2942, 3060, 3799,
4095, 4105, 4115, 4308, 5556, 6068, 6110, 6149, 6151, 6153, 6922,
7454, 7455, 7456, 7457, 7458, 7459, 7460, 7461, 7462, 6330, 3391,
776 };
public static int shields[] = { 7676, 7342, 7348, 7354, 7360, 7334, 7340,
7347, 7352, 7358, 7356, 7350, 7344, 8087, 8058, 8059, 8060, 8061,
8062, 8063, 6633, 7977, 7976, 7972, 7959, 6591, 7332, 7338, 7336,
7360, 1171, 1173, 1175, 1177, 1179, 1181, 1183, 1185, 1187, 1189,
1191, 1193, 1195, 1197, 1199, 1201, 1540, 2589, 2597, 2603, 2611,
2621, 2629, 2659, 2667, 2675, 2890, 3122, 3488, 3758, 3839, 3840,
3841, 3842, 3843, 3844, 4072, 4156, 4224, 4225, 4226, 4227, 4228,
4229, 4230, 4231, 4232, 4233, 4234, 4302, 4507, 4512, 6215, 6217,
6219, 6221, 6223, 6225, 6227, 6229, 6231, 6233, 6235, 6237, 6239,
6241, 6243, 6245, 6247, 6249, 6251, 6253, 6255, 6257, 6259, 6261,
6263, 6265, 6267, 6269, 6271, 6273, 6275, 6277, 6279, 6524, 6889,
7051, 7053 };
public static int hats[] = { 2679, 1025, 2685, 4166, 2682, 2703, 2688,
2691, 2691, 2733, 2736, 2718, 2730, 2697, 2715, 2727, 2724, 2709,
2706, 2712, 2721, 2739, 2700, 2518, 2524, 2526, 7319, 7321, 7323,
7325, 7327, 1167, 8077, 8076, 8074, 4168, 1169, 8034, 8035, 8036,
8030, 6623, 8024, 8023, 8022, 8013, 1169, 7594, 7995, 7996, 7997,
7998, 7999, 8000, 8001, 7992, 7990, 7975, 7973, 7971, 7967, 7963,
6665, 6665, 7321, 6886, 6547, 6548, 2645, 2647, 2649, 4856, 4857,
4858, 4859, 4880, 4881, 4882, 4883, 4904, 4905, 4906, 4907, 4928,
4929, 4930, 4931, 4952, 4953, 4954, 4955, 4976, 4977, 4978, 4979,
4732, 4753, 4611, 6188, 6182, 4511, 4056, 4071, 4724, 2639, 2641,
2643, 2665, 6109, 5525, 5527, 5529, 5531, 5533, 5535, 5537, 5539,
5541, 5543, 5545, 5547, 5549, 5551, 74, 579, 656, 658, 660, 662,
664, 740, 1017, 1037, 1040, 1042, 1044, 1046, 1038, 1048, 1050,
1053, 1055, 1057, 1137, 1139, 1141, 1143, 1145, 1147, 1149, 1151,
1153, 1155, 1157, 1159, 1161, 1163, 1165, 1506, 1949, 2422, 2581,
2587, 2595, 2605, 2613, 2619, 2627, 2631, 2633, 2635, 2637, 2651,
2657, 2673, 2900, 2910, 2920, 2930, 2940, 2978, 2979, 2980, 2981,
2982, 2983, 2984, 2985, 2986, 2987, 2988, 2989, 2990, 2991, 2992,
2993, 2994, 2995, 3057, 3385, 3486, 3748, 3749, 3751, 3753, 3797,
4041, 4042, 4071, 4089, 3755, 4099, 4109, 4164, 4302, 4506, 4511,
4513, 4515, 4551, 4567, 4708, 4716, 4724, 4745, 4753, 4857, 4858,
4859, 4880, 4881, 4882, 4883, 4904, 4905, 4906, 4907, 4952, 4953,
4954, 4955, 4976, 4977, 4978, 4979, 5013, 5014, 5554, 5574, 6109,
6128, 6131, 6137, 6182, 6188, 6335, 6337, 6339, 6345, 6355, 6365,
6375, 6382, 6392, 6400, 6918, 6656, 2581, 7539, 7394, 7396, 7534,
5574, 6885, 6858, 6860, 6862, 6856, 6326, 6128, 6137, 7400, 7323,
7325, 7327, 7003, 4168, 7112, 7124, 7130, 7136 };
public static int amulets[] = { 1654, 1656, 1658, 1660, 1662, 1664, 8081,
8033, 7968, 6585, 86, 87, 295, 421, 552, 589, 1478, 1692, 1694,
1696, 1698, 1700, 1702, 1704, 1706, 1708, 1710, 1712, 1725, 1727,
1729, 1731, 4021, 4081, 4250, 4677, 6040, 6041, 6208, 1718, 1722,
6859, 6863, 6857, 3853, 3855, 3857, 3859, 3861, 3863, 3865, 3867,
1718, 4306, 1702 };
public static int arrows[] = { 11212, 8052, 9211, 9010, 9209, 9208, 9207,
9206, 9205, 9203, 9301, 8065, 7919, 7906, 7988, 7989, 78, 598, 877,
878, 879, 880, 881, 882, 883, 884, 885, 886, 887, 888, 889, 890,
891, 892, 893, 942, 2532, 2533, 2534, 2535, 2536, 2537, 2538, 2539,
2540, 2541, 2866, 4160, 4172, 4173, 4174, 4175, 4740, 5616, 5617,
5618, 5619, 5620, 5621, 5622, 5623, 5624, 5625, 5626, 5627, 6061,
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, 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,
7960, 3793, 3775, 3773, 3771, 3769, 3767, 6139, 1135, 2499, 2501,
1035, 540, 5553, 4757, 1833, 6388, 6384, 4111, 4101, 4091, 6186,
6184, 6180, 3058, 4509, 4504, 4069, 4728, 4736, 4712, 6107, 2661,
3140, 1101, 1103, 1105, 1107, 1109, 1111, 1113, 1115, 1117, 1119,
1121, 1123, 1125, 1127, 1129, 1131, 1133, 2583, 2591, 2599, 2607,
2615, 2623, 2653, 2669, 3481, 4712, 4720, 4728, 4749, 4892, 4893,
4894, 4895, 4916, 4917, 4918, 4919, 4964, 4965, 4966, 4967, 6107,
6133, 6322, 6322, 6129, 75, 6916, 6916, 4111, 6654, 6654, 75, 7399, 7374, 5575, 2503, 6341, 6351, 3387, 5030, 5032, 5034, 5030,
5032, 5034,7390 , 7392, 546, 581 };
public static int legs[] = { 7609, 2522, 7378, 7380, 7382, 7368, 7366,
7388, 646, 648, 650, 652, 654, 428, 1097, 1095, 7593, 8032, 8028,
6625, 8020, 8015, 7384, 7969, 7966, 7962, 6141, 538, 1033, 5555,
4759, 6386, 6390, 2497, 2495, 2493, 1099, 4113, 4103, 4093, 6924,
6187, 6185, 6181, 3059, 4510, 4505, 4070, 6108, 542, 548, 1011,
1013, 1015, 1067, 1069, 1071, 1073, 1075, 1077, 1079, 1081, 1083,
1085, 1087, 1089, 1091, 1093, 2585, 2593, 2601, 2609, 2617, 2625,
2655, 2663, 2671, 3059, 3389, 3472, 3473, 3474, 3475, 3476, 3477,
3478, 3479, 3480, 3483, 3485, 3795, 4087, 4585, 4712, 4714, 4722,
4730, 4738, 4751, 4759, 4874, 4875, 4876, 4877, 4898, 4899, 4900,
4901, 4922, 4923, 4924, 4925, 4946, 4947, 4948, 4949, 4970, 4971,
4972, 4973, 4994, 4995, 4996, 4997, 5048, 5050, 5052, 5576, 6107,
6130, 6187, 6390, 6386, 6390, 6394, 6396, 6402, 6404, 6135, 6809, 6916, 4091,
4111, 6655, 6654, 7398, 7398, 7386, 6324, 6343, 6353, 6363, 6373, 3387, 5036,
5038, 5040, 5042, 5044, 5046, 5050, 5052, 4300, 1835, 7116, 7126, 6752,
7132, 7138 };
public static int platebody[] = { 10338, 7608, 2520, 430, 636, 638, 640,
642, 644, 426, 430, 8031, 8027, 6617, 8019, 8014, 8002, 544, 577,
7974, 7970, 7965, 7961, 7960, 3793, 3773, 3775, 3771, 3769, 3767,
6139, 1035, 540, 5553, 4757, 1833, 1835, 6388, 6384, 4111, 4101,
4868, 4869, 4870, 4871, 4892, 4893, 4894, 4895, 4916, 4917, 4918,
4919, 4940, 4941, 4942, 4943, 4964, 4965, 4966, 4967, 4988, 4989,
4990, 0x2f9a0eb, 6186, 6184, 6180, 3058, 4509, 4504, 4069, 4728,
4736, 4712, 6107, 2661, 3140, 1115, 1117, 1119, 1121, 1123, 1125,
1127, 2583, 2591, 2599, 2607, 2615, 6322, 2623, 2653, 2669, 3481,
4720, 4728, 4749, 2661, 6129, 6916, 4091, 6654, 6133, 75, 7399, 5575, 6341, 6351, 7390, 7392, 3387, 5024, 5030, 5032, 5034, 7392, 6786, 6788 };
/* Fullbody is an item that covers your arms. */
private static String[] fullbody = {
"top", "shirt", "platebody", "Wizard robe (g)", "Wizard robe (t)",
"Ahrims robetop", "Karils leathertop", "brassard", "Robe top",
"robetop", "platebody (t)", "platebody (g)", "chestplate", "torso",
"hauberk", "Dragon chainbody", "gown", "Shade robe", "Wizard robe",
"Druid's robe", "Black robe", "Fremennik robe", "Robe of elidinis",
"tunic", "blouse", "Wizard robe(g)", "Wizard robe(t)"
};
/* Fullhat covers your head but not your beard. */
private static String[] fullhat = { "med helm", "coif", "Dharok's helm",
"hood", "Initiate helm", "Coif", "Helm of neitiznot",
"Armadyl helmet", "Berserker helm", "Archer helm", "Farseer helm",
"Warrior helm", "Void" };
/* Fullmask covers your entire head. */
private static String[] fullmask = { "full helm(t)", "full helm(g)", "full helm", "mask", "Verac's helm",
"Guthan's helm", "Karil's coif", "mask", "Torag's helm", "Void", "helmet",
"sallet", "Facemask" };
public static boolean isFullBody(int itemId) {
String weapon = getItemName(itemId);
if (weapon == null) {
return false;
}
for (String element : fullbody) {
if (weapon.endsWith(element)) {
return true;
}
}
return false;
}
public static boolean isFullHelm(int itemId) {
String weapon = getItemName(itemId);
if (weapon == null) {
return false;
}
for (String element : fullhat) {
if (weapon.endsWith(element)) {
return true;
}
}
return false;
}
public static boolean isFullMask(int itemId) {
String weapon = getItemName(itemId);
if (weapon == null) {
return false;
}
for (String element : fullmask) {
if (weapon.endsWith(element)) {
return true;
}
}
return false;
}
public static String getItemName(int id) {
for (ItemList element : Server.itemHandler.ItemList) {
if (element != null) {
if (element.itemId == id) {
return element.itemName;
}
}
}
return null;
}
public static boolean[] itemStackable = new boolean[Constants.ITEM_LIMIT];
public static boolean[] itemIsNote = new boolean[Constants.ITEM_LIMIT];
public static int[] targetSlots = new int[Constants.ITEM_LIMIT];
static {
int counter = 0;
int c;
try {
FileInputStream dataIn = new FileInputStream(new File("./data/data/stackable.dat"));
while ((c = dataIn.read()) != -1) {
if (c == 0) {
itemStackable[counter] = false;
itemStackable[291] = true;
} else {
itemStackable[counter] = true;
}
counter++;
}
dataIn.close();
} catch (IOException e) {
System.out.println("Critical error while loading stackabledata! Trace:");
e.printStackTrace();
}
counter = 0;
try {
FileInputStream dataIn = new FileInputStream(new File("./data/data/notes.dat"));
while ((c = dataIn.read()) != -1) {
if (c == 0) {
itemIsNote[counter] = true;
} else {
itemIsNote[counter] = false;
}
counter++;
}
dataIn.close();
} catch (IOException e) {
System.out.println("Critical error while loading notedata! Trace:");
e.printStackTrace();
}
counter = 0;
try {
FileInputStream dataIn = new FileInputStream(new File("./data/data/equipment.dat"));
while ((c = dataIn.read()) != -1) {
targetSlots[counter++] = c;
}
dataIn.close();
} catch (IOException e) {
System.out.println("Critical error while loading notedata! Trace:");
e.printStackTrace();
}
/*
* try { BufferedReader in = new BufferedReader(new
* FileReader("./data/data/equipment.dat")); String name = null; while
* ((name = in.readLine()) != null) { int itemId =
* Integer.parseInt(name.substring(0, name.indexOf(":"))); int equipId =
* Integer.parseInt(name.substring(name.indexOf(":") + 1));
* targetSlots[itemId] = equipId; } in.close(); in = null; } catch
* (Exception e) { System.out.println("Error loading equipment list.");
* }
*/
}
}
@@ -1630,6 +1630,8 @@ public class ItemAssistant {
case 6402:
case 6788:
case 6184:
case 7390:
case 7392:
case 6186:
targetSlot = 4;
break;
@@ -15,47 +15,51 @@ public class RareProtection {
private static final int[] EATABLE_RARES = { 1959, 1961, 1989 };
public static boolean equipItem(Client c) {// check when wearing, removing
/* Allow rares
for (int element : RARE_ITEMS) {
if (!RARES && c.wearId == element && c.playerRights < 3) {
c.getActionSender().sendMessage(
"You shouldn't have that item!");
c.getActionSender().sendMessage("You shouldn't have that item!");
int amountToDelete = c.getItemAssistant().getItemCount(element);
c.getItemAssistant().deleteItem(element, amountToDelete);
return false;
}
}
*/
return true;
}
public static boolean removeItem(Client c, int itemId) {// check when
// wearing, removing
/* Allow rares
for (int element : RARE_ITEMS) {
if (!RARES && itemId == element && c.playerRights < 3) {
c.getActionSender().sendMessage(
"You shouldn't have that item!");
c.getActionSender().sendMessage("You shouldn't have that item!");
c.getItemAssistant().deleteEquipment(element, 0);
return false;
}
}
*/
return true;
}
public static boolean hasDupedItem(Client c) {// check on login
/* Allow rares
for (int element : RARE_ITEMS) {
if (!RARES && c.getItemAssistant().playerHasItem(element)
&& c.playerRights < 3) {
c.getActionSender().sendMessage(
"You can't have these items!");
c.getActionSender().sendMessage("You can't have these items!");
int amountToDelete = c.getItemAssistant().getItemCount(element);
c.getItemAssistant().deleteItem(element, amountToDelete);
return false;
}
}
*/
return true;
}
public static boolean eatDupedItem(Client c, int itemId) {// check when
// eating
/* Allow rares
for (int element : EATABLE_RARES) {
if (!RARES && itemId == element && c.playerRights < 3) {
c.getActionSender().sendMessage("You can't eat that item!");
@@ -64,6 +68,7 @@ public class RareProtection {
return false;
}
}
*/
return true;
}
@@ -72,16 +77,17 @@ public class RareProtection {
// trading,
// staking,
// dropping
/* Allow rares
for (int element : RARE_ITEMS) {
if (!RARES && c.getItemAssistant().playerHasItem(element)
&& c.playerRights < 3) {
c.getActionSender().sendMessage(
"You shouldnt have that item!");
c.getActionSender().sendMessage("You shouldnt have that item!");
int amountToDelete = c.getItemAssistant().getItemCount(element);
c.getItemAssistant().deleteItem(element, amountToDelete);
return false;
}
}
*/
return true;
}
}
@@ -0,0 +1,129 @@
package redone.game.npcs;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.List;
import redone.util.XStreamUtil;
public class NPCDefinition {
private static NPCDefinition[] definitions = null;
public static void init() throws IOException {
@SuppressWarnings("unchecked")
List<NPCDefinition> defs = (List<NPCDefinition>) XStreamUtil.getXStream().fromXML(new FileInputStream("data/cfg/npcDefinitions.xml"));
definitions = new NPCDefinition[3790];
for (NPCDefinition def : defs) {
definitions[def.getId()] = def;
}
}
public static NPCDefinition forId(int id) {
NPCDefinition d = definitions[id];
if (d == null) {
d = produceDefinition(id);
}
return d;
}
private int id;
private String name, examine;
private int respawn = 0, combat = 0, hitpoints = 1, maxHit = 0, size = 1, attackSpeed = 4000, attackAnim = 422, defenceAnim = 404, deathAnim = 2304, attackBonus = 20, defenceMelee = 20, defenceRange = 20, defenceMage = 20;
private boolean attackable = false;
private boolean aggressive = false;
private boolean retreats = false;
private boolean poisonous = false;
public int getId() {
return id;
}
public String getName() {
return name;
}
public String getExamine() {
return examine;
}
public int getRespawn() {
return respawn;
}
public int getCombat() {
return combat;
}
public int getHitpoints() {
return hitpoints;
}
public int getMaxHit() {
return maxHit;
}
public int getSize() {
return size;
}
public boolean isAggressive() {
return aggressive;
}
public boolean retreats() {
return retreats;
}
public boolean isPoisonous() {
return poisonous;
}
public static NPCDefinition produceDefinition(int id) {
NPCDefinition def = new NPCDefinition();
def.id = id;
def.name = "NPC #" + def.id;
def.examine = "It's an NPC.";
return def;
}
public int getAttackSpeed() {
return attackSpeed;
}
public int getAttackAnimation() {
return attackAnim;
}
public int getDefenceAnimation() {
return defenceAnim;
}
public int getDeathAnimation() {
return deathAnim;
}
public boolean isAttackable() {
return attackable;
}
public int getAttackBonus() {
return attackBonus;
}
public int getDefenceRange() {
return defenceRange;
}
public int getDefenceMelee() {
return defenceMelee;
}
public int getDefenceMage() {
return defenceMage;
}
}
@@ -1207,6 +1207,15 @@ public class NpcActions {
String type = c.playerMagicBook == 0 ? "modern" : "ancient";
c.getPlayerAssistant().startTeleport(2911, 4832, 0, type);
break;
case 2258:
if (c.playerLevel[20] < 35) {
c.getActionSender().sendMessage("You need a Runecrafting level of 35 to enter the Abyss.");
return;
}
c.getPlayerAssistant().spellTeleport(3027, 4852, 0);
break;
default:
if (c.playerRights == 3) {
Misc.println("Third Click NPC : " + npcType);
@@ -15,6 +15,8 @@ import redone.game.content.music.sound.CombatSounds;
import redone.game.content.randomevents.FreakyForester;
import redone.game.content.randomevents.RandomEventHandler;
import redone.game.content.randomevents.RiverTroll;
import redone.game.npcs.drops.ItemDrop;
import redone.game.npcs.drops.NPCDrops;
import redone.game.npcs.drops.NPCDropsHandler;
import redone.game.players.Client;
import redone.game.players.Player;
@@ -26,13 +28,13 @@ import redone.world.clip.Region;
public class NpcHandler {
public static int maxNPCs = 5000;
public static int maxListedNPCs = 5000;
public static Npc npcs[] = new Npc[maxNPCs];
public static int MAX_NPCS = 4000;
public static int maxListedNPCs = 4000;
public static Npc npcs[] = new Npc[MAX_NPCS];
public static NpcList NpcList[] = new NpcList[maxListedNPCs];
public NpcHandler() {
for (int i = 0; i < maxNPCs; i++) {
for (int i = 0; i < MAX_NPCS; i++) {
npcs[i] = null;
}
for (int i = 0; i < maxListedNPCs; i++) {
@@ -40,6 +42,11 @@ public class NpcHandler {
}
loadNPCList("./data/cfg/npc.cfg");
loadAutoSpawn("./data/cfg/spawn-config.cfg");
try {
NPCDefinition.init();
} catch (Exception e) {
System.out.println("npc def error");
}
}
public static boolean isUndead(int index) {
@@ -54,7 +61,7 @@ public class NpcHandler {
int WalkingType, int HP, int maxHit, int attack, int defence,
boolean attackPlayer, boolean headIcon, boolean summonFollow) {
int slot = -1;
for (int i = 1; i < maxNPCs; i++) {
for (int i = 1; i < MAX_NPCS; i++) {
if (npcs[i] == null) {
slot = i;
break;
@@ -149,7 +156,7 @@ public class NpcHandler {
int defence, boolean attackPlayer, boolean headIcon) {
// first, search for a free slot
int slot = -1;
for (int i = 1; i < maxNPCs; i++) {
for (int i = 1; i < MAX_NPCS; i++) {
if (npcs[i] == null) {
slot = i;
break;
@@ -196,7 +203,7 @@ public class NpcHandler {
public void spawnNpc2(int npcType, int x, int y, int heightLevel, int WalkingType, int HP, int maxHit, int attack, int defence) {
// first, search for a free slot
int slot = -1;
for (int i = 1; i < maxNPCs; i++) {
for (int i = 1; i < MAX_NPCS; i++) {
if (npcs[i] == null) {
slot = i;
break;
@@ -249,7 +256,7 @@ public class NpcHandler {
int WalkingType, int HP, int maxHit, int attack, int defence) {
// first, search for a free slot
int slot = -1;
for (int i = 1; i < maxNPCs; i++) {
for (int i = 1; i < MAX_NPCS; i++) {
if (npcs[i] == null) {
slot = i;
break;
@@ -332,7 +339,7 @@ public class NpcHandler {
i.clearUpdateFlags();
}
for (int i = 0; i < maxNPCs; i++) {
for (int i = 0; i < MAX_NPCS; i++) {
if (npcs[i] != null) {
Client slaveOwner = (Client) PlayerHandler.players[npcs[i].summonedBy];
@@ -415,7 +422,7 @@ public class NpcHandler {
Client client = (Client) PlayerHandler.players[NpcData.getCloseRandomPlayer(i)];
if (client != null) {
boolean aggressive = (NpcAggressive.isAggressive(i) || getNpcListCombat(npcs[i].npcType) * 2 > client.combatLevel);
boolean aggressive = (NpcAggressive.isAggressive(i) || getNpcListCombat(npcs[i].npcType) * 2 > client.combatLevel && getNpcListAggressive(i));
if (aggressive && !npcs[i].underAttack && !npcs[i].isDead && npcs[i].MaxHP > 0) {
npcs[i].killerId = NpcData.getCloseRandomPlayer(i);
}
@@ -879,64 +886,86 @@ public class NpcHandler {
public void dropItems(int i) {
// TODO: add ring of wealth
int npc = 0;
int item_index = 0;
Client c = (Client) PlayerHandler.players[npcs[i].killedBy];
if (c != null) {
for (npc = 0; npc < NPCDropsHandler.NPC_DROPS(getNpcListName(npcs[i].npcType).toLowerCase(), npcs[i].npcType).length; npc++) {
if (Misc.random(NPCDropsHandler.NPC_DROPS(getNpcListName(npcs[i].npcType).toLowerCase(), npcs[i].npcType)[npc][2]) == 0 && npcs[i].npcType != 2627 && npcs[i].npcType != 2638 && npcs[i].npcType != 2630 && npcs[i].npcType != 2631 && npcs[i].npcType != 2641 && npcs[i].npcType != 2643 && npcs[i].npcType != 2645 && npcs[i].npcType != 1532 && npcs[i].npcType != 153 && !PestControl.npcIsPCMonster(npcs[i].npcType)) {
Server.itemHandler.createGroundItem(c, NPCDropsHandler.NPC_DROPS(getNpcListName(npcs[i].npcType).toLowerCase(), npcs[i].npcType)[npc][0], npcs[i].absX, npcs[i].absY, NPCDropsHandler.NPC_DROPS(getNpcListName(npcs[i].npcType).toLowerCase(), npcs[i].npcType)[npc][1], c.playerId);
}
}
switch (npcs[i].npcType) {
case 2459:
FreakyForester.killedPheasant(c, 0);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 2460:
FreakyForester.killedPheasant(c, 1);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 2461:
FreakyForester.killedPheasant(c, 2);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 2462:
FreakyForester.killedPheasant(c, 3);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 92:
if (c.restGhost == 3) {
Server.itemHandler.createGroundItem(c, 553, npcs[i].absX, npcs[i].absY, 1, c.playerId);
c.restGhost = 4;
}
break;
case 47:
if (c.witchspot == 1 || c.romeojuliet > 0 && c.romeojuliet < 9) {
Server.itemHandler.createGroundItem(c, 300, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
break;
case 645:
if (c.shieldArrav == 5) {
Server.itemHandler.createGroundItem(c, 761, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
break;
}
if (Misc.random(1, 256) == 1) {
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
Server.itemHandler.createGroundItem(c, 2677 + Misc.random(0, 1), npcs[i].absX, npcs[i].absY, 1, c.playerId);
else if (level <= 80) // medium
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 if (level > 150)// hard
Server.itemHandler.createGroundItem(c, 2679, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
// These npcs shouldn't have drops
if (npcs[i].npcType == 2627 // Tz-Kih
|| npcs[i].npcType == 2630 // Tz-Kek
|| npcs[i].npcType == 2631 // Tok-Xil
|| npcs[i].npcType == 2638 // Neite
|| npcs[i].npcType == 2641 // Dragonkin
|| npcs[i].npcType == 2643 // R4ng3rNo0b889
|| npcs[i].npcType == 2645 // Love Cats
|| npcs[i].npcType == 1532 // Barricade
|| npcs[i].npcType == 153 // Butterfly
|| PestControl.npcIsPCMonster(npcs[i].npcType)
|| FightCaves.isFightCaveNpc(i)) {
// These npcs shouldn't have drops
return;
}
for (ItemDrop possible_drop : NPCDropsHandler.NPC_DROPS(getNpcListName(npcs[i].npcType).toLowerCase(), npcs[i].npcType)) {
if (Misc.random(possible_drop.getChance()) == 0) {
int amt = possible_drop.getAmount();
Server.itemHandler.createGroundItem(c, possible_drop.getItemID(), npcs[i].absX, npcs[i].absY, amt, c.playerId);
}
}
switch (npcs[i].npcType) {
case 2459:
FreakyForester.killedPheasant(c, 0);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 2460:
FreakyForester.killedPheasant(c, 1);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 2461:
FreakyForester.killedPheasant(c, 2);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 2462:
FreakyForester.killedPheasant(c, 3);
Server.itemHandler.createGroundItem(c, 6178, npcs[i].absX, npcs[i].absY, 1, c.playerId);
break;
case 92:
if (c.restGhost == 3) {
Server.itemHandler.createGroundItem(c, 553, npcs[i].absX, npcs[i].absY, 1, c.playerId);
c.restGhost = 4;
}
break;
case 47:
if (c.witchspot == 1 || c.romeojuliet > 0 && c.romeojuliet < 9) {
Server.itemHandler.createGroundItem(c, 300, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
break;
case 645:
if (c.shieldArrav == 5) {
Server.itemHandler.createGroundItem(c, 761, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
break;
}
int level = getNpcListCombat(npcs[i].npcType);
// higher level monsters have a better drop rate (max of 1/128)
int chance = Math.max(128, 512 - (level * 2));
if (Misc.random(1, chance) == 1) {
int scroll = -1;
if (level <= 1) // none
scroll = -1;
else if (level <= 24) // easy
scroll = 2677;
else if (level <= 40) // easy medium
scroll = 2677 + Misc.random(0, 1);
else if (level <= 80) // medium
scroll = 2678;
else if (level <= 150) // medium hard
scroll = 2678 + Misc.random(0, 1);
else if (level > 150)// hard
scroll = 2679;
if (scroll >= 0)
Server.itemHandler.createGroundItem(c, scroll, npcs[i].absX, npcs[i].absY, 1, c.playerId);
}
}
}
/**
* Slayer Experience
**/
@@ -1403,8 +1432,12 @@ public class NpcHandler {
}
public static boolean checkSpawn(Client player, int i) {
return npcs[i] != null && npcs[i].spawnedBy != -1
&& npcs[i].npcType == i;
return npcs[i] != null && npcs[i].spawnedBy != -1 && npcs[i].npcType == i;
}
public boolean getNpcListAggressive(int npcId) {
return NPCDefinition.forId(npcId).isAggressive();
}
}
@@ -0,0 +1,32 @@
package redone.game.npcs.drops;
import redone.util.Misc;
public class ItemDrop {
public int item_id, chance;
public int[] amounts;
ItemDrop (int item_id, int[]amounts, int chance) {
this.item_id = item_id;
this.amounts = amounts;
this.chance = chance;
}
ItemDrop (int item_id, int amount, int chance) {
this.item_id = item_id;
this.amounts = new int[]{amount, amount};
this.chance = chance;
}
public int getChance(){
return this.chance;
}
public int getItemID(){
return this.item_id;
}
public int getAmount(){
return Misc.random(this.amounts[0], this.amounts[1]);
}
}
File diff suppressed because it is too large Load Diff
@@ -13,11 +13,11 @@ public class NPCDropsHandler {
public static int // found on http://runescape.wikia.com/wiki/Drop_rate
ALWAYS = 0,
COINSRATE = 3, CHICKEN_RATE = 75 / 100,
COMMON = 2 + r(48),
UNCOMMON = 51 + r(49),
RARE = 101 + r(411),
VERY_RARE = 513;
COINSRATE = 3,
COMMON = 32,
UNCOMMON = 64,
RARE = 256,
VERY_RARE = 512;
/**
* Handles the npc drops for the npc names.
@@ -25,7 +25,7 @@ public class NPCDropsHandler {
* @param NPCId
* @return
*/
public static final int[][] NPC_DROPS(String npc, int NPCId) {
public static final ItemDrop[] NPC_DROPS(String npc, int NPCId) {
if (npc.equals("man") || npc.equals("woman") || npc.equals("drunken_man")) {
return NPCDrops.man;
} else if (npc.equals("skeletal_wyvern")) {
@@ -103,7 +103,7 @@ public class NPCDropsHandler {
return NPCDrops.pyrefiend;
} else if (npc.equals("aberrant_spectre")
|| npc.equals("aberrant_specter")
|| npc.equals("Aberant_specter")) {
|| npc.equals("aberant_specter")) {
return NPCDrops.abberantspectre;
} else if (npc.equals("earth_warrior")) {
return NPCDrops.earthwarrior;
@@ -42,6 +42,9 @@ public class Objects {
ObjectDef def = ObjectDef.getObjectDef(objectId);
if (def == null)
return new int[] {1, 1};
if (objectId == 2781) {
return new int[] {3, 3};
}
int xLength;
int yLength;
if (objectFace != 1 && objectFace != 3) {
@@ -20,6 +20,7 @@ import redone.game.content.skills.core.Woodcutting;
import redone.game.content.skills.crafting.Spinning;
import redone.game.content.skills.farming.Farming;
import redone.game.content.skills.fletching.LogCutting;
import redone.game.content.skills.runecrafting.AbyssalHandler;
import redone.game.content.skills.runecrafting.RuneCraftingActions;
import redone.game.content.skills.smithing.Smelting;
import redone.game.content.skills.thieving.Stalls;
@@ -61,8 +62,8 @@ public class ObjectsActions {
player.faceUpdate(0);
player.clickObjectType = 0;
player.turnPlayerTo(objectX, objectY);
if (!Region.objectExists(objectType, objectX, objectY, player.heightLevel)) {
player.getActionSender().sendMessage("This object does not exist. Please report this to a staff member.");
if (!Region.objectExists(objectType, objectX, objectY, player.heightLevel) && player.playerRights > 1) {
player.getActionSender().sendMessage("[DEBUG] This object does not exist.");
return;
}
if (Webs.webs(player, objectType)) {
@@ -112,6 +113,7 @@ public class ObjectsActions {
SingleGates.useSingleGate(player, objectType);
DoubleGates.useDoubleGate(player, objectType);
PassDoor.processDoor(player, objectType);
AbyssalHandler.handleAbyssalTeleport(player, objectType);
// if its a rock we can mine, mine it
if (Mining.rockExists(objectType))
player.getMining().startMining(player, objectType, player.objectX, player.objectY, player.clickObjectType);
@@ -1697,14 +1699,6 @@ public class ObjectsActions {
player.getPlayerAssistant().movePlayer(3233, 9317, 0);
break;
case 2258:
if (player.playerLevel[20] >= 35) {
player.getPlayerAssistant().spellTeleport(3027, 4852, 0);
} else {
player.getActionSender().sendMessage("You need a Runecrafting level of 35 to enter the Abyss.");
}
break;
/**
* End
*/
@@ -2568,15 +2562,10 @@ public class ObjectsActions {
player.faceUpdate(0);
player.clickObjectType = 0;
player.turnPlayerTo(obX, obY);
if (!Region.objectExists(objectType, obX, obY, player.heightLevel)) {
player.getActionSender().sendMessage("This object does not exist. Please report this to a staff member.");
if (!Region.objectExists(objectType, obX, obY, player.heightLevel) && player.playerRights > 1) {
player.getActionSender().sendMessage("[DEBUG] This object does not exist.");
return;
}
if (player.isBotting == true) {
player.getActionSender().sendMessage("You can't click any objects until you confirm you are not botting.");
player.getActionSender().sendMessage("If you need to you can type ::amibotting, to see if your botting.");
return;
}
LogCutting.resetFletching(player);
switch (objectType) {
case 6:
@@ -2834,15 +2823,10 @@ public class ObjectsActions {
if (player.playerRights == 3) {
player.getActionSender().sendMessage("Object type: " + objectType);
}
if (!Region.objectExists(objectType, obX, obY, player.heightLevel)) {
player.getActionSender().sendMessage("This object does not exist. Please report this to a staff member.");
if (!Region.objectExists(objectType, obX, obY, player.heightLevel) && player.playerRights > 1) {
player.getActionSender().sendMessage("[DEBUG] This object does not exist.");
return;
}
if (player.isBotting == true) {
player.getActionSender().sendMessage("You can't click any objects until you confirm you are not botting.");
player.getActionSender().sendMessage("If you need to you can type ::amibotting, to see if your botting.");
return;
}
if (Stalls.isObject(objectType)) {
Stalls.attemptStall(player, objectType, obX, obY);
return;
@@ -2885,15 +2869,10 @@ public class ObjectsActions {
if (player.playerRights == 3) {
player.getActionSender().sendMessage("Object type: " + objectType);
}
if (!Region.objectExists(objectType, obX, obY, player.heightLevel)) {
player.getActionSender().sendMessage("This object does not exist. Please report this to a staff member.");
if (!Region.objectExists(objectType, obX, obY, player.heightLevel) && player.playerRights > 1) {
player.getActionSender().sendMessage("[DEBUG] This object does not exist.");
return;
}
if (player.isBotting == true) {
player.getActionSender().sendMessage("You can't click any objects until you confirm you are not botting.");
player.getActionSender().sendMessage("If you need to you can type ::amibotting, to see if your botting.");
return;
}
Farming.openGuide(player, player.objectId);
switch (objectType) {
@@ -26,6 +26,7 @@ import redone.game.content.combat.magic.MagicTeleports;
import redone.game.content.combat.prayer.PrayerData;
import redone.game.content.combat.prayer.PrayerDrain;
import redone.game.content.combat.range.DwarfCannon;
import redone.game.content.combat.range.RangeData;
import redone.game.content.consumables.Food;
import redone.game.content.consumables.Potions;
import redone.game.content.guilds.impl.RangersGuild;
@@ -62,6 +63,7 @@ import redone.game.items.impl.PotionMixing;
import redone.game.items.impl.Teles;
import redone.game.items.impl.Weight;
import redone.game.npcs.NpcActions;
import redone.game.npcs.NpcHandler;
import redone.game.objects.ObjectsActions;
import redone.game.players.antimacro.AntiBotting;
import redone.game.shops.ShopAssistant;
@@ -389,11 +391,17 @@ public class Client extends Player {
return food;
}
public int TotalShopItems;
public void startCurrentTask(int ticksBetweenExecution, CycleEvent event) {
endCurrentTask();
currentTask = CycleEventHandler.getSingleton().addEvent(this, event, ticksBetweenExecution);
}
public CycleEventContainer getCurrentTask() {
return currentTask;
}
public void endCurrentTask() {
if (currentTask != null && currentTask.isRunning()) {
currentTask.stop();
@@ -1069,11 +1077,11 @@ public class Client extends Player {
teleTimer = 0;
getPlayerAssistant().changeLocation();
}
if (teleTimer == 5) {
if (teleTimer == 4) {
teleTimer--;
getPlayerAssistant().processTeleport();
}
if (teleTimer == 9 && teleGfx > 0) {
if (teleTimer == 7 && teleGfx > 0) {
teleTimer--;
gfx100(teleGfx);
}
@@ -1091,6 +1099,9 @@ public class Client extends Player {
}
}
combatAssistant.attackingNpcTick();
combatAssistant.attackingPlayerTick();
if (attackTimer > 0) {
attackTimer--;
}
@@ -17,7 +17,7 @@ public abstract class Player {
public String currentTime, date, creationAddress = "", slayerMaster;
public boolean lostCannon = false;
public boolean lostCannon = false, refresh = false;
public ArrayList<String> killedPlayers = new ArrayList<String>();
public ArrayList<Integer> attackedPlayers = new ArrayList<Integer>();
@@ -30,7 +30,7 @@ public abstract class Player {
{2035, 0}
};
public long lastCast = 0, homeTele, lastDesert, eventTimer, lastRunRecovery,
public long homeTele, lastDesert, eventTimer, lastRunRecovery,
lastButton, lastFire, lastLight, muteTime, waitTime, miscTimer,
ladderTimer, webSlashDelay, climbDelay, lastReport = 0,
lastPlayerMove, lastPoison, lastPoisonSip, poisonImmune, lastSpear,
@@ -888,11 +888,11 @@ public abstract class Player {
public byte playerInListBitmap[] = new byte[Constants.MAX_PLAYERS + 7 >> 3];
public static final int maxNPCListSize = NpcHandler.maxNPCs;
public static final int maxNPCListSize = NpcHandler.MAX_NPCS;
public Npc npcList[] = new Npc[maxNPCListSize];
public int npcListSize = 0;
public byte npcInListBitmap[] = new byte[NpcHandler.maxNPCs + 7 >> 3];
public byte npcInListBitmap[] = new byte[NpcHandler.MAX_NPCS + 7 >> 3];
public boolean withinDistance(Player otherPlr) {
if (heightLevel != otherPlr.heightLevel) {
@@ -1525,7 +1525,7 @@ public boolean goodDistance(int objectX, int objectY, int playerX, int playerY,
**/
protected void appendHitUpdate(Stream str) {
str.writeByte(getHitDiff()); // What the perseon got 'hit' for
str.writeByte(getHitDiff()); // What the person got 'hit' for
if (poisonMask == 1) {
str.writeByteA(2);
} else if (getHitDiff() > 0) {
@@ -555,7 +555,7 @@ public class PlayerAssistant {
}
}
for (int i = 0; i < path.length; i++) {
if (!Region.getClipping(path[i][0], path[i][1], path[i][2], path[i][3], path[i][4]) && !Region.blockedShot(path[i][0], path[i][1], path[i][2])) {
if (!Region.getClipping(path[i][0], path[i][1], path[i][2], path[i][3], path[i][4])/* && !Region.blockedShot(path[i][0], path[i][1], path[i][2])*/) {
return true;
}
}
@@ -641,11 +641,11 @@ public class PlayerAssistant {
return false;
}
}
for (int i = 0; i < path.length; i++) {
/*for (int i = 0; i < path.length; i++) {
if (!Region.blockedShot(path[i][0], path[i][1], path[i][2])) {
return true;
}
}
}*/
return false;
}
@@ -756,9 +756,6 @@ public class PlayerAssistant {
"You are teleblocked and can't teleport.");
return;
}
if (Constants.SOUND) {
player.getActionSender().sendSound(SoundList.TELEPORT, 100, 0);
}
if (SkillHandler.isSkilling(player)) {
player.getActionSender().sendMessage(
"You can't teleport while skilling!");
@@ -779,12 +776,19 @@ public class PlayerAssistant {
player.npcIndex = 0;
player.playerIndex = 0;
player.faceUpdate(0);
player.refresh = false;
if(player.heightLevel != height) {
player.refresh = true;
}
player.teleHeight = height;
// client.resetShaking();
player.isTeleporting = true;
if (Constants.SOUND) {
player.getActionSender().sendSound(SoundList.TELEPORT, 100, 700);
}
if (teleportType.equalsIgnoreCase("modern")) {
player.startAnimation(714);
player.teleTimer = 11;
player.startAnimation(714, 10);
player.teleTimer = 10;
player.teleGfx = 308;
player.teleEndAnimation = 715;
}
@@ -949,9 +953,13 @@ public class PlayerAssistant {
}
public void movePlayer(int x, int y, int h) {
player.refresh = false;
player.resetWalkingQueue();
player.teleportToX = x;
player.teleportToY = y;
if(player.heightLevel != h) {
player.refresh = true;
}
player.heightLevel = h;
player.getPlayerAssistant().requestUpdates();
}
@@ -2081,6 +2089,42 @@ public class PlayerAssistant {
player.newLocation = 0;
}
public int[] getFollowLocation(int x, int y) {
int[] nonDiags = {0, 2, 4, 6};
int[][] nodes = {
{ x + Misc.directionDeltaX[nonDiags[0]], y + Misc.directionDeltaY[nonDiags[0]] },
{ x + Misc.directionDeltaX[nonDiags[1]], y + Misc.directionDeltaY[nonDiags[1]] },
{ x + Misc.directionDeltaX[nonDiags[2]], y + Misc.directionDeltaY[nonDiags[2]] },
{ x + Misc.directionDeltaX[nonDiags[3]], y + Misc.directionDeltaY[nonDiags[3]] }
};
int bestX = 0;
int bestY = 0;
double bestDist = 99999;
boolean projectile = player.usingMagic || player.usingBow || player.usingRangeWeapon;
for (int i = 0; i < nodes.length; i++) {
double dist = Misc.distance(player.absX, player.absY, nodes[i][0], nodes[i][1]);
if (dist < bestDist) {
if (PathFinder.getPathFinder().accessible(player.absX, player.absY, player.heightLevel, nodes[i][0], nodes[i][1])) {
if (!projectile || PathFinder.isProjectilePathClear(nodes[i][0], nodes[i][1], player.heightLevel, x, y)) {
bestDist = dist;
bestX = nodes[i][0];
bestY = nodes[i][1];
}
}
}
}
if (bestX == 0 && bestY == 0) {
bestX = x;
bestY = y;
}
return new int[] {bestX, bestY};
}
public void followPlayer() {
if (PlayerHandler.players[player.followId] == null
|| PlayerHandler.players[player.followId].isDead) {
@@ -2097,7 +2141,7 @@ public class PlayerAssistant {
int otherX = PlayerHandler.players[player.followId].getX();
int otherY = PlayerHandler.players[player.followId].getY();
boolean sameSpot = player.absX == otherX && player.absY == otherY;
/*boolean sameSpot = player.absX == otherX && player.absY == otherY;
if (sameSpot)
stepAway();
@@ -2115,7 +2159,7 @@ public class PlayerAssistant {
|| player.autocasting || player.spellId > 0)
&& mageDistance;
boolean playerRanging = player.usingRangeWeapon && rangeWeaponDistance;
boolean playerBowOrCross = player.usingBow && bowDistance;
boolean playerBowOrCross = player.usingBow && bowDistance;*/
if (!player.goodDistance(otherX, otherY, player.getX(), player.getY(),
25)) {
@@ -2123,8 +2167,12 @@ public class PlayerAssistant {
resetFollow();
return;
}
int[] follow = getFollowLocation(otherX, otherY);
player.faceUpdate(player.followId + 32768);
if (!sameSpot) {
PathFinder.getPathFinder().findRoute(player, follow[0], follow[1], false, 1, 1);
/*if (!sameSpot) {
if (player.playerIndex > 0 && !player.usingSpecial
&& player.inWild()) {
if (player.usingSpecial && (playerRanging || playerBowOrCross)) {
@@ -2194,30 +2242,28 @@ public class PlayerAssistant {
playerWalk(otherX - 1, otherY + 1);
}
}
player.faceUpdate(player.followId + 32768);
player.faceUpdate(player.followId + 32768);*/
}
public void followNpc() {
if (NpcHandler.npcs[player.followId] == null
|| NpcHandler.npcs[player.followId].isDead) {
resetFollow();
return;
}
Npc npc = NpcHandler.npcs[player.followId2];
if (npc.isDead) {
if (npc == null || npc.isDead) {
return;
}
int otherX = NpcHandler.npcs[player.followId2].getX();
int otherY = NpcHandler.npcs[player.followId2].getY();
if (!player.goodDistance(otherX, otherY, player.getX(), player.getY(),
25)) {
int x = NpcHandler.npcs[player.followId2].getX();
int y = NpcHandler.npcs[player.followId2].getY();
if (!player.goodDistance(x, y, player.getX(), player.getY(),25)) {
player.followId2 = 0;
resetFollow();
return;
}
player.faceUpdate(player.followId2 + 32768);
if (otherX == player.absX && otherY == player.absY) {
int[] follow = getFollowLocation(x, y);
player.faceUpdate(player.followId2);
PathFinder.getPathFinder().findRoute(player, follow[0], follow[1], false, 1, 1);
/*if (otherX == player.absX && otherY == player.absY) {
int r = Misc.random(3);
switch (r) {
case 0:
@@ -2251,8 +2297,7 @@ public class PlayerAssistant {
} else if (otherX > player.getX() && otherY < player.getY()) {
playerWalk(otherX - 1, otherY + 1);
}
}
player.faceUpdate(player.followId2 + 32768);
}*/
}
public int getRunningMove(int i, int j) {
@@ -3094,7 +3139,7 @@ public class PlayerAssistant {
}
public int getNpcId(int id) {
for (int i = 0; i < NpcHandler.maxNPCs; i++) {
for (int i = 0; i < NpcHandler.MAX_NPCS; i++) {
if (NpcHandler.npcs[i] != null) {
if (NpcHandler.npcs[i].npcId == id) {
return i;
@@ -1,14 +1,15 @@
package redone.game.players;
import java.net.InetSocketAddress;
import redone.Constants;
import redone.Server;
import redone.event.CycleEventHandler;
import redone.game.content.minigames.castlewars.CastleWars;
import redone.game.npcs.Npc;
import redone.game.npcs.NpcHandler;
import redone.util.Misc;
import redone.util.Stream;
import redone.world.GlobalDropsHandler;
public class PlayerHandler {
@@ -158,19 +159,21 @@ public class PlayerHandler {
continue;
}
players[i].preProcessing();
while (players[i].processQueuedPackets()) {
;
}
players[i].process();
players[i].postProcessing();
players[i].getNextPlayerMovement();
players[i].preProcessing();
} catch (Exception e) {
e.printStackTrace();
}
}
for (int i = 0; i < PlayerHandler.players.length; i++) {
if (players[i] == null || !players[i].isActive) {
continue;
@@ -362,6 +365,11 @@ public class PlayerHandler {
}
str.endFrameVarSizeWord();
if (plr.refresh) {
GlobalDropsHandler.reset((Client)plr);
plr.refresh = false;
}
}
private void removePlayer(Player plr) {
@@ -62,7 +62,7 @@ public class Trading {
player.getActionSender().sendMessage("Sending trade request...");
o.getActionSender()
.sendMessage(player.playerName + ":tradereq:");
} else if (player.playerIsBusy() == false && o.playerIsBusy() == true) {
} else if (player.playerIsBusy() == true || o.playerIsBusy() == true) {
player.getActionSender().sendMessage("Other player is busy at the moment.");
}
} catch (Exception e) {
@@ -66,27 +66,34 @@ public class ShopAssistant {
public void resetShop(int ShopID) {
synchronized (player) {
int TotalItems = 0;
for (int i = 0; i < ShopHandler.MaxShopItems; i++) { //adds items in store when items are sold until max value.
if (ShopHandler.ShopItems[ShopID][i] > 0) {
TotalItems++;
player.TotalShopItems = 0;
for (int i = 0; i < ShopHandler.MaxShopItems; i++)
{ //adds items in store when items are sold until max value.
if (ShopHandler.ShopItems[ShopID][i] > 0)
{
player.TotalShopItems++;
}
}
if (TotalItems > ShopHandler.MaxShopItems) {
TotalItems = ShopHandler.MaxShopItems; //sets the stack of item sold to max value if the resulting amount is higher than max value.
if (player.TotalShopItems > 40){
player.TotalShopItems = 40; //sets the number of stack of item sold to max possible value if the resulting amount is higher than max value.
//Items sold when shops are full will dissapears. Much more code would be needed if we want to restrict selling while still permitting selling items already in shops and such.
}
player.getOutStream().createFrameVarSizeWord(53);
player.getOutStream().writeWord(3900);
player.getOutStream().writeWord(TotalItems);
player.getOutStream().writeWord(player.TotalShopItems);
int TotalCount = 0;
for (int i = 0; i < ShopHandler.ShopItems.length; i++) {
for (int i = 0; i < ShopHandler.ShopItems.length; i++)
{
if (ShopHandler.ShopItems[ShopID][i] > 0
|| i <= ShopHandler.ShopItemsStandard[ShopID]) {
|| i <= ShopHandler.ShopItemsStandard[ShopID])
{
if (ShopHandler.ShopItemsN[ShopID][i] > 254) {
player.getOutStream().writeByte(255);
player.getOutStream().writeDWord_v2(
ShopHandler.ShopItemsN[ShopID][i]);
} else {
}
else
{
player.getOutStream().writeByte(
ShopHandler.ShopItemsN[ShopID][i]);
}
@@ -98,7 +105,7 @@ public class ShopAssistant {
ShopHandler.ShopItems[ShopID][i]);
TotalCount++;
}
if (TotalCount > TotalItems) {
if (TotalCount > player.TotalShopItems) {
break;
}
}
@@ -328,11 +335,11 @@ public class ShopAssistant {
} else if (player.myShopId == CASTLE_SHOP) {
player.getActionSender().sendMessage(ItemAssistant.getItemName(removeId) + ": shop will buy for " + getCastleItemValue(removeId) + " castle war tickets." + ShopAdd);
}
player.getActionSender().sendMessage(ItemAssistant.getItemName(removeId) + ": shop will buy for " + ShopValue + " coins." + ShopAdd);
}
}
public boolean sellItem(int itemID, int fromSlot, int amount) {
player.getItemAssistant();
for (int i : Constants.ITEM_SELLABLE) {
if (i == itemID) {
@@ -348,6 +355,10 @@ public class ShopAssistant {
if(!player.isShopping) {
return false;
}
if (player.TotalShopItems >= 39)
{
player.getActionSender().sendMessage("If you sell more individuals items in this shop, they won't be displayed.");
}
if (amount > 0 && itemID == (player.playerItems[fromSlot] - 1)) {
if (ShopHandler.ShopSModifier[player.myShopId] > 1) {
@@ -372,9 +383,9 @@ public class ShopAssistant {
String itemName = ItemAssistant.getItemName(itemID).toLowerCase();
int TotPrice2 = 0;
if (player.myShopId == 138 || player.myShopId == 58 || player.myShopId == 139) {
TotPrice2 = (int) (getTokkulValue(itemID) * .85);
TotPrice2 = (int) Math.floor(getTokkulValue(itemID) * .85) * amount;
} else {
TotPrice2 = (int) Math.floor(getItemShopValue(itemID, amount, true) * amount); //Something about total price of item?
TotPrice2 = (int) Math.floor(getItemShopValue(itemID, amount, true) * amount); //Something about total price of item?
}
if (player.getItemAssistant().freeSlots() > 0 || player.getItemAssistant().playerHasItem(995) || player.getItemAssistant().playerHasItem(6529)) { //Checks to see if player has room for coins.
if (!ItemDefinitions.getDef()[itemID].isNoteable) { //Check to see if its notable.
@@ -133,11 +133,7 @@ public class ShopHandler {
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("shop")) {
int ShopID = Integer.parseInt(token3[0]);
@@ -244,21 +244,8 @@ public class ActionSender {
public ActionSender frame174(int sound, int vol, int delay) {
player.outStream.createFrame(174);
player.outStream.writeWord(sound);
player.outStream.writeByte(vol);
player.outStream.writeWord(delay);
player.updateRequired = true;
player.appearanceUpdateRequired = true;
return this;
}
public ActionSender frame174(int id, int type, int delay, int volume) {
if (player.outStream != null && player != null && id != -1) {
player.outStream.createFrame(174);
player.outStream.writeWord(id);
player.outStream.writeWord(delay);
player.outStream.writeWord(volume);
player.flushOutStream();
}
player.outStream.writeByte(vol);
return this;
}
@@ -567,8 +554,6 @@ public class ActionSender {
public ActionSender sendSound(int id, int volume, int delay) {
frame174(id, volume, delay);
player.updateRequired = true;
player.appearanceUpdateRequired = true;
return this;
}
@@ -22,7 +22,7 @@ public class ChangeRegions implements PacketType {
Doors.getSingleton().load();
Server.itemHandler.reloadItems(c);
Server.objectManager.loadObjects(c);
GlobalDropsHandler.load(c);
GlobalDropsHandler.reset(c);
c.getPlayerAssistant().removeObjects();// testing
c.saveFile = true;
if (c.skullTimer > 0) {
@@ -22,7 +22,7 @@ public class Chat implements PacketType {
if (AntiSpam.blockedWords(player, word, true) && !Connection.isMuted(player)) {
player.setChatTextUpdateRequired(true);
}
System.out.println(word);
//System.out.println(word);
if (Connection.isMuted(player)) {
player.getActionSender().sendMessage("You are muted and can't speak.");
player.setChatTextUpdateRequired(false);
@@ -43,7 +43,7 @@ public class ClickObject implements PacketType {
int[] size = object.getObjectSize();
player.startCurrentTask(1, new CycleEvent() {
CycleEvent objectWalkToEvent = new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
if (objectX != player.objectX || objectY != player.objectY || objectId != player.objectId) {
@@ -66,7 +66,10 @@ public class ClickObject implements PacketType {
@Override
public void stop() {}
});
};
player.startCurrentTask(1, objectWalkToEvent);
objectWalkToEvent.execute(player.getCurrentTask()); // cheap hax for instant event execution, since we don't support it
}
@Override
@@ -130,7 +130,7 @@ public class Commands implements PacketType {
player.getPlayerAssistant().closeAllWindows();
break;
case "commands":
player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle, ::debug");
player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle, ::debug, ::togglegfx");
break;
case "loc":
player.getActionSender().sendMessage(player.absX + "," + player.absY);
@@ -144,7 +144,7 @@ public class Commands implements PacketType {
case "randomtoggle":
case "togglerandom":
player.randomEventsEnabled = !player.randomEventsEnabled;
player.getActionSender().sendMessage("You will " + (player.debugMode ? "now" : "no longer") + " receieve random events.");
player.getActionSender().sendMessage("You will " + (player.randomEventsEnabled ? "now" : "no longer") + " receieve random events.");
break;
case "debug":
case "debugmode":
@@ -456,6 +456,14 @@ public class Commands implements PacketType {
}
player.getActionSender().sendMessage("Could not find " + teleTo + " they must be online!");
break;
case "tp":
case "teleport":
case "to":
if (arguments.length <= 2)
player.getPlayerAssistant().movePlayer(Integer.parseInt(arguments[0]), Integer.parseInt(arguments[1]), 0);
else
player.getPlayerAssistant().movePlayer(Integer.parseInt(arguments[0]), Integer.parseInt(arguments[1]), Integer.parseInt(arguments[2]));
break;
case "up":
player.getPlayerAssistant().movePlayer(player.absX, player.absY, player.heightLevel + 1);
player.getActionSender().sendMessage("You are now on height level " + player.heightLevel + ".");
@@ -518,7 +526,7 @@ public class Commands implements PacketType {
return;
}
int newItemID = Integer.parseInt(arguments[0]);
int newItemAmount = arguments[1] != null ? Integer.parseInt(arguments[1]) : 1;
int newItemAmount = arguments.length >= 2 ? Integer.parseInt(arguments[1]) : 1;
if (newItemID <= 10000 && newItemID >= 0) {
player.getItemAssistant().addItem(newItemID, newItemAmount);
if (player.isBusy()) {
@@ -53,6 +53,7 @@ public class Walking implements PacketType {
}
if (player.inTrade) {
player.inTrade = false;
player.getTrading().declineTrade(true);
}
if (player.tutorialProgress > 35 && !player.isSmithing) {
player.getPlayerAssistant().closeAllWindows();
+20 -4
View File
@@ -19,6 +19,10 @@ public class Misc {
return (int) Math.random() * range;
}
public static double distance(int x1, int y1, int x2, int y2 ) {
return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));
}
public static boolean goodDistance(int objectX, int objectY, int playerX, int playerY, int distance) {
return objectX - playerX <= distance && objectX - playerX >= -distance && objectY - playerY <= distance && objectY - playerY >= -distance;
}
@@ -255,6 +259,20 @@ public class Misc {
'&', '*', '\\', '\'', '@', '#', '+', '=', '\243', '$', '%', '"',
'[', ']' };
public static int[] delta(int x1, int y1, int x2, int y2) {
return new int[] {x2 - x1, y2 - y1};
}
public static int directionFromDelta(int x, int y) {
for (int a = 0; a < directionDeltaX.length; a++) {
if (directionDeltaX[a] == x && directionDeltaY[a] == y) {
return xlateDirectionToClient[a];
}
}
throw new IllegalArgumentException(String.format("Cannot find direction %d %d", x, y));
}
public static int direction(int srcX, int srcY, int x, int y) {
double dx = (double) x - srcX, dy = (double) y - srcY;
double angle = Math.atan(dy / dx);
@@ -273,10 +291,8 @@ public class Misc {
*/
}
public static byte directionDeltaX[] = new byte[] { 0, 1, 1, 1, 0, -1, -1,
-1 };
public static byte directionDeltaY[] = new byte[] { 1, 1, 0, -1, -1, -1, 0,
1 };
public static byte directionDeltaX[] = new byte[] { 0, 1, 1, 1, 0, -1, -1, -1 };
public static byte directionDeltaY[] = new byte[] { 1, 1, 0, -1, -1, -1, 0, 1 };
public static byte xlateDirectionToClient[] = new byte[] { 1, 2, 4, 7, 6,
5, 3, 0 };
@@ -0,0 +1,37 @@
package redone.util;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import com.thoughtworks.xstream.XStream;
import redone.game.npcs.NPCDefinition;
public class XStreamUtil {
private static XStreamUtil instance = new XStreamUtil();
private static XStream xStream = new XStream();
public static XStreamUtil getInstance() {
return instance;
}
static {
xStream.alias("npcDefinition", NPCDefinition.class);
}
public static XStream getXStream() {
return xStream;
}
public static void writeXML(Object object, File file) throws IOException {
FileOutputStream out = new FileOutputStream(file);
try {
xStream.toXML(object, out);
out.flush();
} finally {
out.close();
}
}
}
@@ -3,8 +3,9 @@ package redone.world;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import redone.event.CycleEvent;
import redone.event.CycleEventContainer;
import redone.event.CycleEventHandler;
@@ -23,12 +24,14 @@ public class GlobalDropsHandler {
/**
* time in seconds it takes for the item to respawn
*/
private static final int TIME_TO_RESPAWN = 30;
private static final int TIME_TO_RESPAWN = 20;
/**
* holds all the objects
*/
private static List<GlobalDrop> globalDrops = new ArrayList<GlobalDrop>();
private static Set<GlobalDrop> spawnedDrops = new HashSet<>();
/**
* loads the items
@@ -37,16 +40,17 @@ public class GlobalDropsHandler {
String Data;
BufferedReader Checker;
try {
Checker = new BufferedReader(new FileReader(
"./data/cfg/globaldrops.txt"));
Checker = new BufferedReader(new FileReader("./data/cfg/globaldrops.txt"));
while ((Data = Checker.readLine()) != null) {
if (Data.startsWith("#")) {
continue;
}
String[] args = Data.split(":");
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]),
Integer.parseInt(args[1]), Integer.parseInt(args[2]),
Integer.parseInt(args[3])));
if(args.length == 5) {
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3]), Integer.parseInt(args[4])));
} else {
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3])));
}
}
Checker.close();
} catch (Exception e) {
@@ -54,31 +58,55 @@ public class GlobalDropsHandler {
}
Misc.println("Loaded " + globalDrops.size() + " global drops.");
for (Player player : PlayerHandler.players) {
final Client client = (Client) player;
if (client != null) {
CycleEventHandler.getSingleton().addEvent(client, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
for (GlobalDrop drop : globalDrops) {
if (drop.isTaken()) {
if (System.currentTimeMillis() - drop.getTakenAt() >= TIME_TO_RESPAWN * 1000) {
drop.setTaken(false);
if (client.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
client.getActionSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), 0);
for (Player player : PlayerHandler.players) {
Client player2 = (Client) player;
if(player2 != null) {
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
for (GlobalDrop drop : globalDrops) {
if (drop.isTaken() && drop.isSpawned()) {
if (System.currentTimeMillis() - drop.getTakenAt() >= TIME_TO_RESPAWN * 1000) {
drop.setTaken(false);
if (player2.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
player2.getActionSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
spawnedDrops.add(drop);
}
}
}
}
}
}
@Override
public void stop() {
// TODO Auto-generated method stub
}
@Override
public void stop() {
}
}, 1);
}
}
}
public static void read() {
String Data;
BufferedReader Checker;
try {
Checker = new BufferedReader(new FileReader("./data/cfg/globaldrops.txt"));
while ((Data = Checker.readLine()) != null) {
if (Data.startsWith("#")) {
continue;
}
String[] args = Data.split(":");
if(args.length == 5) {
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3]), Integer.parseInt(args[4])));
} else {
globalDrops.add(new GlobalDrop(Integer.parseInt(args[0]), Integer.parseInt(args[1]), Integer.parseInt(args[2]), Integer.parseInt(args[3])));
}
}
Checker.close();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* See if a drop exists at the given place
@@ -99,12 +127,21 @@ public class GlobalDropsHandler {
}
return null;
}
public static boolean itemExists(int a, int b, int c, boolean yes) {
for (GlobalDrop drop : spawnedDrops) {
if (drop.getId() == a && drop.getX() == b && drop.getY() == c) {
return true;
}
}
return false;
}
/**
* Pick up an item at the given location
*
* @param client
* the client
* @param Player
* the Player
* @param a
* item id
* @param b
@@ -112,7 +149,7 @@ public class GlobalDropsHandler {
* @param c
* cord y
*/
public static void pickup(Client client, int a, int b, int c) {
public static void pickup(Client Player, int a, int b, int c) {
GlobalDrop drop = itemExists(a, b, c);
if (drop == null) {
return;
@@ -120,19 +157,15 @@ public class GlobalDropsHandler {
if (drop.isTaken()) {
return;
}
drop.setTakenAt(System.currentTimeMillis());
drop.setTaken(true);
if (client.getItemAssistant().freeSlots() > 0) {
client.getItemAssistant().addItem(drop.getId(), drop.getAmount());
}
// TODO use the region manager for this...
for (Player player : PlayerHandler.players) {
Client cl = (Client) player;
if (cl != null) {
if (cl.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
// cl.getItems().removeGroundItem(drop.getId(), drop.getX(),
// drop.getY(), drop.getAmount());
if (Player.getItemAssistant().freeSlots() > 0) {
Player.getItemAssistant().addItem(drop.getId(), drop.getAmount());
drop.setTakenAt(System.currentTimeMillis());
drop.setTaken(true);
for (Player player : PlayerHandler.players) {
Client cl = (Client) player;
if (cl != null) {
cl.getActionSender().removeGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount());
spawnedDrops.remove(drop);
}
}
}
@@ -141,15 +174,33 @@ public class GlobalDropsHandler {
/**
* Loads all the items when a player changes region
*
* @param client
* the client
* @param Player
* the Player
*/
public static void load(Client client) {
public static void load(Client player) {
for (GlobalDrop drop : globalDrops) {
if (!drop.isTaken()) {
if (client.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
client.getActionSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), 0);
}
if (!drop.isTaken() && !drop.isSpawned() && !itemExists(drop.getId(), drop.getX(), drop.getY(), true) && player.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
player.getActionSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
spawnedDrops.add(drop);
drop.setSpawned(true);
}
}
}
public static void reset(Client player) {
for(GlobalDrop drop : globalDrops) {
if(player.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
player.getActionSender().removeGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount());
}
}
spawnedDrops.clear();
globalDrops.clear();
read();
for (GlobalDrop drop : globalDrops) {
if (!drop.isTaken() && !drop.isSpawned() && !itemExists(drop.getId(), drop.getX(), drop.getY(), true) && player.distanceToPoint(drop.getX(), drop.getY()) <= 60) {
player.getActionSender().createGroundItem(drop.getId(), drop.getX(), drop.getY(), drop.getAmount(), drop.getHeight());
spawnedDrops.add(drop);
drop.setSpawned(true);
}
}
}
@@ -164,11 +215,13 @@ public class GlobalDropsHandler {
/**
* cord x
*/
int x;
int itemX;
/**
* cord y
*/
int y;
int itemY;
private int height;
/**
* item id
*/
@@ -181,6 +234,9 @@ public class GlobalDropsHandler {
* has the item been taken
*/
boolean taken = false;
private boolean spawned = false;
/**
* Time it was taken at
*/
@@ -189,20 +245,29 @@ public class GlobalDropsHandler {
/**
* Sets the drop arguments
*
* @param a
* @param pickAxe
* item id
* @param b
* item amount
* @param c
* @param player
* cord x
* @param d
* cord y
*/
public GlobalDrop(int a, int b, int c, int d) {
id = a;
amount = b;
x = c;
y = d;
public GlobalDrop(int id, int amount, int itemX, int itemY) {
this.id = id;
this.amount = amount;
this.itemX = itemX;
this.itemY = itemY;
}
public GlobalDrop(int id, int amount, int itemX, int itemY, int height) {
this.id = id;
this.amount = amount;
this.itemX = itemX;
this.itemY = itemY;
this.height = height;
}
/**
@@ -211,7 +276,7 @@ public class GlobalDropsHandler {
* @return return the statement
*/
public int getX() {
return x;
return itemX;
}
/**
@@ -220,7 +285,7 @@ public class GlobalDropsHandler {
* @return return the statement
*/
public int getY() {
return y;
return itemY;
}
/**
@@ -279,6 +344,22 @@ public class GlobalDropsHandler {
return takenAt;
}
public boolean isSpawned() {
return spawned;
}
public void setSpawned(boolean spawned) {
this.spawned = spawned;
}
public int getHeight() {
return height;
}
public void setHeight(int height) {
this.height = height;
}
}
}
@@ -406,7 +406,7 @@ public int itemAmount(String name, int itemId, int itemX, int itemY) {
if (line.equals("[ENDOFITEMLIST]")) {
try {
characterfile.close();
} catch (IOException ಠ_ಠ) {}
} catch (IOException e) {}
//return true;
}
}
@@ -63,7 +63,9 @@ public class ObjectManager {
}, ticks);
}
public static void doubleGateTicks(final Client player, final int objectId, final int objectX, final int objectY, final int x1, final int y1, final int x2, final int y2, final int objectH, final int face, int ticks) {
public static void doubleGateTicks(final Client player, final int objectId, final int objectX, final int objectY,
final int x1, final int y1, final int x2, final int y2,
final int objectH, final int face, int ticks) {
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -279,6 +279,10 @@ public final class ObjectDef {
return aBoolean767;
}
public boolean isUnshootable() {
return aBoolean757;
}
public boolean aBoolean736;
public String name;
public int anInt744;
@@ -3,6 +3,7 @@ package redone.world.clip;
import java.util.LinkedList;
import redone.game.players.Client;
import redone.util.Misc;
public class PathFinder {
@@ -209,6 +210,207 @@ public class PathFinder {
}
}
public int getRegionCoordinate(int x) {
return (x >> 3) - 6;
}
public int getLocalCoordinate(int x) {
return x - 8 * getRegionCoordinate(x);
}
public boolean accessible(int x, int y, int heightLevel, int destX, int destY) {
destX = destX - 8 * getRegionCoordinate(x);
destY = destY - 8 * getRegionCoordinate(y);
int[][] via = new int[104][104];
int[][] cost = new int[104][104];
LinkedList<Integer> tileQueueX = new LinkedList<Integer>();
LinkedList<Integer> tileQueueY = new LinkedList<Integer>();
for (int xx = 0; xx < 104; xx++) {
for (int yy = 0; yy < 104; yy++) {
cost[xx][yy] = 99999999;
}
}
int curX = getLocalCoordinate(x);
int curY = getLocalCoordinate(y);
via[curX][curY] = 99;
cost[curX][curY] = 0;
int tail = 0;
tileQueueX.add(curX);
tileQueueY.add(curY);
boolean foundPath = false;
int pathLength = 4000;
while (tail != tileQueueX.size() && tileQueueX.size() < pathLength) {
curX = tileQueueX.get(tail);
curY = tileQueueY.get(tail);
int curAbsX = getRegionCoordinate(x) * 8 + curX;
int curAbsY = getRegionCoordinate(y) * 8 + curY;
if (curX == destX && curY == destY) {
foundPath = true;
break;
}
tail = (tail + 1) % pathLength;
int thisCost = cost[curX][curY] + 1;
if (curY > 0
&& via[curX][curY - 1] == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, heightLevel) & 0x1280102) == 0) {
tileQueueX.add(curX);
tileQueueY.add(curY - 1);
via[curX][curY - 1] = 1;
cost[curX][curY - 1] = thisCost;
}
if (curX > 0
&& via[curX - 1][curY] == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, heightLevel) & 0x1280108) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY);
via[curX - 1][curY] = 2;
cost[curX - 1][curY] = thisCost;
}
if (curY < 104 - 1
&& via[curX][curY + 1] == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, heightLevel) & 0x1280120) == 0) {
tileQueueX.add(curX);
tileQueueY.add(curY + 1);
via[curX][curY + 1] = 4;
cost[curX][curY + 1] = thisCost;
}
if (curX < 104 - 1
&& via[curX + 1][curY] == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, heightLevel) & 0x1280180) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY);
via[curX + 1][curY] = 8;
cost[curX + 1][curY] = thisCost;
}
if (curX > 0
&& curY > 0
&& via[curX - 1][curY - 1] == 0
&& (Region.getClipping(curAbsX - 1, curAbsY - 1,
heightLevel) & 0x128010e) == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, heightLevel) & 0x1280108) == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, heightLevel) & 0x1280102) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY - 1);
via[curX - 1][curY - 1] = 3;
cost[curX - 1][curY - 1] = thisCost;
}
if (curX > 0
&& curY < 104 - 1
&& via[curX - 1][curY + 1] == 0
&& (Region.getClipping(curAbsX - 1, curAbsY + 1,
heightLevel) & 0x1280138) == 0
&& (Region.getClipping(curAbsX - 1, curAbsY, heightLevel) & 0x1280108) == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, heightLevel) & 0x1280120) == 0) {
tileQueueX.add(curX - 1);
tileQueueY.add(curY + 1);
via[curX - 1][curY + 1] = 6;
cost[curX - 1][curY + 1] = thisCost;
}
if (curX < 104 - 1
&& curY > 0
&& via[curX + 1][curY - 1] == 0
&& (Region.getClipping(curAbsX + 1, curAbsY - 1,
heightLevel) & 0x1280183) == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, heightLevel) & 0x1280180) == 0
&& (Region.getClipping(curAbsX, curAbsY - 1, heightLevel) & 0x1280102) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY - 1);
via[curX + 1][curY - 1] = 9;
cost[curX + 1][curY - 1] = thisCost;
}
if (curX < 104 - 1
&& curY < 104 - 1
&& via[curX + 1][curY + 1] == 0
&& (Region.getClipping(curAbsX + 1, curAbsY + 1,
heightLevel) & 0x12801e0) == 0
&& (Region.getClipping(curAbsX + 1, curAbsY, heightLevel) & 0x1280180) == 0
&& (Region.getClipping(curAbsX, curAbsY + 1, heightLevel) & 0x1280120) == 0) {
tileQueueX.add(curX + 1);
tileQueueY.add(curY + 1);
via[curX + 1][curY + 1] = 12;
cost[curX + 1][curY + 1] = thisCost;
}
}
return foundPath;
}
public static boolean isProjectilePathClear(int x0, int y0, int z, int x1, int y1) {
int deltaX = x1 - x0;
int deltaY = y1 - y0;
double error = 0;
final double deltaError = Math.abs(
(deltaY) / (deltaX == 0
? ((double) deltaY)
: ((double) deltaX)));
int x = x0;
int y = y0;
int pX = x;
int pY = y;
boolean incrX = x0 < x1;
boolean incrY = y0 < y1;
while (true) {
if (x != x1) {
x += (incrX ? 1 : -1);
}
if (y != y1) {
error += deltaError;
if (error >= 0.5) {
y += (incrY ? 1 : -1);
error -= 1;
}
}
if (!shootable(x, y, z, pX, pY)) {
return false;
}
if (incrX && incrY
&& x >= x1 && y >= y1) {
break;
} else if (!incrX && !incrY
&& x <= x1 && y <= y1) {
break;
} else if (!incrX && incrY
&& x <= x1 && y >= y1) {
break;
} else if (incrX && !incrY
&& x >= x1 && y <= y1) {
break;
}
pX = x;
pY = y;
}
return true;
}
private static boolean shootable(int x, int y, int z, int px, int py) {
if (x == px && y == py) {
return true;
}
int[] delta1 = Misc.delta(x, y, px, py);
int[] delta2 = Misc.delta(px, py, x, y);
int dir = Misc.directionFromDelta(delta1[0], delta1[1]);
int dir2 = Misc.directionFromDelta(delta2[0], delta2[1]);
if (dir == -1 || dir2 == -1) {
return false;
}
return Region.canMove(x, y, z, dir) && Region.canMove(px, py, z, dir2)
|| Region.canShoot(x, y, z, dir) && Region.canShoot(px, py, z, dir2);
}
public int localize(int x, int mapRegion) {
return x - 8 * mapRegion;
}
@@ -24,10 +24,6 @@ public class Region {
}
return null;
}
public static boolean blockedShot(int x, int y, int z) {
return (getClipping(x, y, z) & 0x20000) == 0;
}
public static Objects getObject(int id, int x, int y, int z) {
Region r = getRegion(x, y);
@@ -65,7 +61,121 @@ public class Region {
}
clips[height][x - regionAbsX][y - regionAbsY] |= shift;
}
private void addProjectileClip(int x, int y, int height, int shift) {
int regionAbsX = (id >> 8) * 64;
int regionAbsY = (id & 0xff) * 64;
if (projectileClips[height] == null) {
projectileClips[height] = new int[64][64];
}
projectileClips[height][x - regionAbsX][y - regionAbsY] |= shift;
}
public static boolean canMove(int x, int y, int z, int direction) {
if (direction == 6) {
if ((Region.getClipping(x, y - 1, z) & 0x1280102) == 0) {
return true;
}
} else if (direction == 3) {
if ((Region.getClipping(x - 1, y, z) & 0x1280108) == 0) {
return true;
}
} else if (direction == 1) {
if ((Region.getClipping(x, y + 1, z) & 0x1280120) == 0) {
return true;
}
} else if (direction == 4) {
if ((Region.getClipping(x + 1, y, z) & 0x1280180) == 0) {
return true;
}
} else if (direction == 5) {
if ((Region.getClipping(x - 1, y - 1, z) & 0x128010e) == 0
&& (Region.getClipping(x - 1, y, z) & 0x1280108) == 0
&& (Region.getClipping(x, y - 1, z) & 0x1280102) == 0) {
return true;
}
} else if (direction == 0) {
if ((Region.getClipping(x - 1, y + 1, z) & 0x1280138) == 0
&& (Region.getClipping(x - 1, y, z) & 0x1280108) == 0
&& (Region.getClipping(x, y + 1, z) & 0x1280120) == 0) {
return true;
}
} else if (direction == 7) {
if ((Region.getClipping(x + 1, y - 1, z) & 0x1280183) == 0
&& (Region.getClipping(x + 1, y, z) & 0x1280180) == 0
&& (Region.getClipping(x, y - 1, z) & 0x1280102) == 0) {
return true;
}
} else if (direction == 2) {
if ((Region.getClipping(x + 1, y + 1, z) & 0x12801e0) == 0
&& (Region.getClipping(x + 1, y, z) & 0x1280180) == 0
&& (Region.getClipping(x, y + 1, z) & 0x1280120) == 0) {
return true;
}
} else if (direction == -1) {
throw new IllegalArgumentException("Invalid direction: " + direction);
}
return false;
}
public static boolean canShoot(int x, int y, int z, int direction) {
if (direction == 0) {
return !projectileBlockedNorthWest(x, y, z) && !projectileBlockedNorth(x, y, z)
&& !projectileBlockedWest(x, y, z);
} else if (direction == 1) {
return !projectileBlockedNorth(x, y, z);
} else if (direction == 2) {
return !projectileBlockedNorthEast(x, y, z) && !projectileBlockedNorth(x, y, z)
&& !projectileBlockedEast(x, y, z);
} else if (direction == 3) {
return !projectileBlockedWest(x, y, z);
} else if (direction == 4) {
return !projectileBlockedEast(x, y, z);
} else if (direction == 5) {
return !projectileBlockedSouthWest(x, y, z) && !projectileBlockedSouth(x, y, z)
&& !projectileBlockedWest(x, y, z);
} else if (direction == 6) {
return !projectileBlockedSouth(x, y, z);
} else if (direction == 7) {
return !projectileBlockedSouthEast(x, y, z) && !projectileBlockedSouth(x, y, z)
&& !projectileBlockedEast(x, y, z);
}
return false;
}
public static boolean projectileBlockedNorth(int x, int y, int z) {
return (getProjectileClipping(x, y + 1, z) & 0x1280120) != 0;
}
public static boolean projectileBlockedEast(int x, int y, int z) {
return (getProjectileClipping(x + 1, y, z) & 0x1280180) != 0;
}
public static boolean projectileBlockedSouth(int x, int y, int z) {
return (getProjectileClipping(x, y - 1, z) & 0x1280102) != 0;
}
public static boolean projectileBlockedWest(int x, int y, int z) {
return (getProjectileClipping(x - 1, y, z) & 0x1280108) != 0;
}
public static boolean projectileBlockedNorthEast(int x, int y, int z) {
return (getProjectileClipping(x + 1, y + 1, z) & 0x12801e0) != 0;
}
public static boolean projectileBlockedNorthWest(int x, int y, int z) {
return (getProjectileClipping(x - 1, y + 1, z) & 0x1280138) != 0;
}
public static boolean projectileBlockedSouthEast(int x, int y, int z) {
return (getProjectileClipping(x + 1, y - 1, z) & 0x1280183) != 0;
}
public static boolean projectileBlockedSouthWest(int x, int y, int z) {
return (getProjectileClipping(x - 1, y - 1, z) & 0x128010e) != 0;
}
public static boolean canMove(int startX, int startY, int endX, int endY, int height, int xLength, int yLength) {
int diffX = endX - startX;
int diffY = endY - startY;
@@ -149,6 +259,15 @@ public class Region {
return clips[height][x - regionAbsX][y - regionAbsY];
}
private int getProjectileClip(int x, int y, int height) {
int regionAbsX = (id >> 8) * 64;
int regionAbsY = (id & 0xff) * 64;
if (projectileClips[height] == null) {
return 0;
}
return projectileClips[height][x - regionAbsX][y - regionAbsY];
}
private static void addClipping(int x, int y, int height, int shift) {
int regionX = x >> 3;
int regionY = y >> 3;
@@ -161,9 +280,23 @@ public class Region {
}
}
private static void addProjectileClipping(int x, int y, int height, int shift) {
int regionX = x >> 3;
int regionY = y >> 3;
int regionId = (regionX / 8 << 8) + regionY / 8;
for (Region r : regions) {
if (r.id() == regionId) {
r.addProjectileClip(x, y, height, shift);
break;
}
}
}
private static Region[] regions;
private final int id;
private final int[][][] clips = new int[4][][];
private final int[][][] projectileClips = new int[4][][];
private boolean members = false;
public Region(int id, boolean members) {
@@ -298,6 +431,107 @@ public class Region {
}
}
private static void addProjectileClippingForVariableObject(int x, int y, int height,
int type, int direction, boolean flag) {
if (type == 0) {
if (direction == 0) {
addProjectileClipping(x, y, height, 128);
addProjectileClipping(x - 1, y, height, 8);
} else if (direction == 1) {
addProjectileClipping(x, y, height, 2);
addProjectileClipping(x, y + 1, height, 32);
} else if (direction == 2) {
addProjectileClipping(x, y, height, 8);
addProjectileClipping(x + 1, y, height, 128);
} else if (direction == 3) {
addProjectileClipping(x, y, height, 32);
addProjectileClipping(x, y - 1, height, 2);
}
} else if (type == 1 || type == 3) {
if (direction == 0) {
addProjectileClipping(x, y, height, 1);
addProjectileClipping(x - 1, y, height, 16);
} else if (direction == 1) {
addProjectileClipping(x, y, height, 4);
addProjectileClipping(x + 1, y + 1, height, 64);
} else if (direction == 2) {
addProjectileClipping(x, y, height, 16);
addProjectileClipping(x + 1, y - 1, height, 1);
} else if (direction == 3) {
addProjectileClipping(x, y, height, 64);
addProjectileClipping(x - 1, y - 1, height, 4);
}
} else if (type == 2) {
if (direction == 0) {
addProjectileClipping(x, y, height, 130);
addProjectileClipping(x - 1, y, height, 8);
addProjectileClipping(x, y + 1, height, 32);
} else if (direction == 1) {
addProjectileClipping(x, y, height, 10);
addProjectileClipping(x, y + 1, height, 32);
addProjectileClipping(x + 1, y, height, 128);
} else if (direction == 2) {
addProjectileClipping(x, y, height, 40);
addProjectileClipping(x + 1, y, height, 128);
addProjectileClipping(x, y - 1, height, 2);
} else if (direction == 3) {
addProjectileClipping(x, y, height, 160);
addProjectileClipping(x, y - 1, height, 2);
addProjectileClipping(x - 1, y, height, 8);
}
}
if (flag) {
if (type == 0) {
if (direction == 0) {
addProjectileClipping(x, y, height, 65536);
addProjectileClipping(x - 1, y, height, 4096);
} else if (direction == 1) {
addProjectileClipping(x, y, height, 1024);
addProjectileClipping(x, y + 1, height, 16384);
} else if (direction == 2) {
addProjectileClipping(x, y, height, 4096);
addProjectileClipping(x + 1, y, height, 65536);
} else if (direction == 3) {
addProjectileClipping(x, y, height, 16384);
addProjectileClipping(x, y - 1, height, 1024);
}
}
if (type == 1 || type == 3) {
if (direction == 0) {
addProjectileClipping(x, y, height, 512);
addProjectileClipping(x - 1, y + 1, height, 8192);
} else if (direction == 1) {
addProjectileClipping(x, y, height, 2048);
addProjectileClipping(x + 1, y + 1, height, 32768);
} else if (direction == 2) {
addProjectileClipping(x, y, height, 8192);
addProjectileClipping(x + 1, y + 1, height, 512);
} else if (direction == 3) {
addProjectileClipping(x, y, height, 32768);
addProjectileClipping(x - 1, y - 1, height, 2048);
}
} else if (type == 2) {
if (direction == 0) {
addProjectileClipping(x, y, height, 66560);
addProjectileClipping(x - 1, y, height, 4096);
addProjectileClipping(x, y + 1, height, 16384);
} else if (direction == 1) {
addProjectileClipping(x, y, height, 5120);
addProjectileClipping(x, y + 1, height, 16384);
addProjectileClipping(x + 1, y, height, 65536);
} else if (direction == 2) {
addProjectileClipping(x, y, height, 20480);
addProjectileClipping(x + 1, y, height, 65536);
addProjectileClipping(x, y - 1, height, 1024);
} else if (direction == 3) {
addProjectileClipping(x, y, height, 81920);
addProjectileClipping(x, y - 1, height, 1024);
addProjectileClipping(x - 1, y, height, 4096);
}
}
}
}
private static void addClippingForSolidObject(int x, int y, int height,
int xLength, int yLength, boolean flag) {
int clipping = 256;
@@ -311,6 +545,19 @@ public class Region {
}
}
private static void addProjectileClippingForSolidObject(int x, int y, int height,
int xLength, int yLength, boolean flag) {
int clipping = 256;
if (flag) {
clipping += 0x20000;
}
for (int i = x; i < x + xLength; i++) {
for (int i2 = y; i2 < y + yLength; i2++) {
addProjectileClipping(i, i2, height, clipping);
}
}
}
public static void addObject(int objectId, int x, int y, int height, int type, int direction, boolean startUp) {
if (ObjectDef.getObjectDef(objectId) == null) {
}
@@ -327,16 +574,26 @@ public class Region {
if (ObjectDef.getObjectDef(objectId).hasActions()
&& ObjectDef.getObjectDef(objectId).aBoolean767()) {
addClipping(x, y, height, 0x200000);
if (ObjectDef.getObjectDef(objectId).isUnshootable()) {
addProjectileClipping(x, y, height, 0x200000);
}
}
} else if (type >= 9) {
if (ObjectDef.getObjectDef(objectId).aBoolean767()) {
addClippingForSolidObject(x, y, height, xLength, yLength,
ObjectDef.getObjectDef(objectId).solid());
if (ObjectDef.getObjectDef(objectId).isUnshootable()) {
addProjectileClippingForSolidObject(x, y, height, xLength, yLength,
ObjectDef.getObjectDef(objectId).solid());
}
}
} else if (type >= 0 && type <= 3) {
if (ObjectDef.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());
}
}
}
Region r = getRegion(x, y);
@@ -363,6 +620,21 @@ public class Region {
return 0;
}
public static int getProjectileClipping(int x, int y, int height) {
if (height > 3) {
height = 0;
}
int regionX = x >> 3;
int regionY = y >> 3;
int regionId = (regionX / 8 << 8) + regionY / 8;
for (Region r : regions) {
if (r.id() == regionId) {
return r.getProjectileClip(x, y, height);
}
}
return 0;
}
public static boolean getClipping(int x, int y, int height, int moveTypeX,
int moveTypeY) {
try {
+1 -1
View File
@@ -2,6 +2,6 @@
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="assets/netty-3.6.6.Final.jar"/>
<classpathentry kind="lib" path="libs/netty-3.6.6.Final.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+1
View File
@@ -0,0 +1 @@
/bin/
@@ -0,0 +1,2 @@
"C:\Program Files\Java\jdk1.8.0_201\bin\java.exe" -jar 2006rebotted.jar
pause
Binary file not shown.
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Client
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More