Compare commits

...

62 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
Daniel Ginovker e26f32439a Revert "Npc definitions/npc aggressiveness (#169)" (#171)
This reverts commit 2aef86ed25.
2019-11-11 00:22:35 -05:00
Daniel Ginovker 2f26fbe5fb Lag fixed :) (#170) 2019-11-11 00:21:40 -05:00
Mr Extremez 2aef86ed25 Npc definitions/npc aggressiveness (#169)
Let me know how it works
2019-11-11 00:20:00 -05:00
Danial 6cda5d5c78 Disable graphics, lower CPU & GPU usage (#168)
* Fix local Parabot instructions

* Add kick command, and force logout function

* Add graphics toggle option

* add alias
2019-11-10 23:32:33 -05:00
Mr Extremez d53ed61064 Finally should fix aggressiveness smh (#165)
closes #160

Let me know if this doesn't work, but hoping it does. My local testing had it working perfectly
2019-11-10 22:09:54 -05:00
dginovker 679fad7b18 latest compile 2019-11-10 19:50:19 -05:00
Gptaqbc dc3f561868 Faster shop restocking - Brought back normal stack of items in shops … (#164)
* 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
2019-11-10 19:46:24 -05:00
dginovker c6155eb529 4u Captcha 2019-11-10 13:00:54 -05:00
Gptaqbc 4db7ee6761 Fixed an issue with teleother that wasnt working at all. (#159)
Fixed an issue with teleother that wasnt working at all.
2019-11-10 12:26:41 -05:00
dginovker 8d14d76313 latest compile 2019-11-10 12:20:34 -05:00
Mr Extremez aaf0a48140 Fixes npc aggressiveness (#155)
closes #142
2019-11-10 12:18:00 -05:00
Danial 68013f3498 Add kick command, and force logout function (#154)
* Fix local Parabot instructions

* Add kick command, and force logout function
2019-11-10 12:17:47 -05:00
dginovker afd1da91e1 Latest compile 2019-11-09 18:14:00 -05:00
Josh Shippam 4490de88c4 Merge pull request #151 from Dark98/master
Fix Onyx Amulet Stringing
2019-11-09 22:06:19 +00:00
Dark98 58dab39d3b Fix Onyx Amulet Stringing 2019-11-09 22:05:29 +00:00
Josh Shippam 8ef0b3662e Merge pull request #150 from Dark98/master
Fix Highscores problem & only Save Highscores for Mod & Lower
2019-11-09 21:53:13 +00:00
Dark98 6b4b1eddf7 Fix Highscores problem & only Save Highscores for Mod & Lower 2019-11-09 21:51:05 +00:00
Dark98 c2a768a354 Merge https://github.com/dginovker/2006rebotted 2019-11-09 21:49:22 +00:00
Josh Shippam 3a50391304 Update Cache Path to 2006rebotted (#149)
Cool
2019-11-09 16:45:58 -05:00
Dark98 c152a1c8d9 Update Cache Path to 2006rebotted 2019-11-09 21:36:24 +00:00
dginovker e2f700de67 Merge branch 'master' of https://github.com/dginovker/2006rebotted 2019-11-09 15:36:46 -05:00
dginovker f13f0af171 2006rebotted rename + latest compile 2019-11-09 15:35:57 -05:00
Gptaqbc 2ade1073b9 Fixed issue #143 - When casting spells without autocast your player will always move next to the player you casted a spell on. (#147)
Fixed issue #143 - When casting spells without autocast your player will always move next to the player you casted a spell on.
2019-11-09 15:09:59 -05:00
dginovker 452ee7a637 Latest compile 2019-11-09 00:12:56 -05:00
Gptaqbc 87440ecd2a Removing double sell message "You sold x items for x gp". (#141)
* Update NpcHandler.class

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

* Update NpcHandler.java

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

closes #47

* Buy/Sell-X--Buying-loop-lagging-issue-fix--General-shop-using-fixes--Trading-amount-fix

- Added buy/sell X feature
- Fixed a lag with the buying loop when buying high amount. Instead of spam buying 1 at a  times it divide the amount to buy in equal parts and buy in increments.
- Cant remember at all I'll edit after eating.

* Removing double sell message "You sold x items for x gp".

Removing double sell message "You sold x items for x gp".

* Fixing trading bug not working at some places and re commiting the shopAssistant removal of sell message twice

Fixing trading bug not working at some places and re commiting the shopAssistant removal of sell message twice

* reverting stuff I broke in this file

reverting stuff I broke in this file
2019-11-09 00:09:33 -05:00
Gptaqbc dcc7984e27 Teleother (#144)
* Update NpcHandler.class

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

* Update NpcHandler.java

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

closes #47

* Buy/Sell-X--Buying-loop-lagging-issue-fix--General-shop-using-fixes--Trading-amount-fix

- Added buy/sell X feature
- Fixed a lag with the buying loop when buying high amount. Instead of spam buying 1 at a  times it divide the amount to buy in equal parts and buy in increments.
- Cant remember at all I'll edit after eating.

* Removing double sell message "You sold x items for x gp".

Removing double sell message "You sold x items for x gp".

* Fixing trading bug not working at some places and re commiting the shopAssistant removal of sell message twice

Fixing trading bug not working at some places and re commiting the shopAssistant removal of sell message twice

* reverting stuff I broke in this file

reverting stuff I broke in this file

* Teleother fixed

Teleother fixed.

* fixed an issue I forgot to test :)

fixed an issue I forgot to test :)
2019-11-09 00:08:56 -05:00
dginovker 0a11ce01d1 Fix localhost Parabot 2019-11-08 19:25:53 -05:00
dginovker 9db31e52c9 Latest compile 2019-11-06 11:10:27 -05:00
Mr Extremez ff75851cad Fixes run energy, aggressiveness, and highscores (#137)
* Update ShopAssistant.java

Adds ability to sell tokkul items back to shop for tokkul

* Fixes npc aggressiveness closes #132

* Fixes highscores for admin + ingame. Closes #131

* Caps run energy at 100%. Closes #135
2019-11-06 10:55:08 -05:00
dginovker a176bfa9cb Fix for Parabot localhost 2019-11-04 19:57:33 -05:00
Daniel Ginovker 16b23be1d5 fix artifacts (#134) 2019-11-04 18:34:42 -05:00
dginovker bb936bf809 latest compile 2019-11-03 22:10:46 -05:00
dginovker 5c4ca489ef Merge branch 'master' of https://github.com/dginovker/2006rebotted 2019-11-03 22:07:57 -05:00
dginovker fcb3fa255f Latest compile 2019-11-03 22:07:48 -05:00
Gptaqbc b02950045c Buy/sell x buying loop lagging issue fix general shop using fixes trading amount fix (#133)
* Update NpcHandler.class

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

* Update NpcHandler.java

Fixed the diagonal safefpotting combat bug. The NPC will move when it detects that the player is standing diagonally to it.

Still have some issue around objects but that's another story.

closes #47

* Buy/Sell-X--Buying-loop-lagging-issue-fix--General-shop-using-fixes--Trading-amount-fix

- Added buy/sell X feature
- Fixed a lag with the buying loop when buying high amount. Instead of spam buying 1 at a  times it divide the amount to buy in equal parts and buy in increments.
- Cant remember at all I'll edit after eating.
2019-11-03 22:02:39 -05:00
dginovker dcf6cbdc45 Latest compile + .gitignore 2019-10-31 14:03:18 -04:00
Danial efc6b3c8be Misc changes (#129)
* fixup "cantattack" command

* remove duplicate code

* fix brimhaven vines

* fixup cluescroll drops

* add clicktotele alias

* check player has an axe

* remove duplicate item id
2019-10-30 21:21:19 -04:00
Daniel Ginovker 9950dbe315 Easier setup (#128)
* Simpler compilation steps

* Add images

* Added artifact METAs

* Artifact fix
2019-10-28 20:46:04 -04:00
209 changed files with 139825 additions and 3713 deletions
+4
View File
@@ -1 +1,5 @@
2006Redone\ Server/data/characters/
.idea/
.idea/workspace.xml
**/.idea/workspace.xml
**/.idea/*
+1 -1
View File
@@ -7,7 +7,7 @@
<sourceFolder url="file://$MODULE_DIR$/2006Redone file_server/src" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/2006Redone Client/src" isTestSource="false" />
</content>
<orderEntry type="jdk" jdkName="1.8" jdkType="JavaSDK" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library>
+11
View File
@@ -0,0 +1,11 @@
<component name="ArtifactManager">
<artifact type="jar" name="2006rebotted:jar">
<output-path>$PROJECT_DIR$/CompiledServer/artifacts/2006rebotted_jar</output-path>
<root id="archive" name="2006rebotted.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/2006Redone Client/METAs/Client Meta/META-INF/MANIFEST.MF" />
</element>
<element id="module-output" name="2006rebotted" />
</root>
</artifact>
</component>
+11
View File
@@ -0,0 +1,11 @@
<component name="ArtifactManager">
<artifact type="jar" name="localhost_2006rebotted:jar">
<output-path>$PROJECT_DIR$/CompiledServer/artifacts/localhost_2006rebotted_jar</output-path>
<root id="archive" name="localhost_2006rebotted.jar">
<element id="directory" name="META-INF">
<element id="file-copy" path="$PROJECT_DIR$/2006Redone Client/METAs/Local Client Meta/META-INF/MANIFEST.MF" />
</element>
<element id="module-output" name="2006rebotted" />
</root>
</artifact>
</component>
+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>
+247
View File
@@ -0,0 +1,247 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ArtifactsWorkspaceSettings">
<artifacts-to-build>
<artifact name="localhost_2006rebotted:jar" />
</artifacts-to-build>
</component>
<component name="ChangeListManager">
<list default="true" id="9c1d485e-b413-4c80-b742-7c5a88c1c73c" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/2006Redone Server/data/logs/shopbuying/bot.txt" beforeDir="false" afterPath="$PROJECT_DIR$/2006Redone Server/data/logs/shopbuying/bot.txt" afterDir="false" />
<change beforePath="$PROJECT_DIR$/2006Redone Server/src/redone/game/content/combat/CombatAssistant.java" beforeDir="false" afterPath="$PROJECT_DIR$/2006Redone Server/src/redone/game/content/combat/CombatAssistant.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/content/combat/CombatAssistant.class" beforeDir="false" afterPath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/content/combat/CombatAssistant.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/players/Trading$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/players/Trading$1.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/players/Trading.class" beforeDir="false" afterPath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/players/Trading.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class" beforeDir="false" afterPath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/game/shops/ShopAssistant.class" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/2006Redone Server/src/redone/game/shops/ShopAssistant.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="618">
<caret line="396" column="115" selection-start-line="396" selection-start-column="115" selection-end-line="396" selection-end-column="115" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/2006Redone Server/src/redone/game/content/combat/CombatAssistant.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="2066" column="71" selection-start-line="2066" selection-start-column="71" selection-end-line="2066" selection-end-column="71" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/2006Redone Server/src/redone/game/players/Trading.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="404">
<caret line="74" column="108" lean-forward="true" selection-start-line="74" selection-start-column="108" selection-end-line="74" selection-end-column="108" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/2006Redone Server/src/redone/util/Misc.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="115">
<caret line="8" column="30" lean-forward="true" selection-start-line="8" selection-start-column="30" selection-end-line="8" selection-end-column="30" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>math.sq</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/2006Redone Server/src/redone/game/content/combat/CombatAssistant.java" />
</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" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/2006Redone Client/METAs/Client Meta" />
<property name="project.structure.last.edited" value="Project" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Application.Server">
<configuration name="Client" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Client" />
<module name="2006rebotted" />
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="FileServer" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="org.apollo.jagcached.FileServer" />
<module name="2006rebotted" />
<option name="WORKING_DIRECTORY" value="2006Redone file_server" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.apollo.jagcached.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<configuration name="Server" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="redone.Server" />
<module name="2006rebotted" />
<option name="WORKING_DIRECTORY" value="2006Redone Server" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="redone.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
<list>
<item itemvalue="Application.FileServer" />
<item itemvalue="Application.Server" />
<item itemvalue="Application.Client" />
</list>
<recent_temporary>
<list>
<item itemvalue="Application.Server" />
<item itemvalue="Application.FileServer" />
<item itemvalue="Application.Client" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="e34c4650-a3c9-498e-b05e-c1cbb72d0ad7" name="Default Changelist" comment="" />
<created>1572306880139</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1572306880139</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="-7" y="0" width="974" height="1047" extended-state="0" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" weight="0.25" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info id="UI Designer" order="4" />
<window_info id="Capture Tool" order="5" />
<window_info id="Favorites" order="6" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.032822758" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Terminal" order="7" />
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
<window_info anchor="bottom" id="Version Control" order="9" />
<window_info anchor="bottom" id="Messages" order="10" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="1" weight="0.25" />
<window_info anchor="right" id="Palette" order="2" />
<window_info anchor="right" id="Ant Build" order="3" weight="0.25" />
<window_info anchor="right" id="Maven" order="4" />
<window_info anchor="right" id="Theme Preview" order="5" />
<window_info anchor="right" id="Capture Analysis" order="6" />
<window_info anchor="right" id="Palette&#9;" order="7" />
</layout>
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State>
<option name="RECENTLY_FILTERED_USER_GROUPS">
<collection />
</option>
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
<collection />
</option>
<option name="COLUMN_ORDER" />
</State>
</value>
</entry>
</map>
</option>
<option name="RECENT_FILTERS">
<map>
<entry key="Branch">
<value>
<list />
</value>
</entry>
<entry key="User">
<value>
<list />
</value>
</entry>
</map>
</option>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/2006Redone Server/src/redone/game/players/Trading.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="404">
<caret line="74" column="108" lean-forward="true" selection-start-line="74" selection-start-column="108" selection-end-line="74" selection-end-column="108" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/2006Redone Server/src/redone/game/content/combat/CombatAssistant.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="197">
<caret line="2066" column="71" selection-start-line="2066" selection-start-column="71" selection-end-line="2066" selection-end-column="71" />
</state>
</provider>
</entry>
</component>
</project>
@@ -0,0 +1,3 @@
Manifest-Version: 1.0
Main-Class: Client
+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;
};
+5 -6
View File
@@ -10,20 +10,19 @@ public class ClientSettings {
/**
* The Servers Name
*/
public final static String SERVER_NAME = "2006Redone";
public final static String SERVER_NAME = "2006rebotted";
/**
* The Servers Website
*/
public final static String SERVER_WEBSITE = "www.2006redone.org";
public final static String SERVER_WEBSITE = "www.2006rebotted.tk";
/**
* 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";
//public final static String SERVER_IP = "127.0.0.1;
public static String SERVER_IP = "2006rebotted.hopto.org";
/**
* The Npc Bits for the Server
*/
+36 -14
View File
@@ -1,3 +1,8 @@
/**
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
* THIS IS TO ALLOW LOCAL PARABOT TO CONTINUE TO WORK
*/
import java.applet.AppletContext;
import java.awt.Color;
import java.awt.Component;
@@ -20,8 +25,13 @@ import java.text.DecimalFormatSymbols;
import java.util.Calendar;
import java.util.Date;
/**
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
* THIS IS TO ALLOW LOCAL PARABOT TO CONTINUE TO WORK
*/
@SuppressWarnings("serial")
public class Game extends RSApplet {
private boolean graphicsEnabled = true;
public static String intToKOrMilLongName(int i) {
String s = String.valueOf(i);
@@ -4761,6 +4771,9 @@ public class Game extends RSApplet {
inputTaken = true;
}
if ((j == 13 || j == 10) && inputString.length() > 0) {
if (inputString.equals("::gfxtgl") || inputString.equals("::tglgfx") || inputString.equals("::togglerender") || inputString.equals("::togglegfx")) {
graphicsEnabled = !graphicsEnabled;
}
if (myPrivilege == 2) {
if (inputString.equals("::clientdrop")) {
dropClient();
@@ -9761,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) {
@@ -9774,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;
@@ -10632,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;
@@ -11407,6 +11423,7 @@ public class Game extends RSApplet {
Signlink.reporterror(s2);
resetLogout();
exception.printStackTrace();
}
return true;
}
@@ -11474,20 +11491,25 @@ public class Game extends RSApplet {
Model.anInt1685 = super.mouseX - 4;
Model.anInt1686 = super.mouseY - 4;
DrawingArea.setAllPixelsToZero();
// xxx disables graphics if(graphicsEnabled){
worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
worldController.clearObj5Cache();
updateEntities();
drawHeadIcon();
if(graphicsEnabled){
worldController.method313(xCameraPos, yCameraPos, xCameraCurve, zCameraPos, j, yCameraCurve);
worldController.clearObj5Cache();
updateEntities();
drawHeadIcon();
}
// Allow tabs to work
method37(k2);
// Allow stuff inside the tabs to work
draw3dScreen();
// Show overlays on main screen
aRSImageProducer_1165.drawGraphics(4, super.graphics, 4);
xCameraPos = l;
zCameraPos = i1;
yCameraPos = j1;
yCameraCurve = k1;
xCameraCurve = l1;
// }
if(graphicsEnabled) {
xCameraPos = l;
zCameraPos = i1;
yCameraPos = j1;
yCameraCurve = k1;
xCameraCurve = l1;
}
}
public void closeOpenInterfaces() {
@@ -12149,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())
+28
View File
@@ -0,0 +1,28 @@
/**
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
* THIS IS TO ALLOW LOCAL PARABOT TO CONTINUE TO WORK
*/
import java.applet.AppletContext;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.URL;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.util.Calendar;
import java.util.Date;
/**
* NOTICE: IF YOU CHANGE ANYTHING IN GAME.JAVA, PLEASE COPY-PASTE THE WHOLE CLASS OVER TO LOCALGAME.JAVA
* THIS IS TO ALLOW LOCAL PARABOT TO CONTINUE TO WORK
*/
@SuppressWarnings("serial")
public class LocalGame extends Game {
public LocalGame() {
super();
server = "127.0.0.1";
}
}
+1
View File
@@ -16,6 +16,7 @@ public final class Main {
*/
public static void main(String[] args) {
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) {
+8
View File
@@ -111,6 +111,14 @@ public final class RSInterface {
rsInterface.actions[l3] = null;
}
}
if(rsInterface.parentID == 3822) {
rsInterface.actions[2] = "Sell 10";
rsInterface.actions[3] = "Sell X";
}
if(rsInterface.id == 3900) {
rsInterface.actions[2] = "Buy 10";
rsInterface.actions[3] = "Buy X";
}
}
if (rsInterface.type == 3) {
rsInterface.aBoolean227 = stream.readUnsignedByte() == 1;
+2 -2
View File
@@ -278,7 +278,7 @@ public final class Signlink implements Runnable {
public static Synthesizer synthesizer = null;
public static String findcachedir() {
String path = System.getProperty("user.home") + "/.2006redone_file_system/";
String path = System.getProperty("user.home") + "/.2006rebotted_file_system/";
File file = new File(path);
if (!file.exists()) {
if (!file.mkdirs()) {
@@ -289,7 +289,7 @@ public final class Signlink implements Runnable {
}
public static String secondDir() {
File file = new File("C:/.2006redone_file_system/");
File file = new File("C:/.2006rebotted_file_system/");
if (!file.exists()) {
file.mkdirs();
}
+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
+3 -3
View File
@@ -49,9 +49,9 @@ shop = 48 Kjut's_Kebabs 2 2 1971 1000
shop = 49 Flynn's Mace Shop 2 2 1422 10 1420 10 1424 8 1428 6 1430 4
shop = 50 Ali's_Discount_Wares 2 2 1931 30 1935 10 1823 30 1833 10 1837 10 1925 10 4593 10 4591 10 970 10 946 10 590 10 1265 10 2138 10
shop = 51 Betty's_Magic_emporium 2 2 554 300 555 300 556 300 557 100 558 100 562 30 560 10 221 100 579 10 1017 10
shop = 52 Aubury_Magic_Shop 2 2 554 5000000 555 5000000 556 5000000 557 5000000 558 5000000 559 5000000 562 5000000 560 5000000
shop = 53 Wizards_Guild_Shop 2 2 554 5000000 555 5000000 556 5000000 557 5000000 558 5000000 559 5000000 562 5000000 561 5000000 560 5000000 563 5000000 565 5000000 1387 5000000 1383 5000000 1381 5000000 1385 5000000
shop = 54 Lundails_Rune_Shop 2 2 554 5000000 555 5000000 556 5000000 557 5000000 558 5000000 559 5000000 561 5000000 562 5000000 563 5000000 564 5000000 560 5000000
shop = 52 Aubury_Magic_Shop 2 2 554 5000 555 5000 556 5000 557 5000 558 5000 559 5000 562 250 560 250
shop = 53 Wizards_Guild_Shop 2 2 554 5000 555 5000 556 5000 557 5000 558 5000 559 5000 562 250 561 250 560 250 563 250 565 250 1387 2 1383 2 1381 2 1385 2
shop = 54 Lundails_Rune_Shop 2 2 554 200 555 200 556 200 557 200 558 140 559 140 561 250 562 250 563 250 564 20 565 250 560 250
shop = 55 Battle_Runes 2 2 554 100 555 100 556 100 557 100 559 100 558 100 562 30 560 30
shop = 56 Tutab's_Magic_Market 2 2 554 1000 555 1000 556 1000 557 1000 563 100 221 10 4006 10 4023 10
shop = 57 Void_Knight_Magic_Store 2 2 554 1000 555 1000 556 1000 557 1000 558 1000 559 1000 562 300 560 300
+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 @@
[2019/11/10] 22:30 spamtest1 dropped 1 grimy lantadyme absX: 3231 absY: 3207
@@ -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,2 @@
[2019/11/10] 22:46 spamtest1 picked up bones itemX: 3231, itemY: 3236
[2019/11/10] 22:46 spamtest1 picked up bones itemX: 3231, itemY: 3236
@@ -0,0 +1 @@
[2019/11/08] 19:22 bot bought newcomer map from store id: 88 for 1 coins
@@ -0,0 +1 @@
[2019/11/08] 19:22 bot sold newcomer map to store id: 88 for 1 coins
@@ -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)) {
@@ -930,17 +984,12 @@ public class CombatAssistant {
resetPlayerAttack();
return;
}
// c.getPacketDispatcher().sendMessage("Made it here0.");
c.followId = i;
c.followId2 = 0;
if (c.attackTimer <= 0) {
c.usingBow = false;
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,12 +1002,10 @@ public class CombatAssistant {
c.attackTimer = 0;
return;
}
// c.getPacketDispatcher().sendMessage("Made it here1.");
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;
@@ -969,7 +1016,7 @@ public class CombatAssistant {
for (int otherRangeId : RangeData.OTHER_RANGE_WEAPONS) {
if (c.playerEquipment[c.playerWeapon] == otherRangeId) {
usingOtherRangeWeapons = true;
c.usingRangeWeapon = true;
}
}
}
@@ -977,11 +1024,10 @@ public class CombatAssistant {
c.spellId = c.autocastId;
c.usingMagic = true;
}
// c.getPacketDispatcher().sendMessage("Made it here2.");
if (c.spellId > 0) {
c.usingMagic = true;
}
c.attackTimer = getAttackDelay();
if (c.duelRule[9]) {
boolean canUseWeapon = false;
@@ -997,13 +1043,13 @@ public class CombatAssistant {
return;
}
}
// c.getPacketDispatcher().sendMessage("Made it here3.");
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!");
@@ -1017,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();
}
@@ -1053,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(
@@ -1063,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) {
@@ -1072,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;
@@ -1091,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();
@@ -1123,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;
@@ -1189,27 +1227,27 @@ public class CombatAssistant {
CombatSounds.getMagicSound(c, c.spellId), 100,
0);
}
c.mageFollow = true;
c.followId = c.playerIndex;
}
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) {
@@ -1228,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));
@@ -1238,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--;
@@ -1316,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;
}
}
}
@@ -2057,20 +2095,20 @@ public class CombatAssistant {
return false;
}
}
if (CastOnOther.castOnOtherSpells(c)) {
if (CastOnOther.castOnOtherSpells(c.castingSpellId)) {
return true;
}
if (!PlayerHandler.players[c.playerIndex].inWild()
&& !PlayerHandler.players[c.playerIndex].inCwGame()
&& !CastOnOther.castOnOtherSpells(c)) {
&& !CastOnOther.castOnOtherSpells(c.castingSpellId)) {
c.getActionSender().sendMessage(
"That player is not in the wilderness.");
"That player is not in the wilderness." + c.castingSpellId);
c.stopMovement();
resetPlayerAttack();
return false;
}
if (!c.inWild() && !PlayerHandler.players[c.playerIndex].inCwGame()
&& !CastOnOther.castOnOtherSpells(c)) {
&& !CastOnOther.castOnOtherSpells(c.castingSpellId)) {
c.getActionSender().sendMessage(
"You are not in the wilderness.");
c.stopMovement();
@@ -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.");
}
}
@@ -8,10 +8,10 @@ import redone.game.players.PlayerHandler;
public class CastOnOther extends CastRequirements {
public static boolean castOnOtherSpells(Client c) {
public static boolean castOnOtherSpells(int castingSpellId) {
int[] spells = { 12435, 12455, 12425, 30298, 30290, 30282, };
for (int spell : spells) {
if (c.castingSpellId == spell) {
if (castingSpellId == spell) {
return true;
}
}
@@ -44,9 +44,9 @@ public class CastOnOther extends CastRequirements {
if (castOn != null) {
if (castOn.distanceToPoint(c.absX, c.absY) <= 15) {
if (c.heightLevel == castOn.heightLevel) {
c.getPlayerAssistant().sendFrame126(location[type], 12560);
c.getPlayerAssistant().sendFrame126(c.playerName, 12558);
c.getPlayerAssistant().showInterface(12468);
castOn.getPlayerAssistant().sendFrame126(location[type], 12560);
castOn.getPlayerAssistant().sendFrame126(c.playerName, 12558);
castOn.getPlayerAssistant().showInterface(12468);
castOn.teleotherType = type;
}
}
@@ -57,7 +57,7 @@ public class CastOnOther extends CastRequirements {
boolean decline) {
c.getPlayerAssistant().removeAllWindows();
final int[][] coords = { { 3222, 3218 }, // LUMBRIDGE
{ 2964, 3378 }, // FALADOR
{ 2967, 3378 }, // FALADOR
{ 2757, 3477 }, // CAMELOT
};
if (!decline) {
@@ -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);
}
}
@@ -6,30 +6,26 @@ import redone.game.npcs.NpcHandler;
public class NpcAggressive {
/**
* Aggressive monsters
*/
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, 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
};
public static boolean isAggressive(int i) {
int[] data = {
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, 1265,
50, 1590, 1591, 1592, 53, 54, 55, 178, 1267, 49, 174, 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
};
for (int element : data) {
if (NpcHandler.npcs[i].npcType == element) {
boolean aggressive = NpcHandler.npcs[i].inWild() || PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || FightCaves.isFightCaveNpc(i);
for (int element : AGGRESSIVE_MONSTERS) {
if (NpcHandler.npcs[i].npcType == element || aggressive) {
return true;
}
}
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType)) {
return true;
}
if (NpcHandler.npcs[i].inWild() && NpcHandler.npcs[i].MaxHP > 0) {
return true;
}
if (FightCaves.isFightCaveNpc(i)) {
return true;
}
return false;
}
}
@@ -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);
@@ -96,10 +96,28 @@ public class Woodcutting {
}
public static void handleCanoe(final Client player, final int objectId) {
Boolean gotAxe = false;
if (player.playerLevel[player.playerWoodcutting] < 12) {
player.getActionSender().sendMessage("You need a woodcutting level of at least 12 to use the canoe station.");
return;
}
for (int axes[] : Axe_Settings) {
int type = axes[0];
if ( player.getItemAssistant().playerHasItem(type) || player.playerEquipment[player.playerWeapon] == type)
{
gotAxe = true;
}
}
if (gotAxe)
{
player.getActionSender().sendMessage("You swing your axe at the station.");
}
else
{
player.getActionSender().sendMessage("You need an axe to cut the station.");
return;
}
for (int axes[] : Axe_Settings) {
int type = axes[0];
int level = axes[1];
@@ -107,7 +125,6 @@ public class Woodcutting {
if (player.playerLevel[player.playerWoodcutting] >= level && player.getItemAssistant().playerHasItem(type) || player.playerLevel[player.playerWoodcutting] >= level && player.playerEquipment[player.playerWeapon] == type) {
player.turnPlayerTo(player.objectX, player.objectY);
player.startAnimation(anim);
player.getActionSender().sendMessage("You swing your axe at the station.");
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
@Override
public void execute(CycleEventContainer container) {
@@ -175,7 +192,7 @@ public class Woodcutting {
}
}
public boolean hasAxe(Client player) {
public static boolean hasAxe(Client player) {
for (int i = 0; i < Axe_Settings.length; i++) {
if (player.getItemAssistant().playerHasItem(Axe_Settings[i][0]) || player.playerEquipment[player.playerWeapon] == Axe_Settings[i][0]) {
return true;
@@ -185,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;
}
@@ -219,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;
}
@@ -241,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) {
@@ -347,7 +347,7 @@ public class CraftingData extends SkillHandler {
public static enum amuletData {
GOLD(1673, 1692), SAPPHIRE(1675, 1694), EMERALD(1677, 1696), RUBY(1679,
1698), DIAMOND(1681, 1700), DRAGONSTONE(1683, 1702), ONYX(6579,
6851);
6581);
private final int amuletId, product;
@@ -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, 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;
@@ -76,7 +76,7 @@ public class LightSources {
return true;
}
}
c.getActionSender().sendMessage("It's recommened that you get a light source to continue.");
c.getActionSender().sendMessage("It's recommended that you get a light source to continue.");
brightness1(c);
return false;
}
@@ -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);
@@ -4,7 +4,6 @@ import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import redone.Constants;
import redone.Server;
import redone.game.content.combat.npcs.NpcAggressive;
@@ -16,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;
@@ -27,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++) {
@@ -41,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) {
@@ -55,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;
@@ -150,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;
@@ -197,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;
@@ -250,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;
@@ -333,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];
@@ -414,24 +420,13 @@ public class NpcHandler {
continue;
}
/**
* Attacking player
**/
if (NpcAggressive.isAggressive(i) && !npcs[i].underAttack && !npcs[i].isDead && !switchesAttackers(i)) {
Client client = (Client) PlayerHandler.players[NpcData.getCloseRandomPlayer(i)];
if (client != null && getNpcListCombat(npcs[i].npcType) * 2 > client.combatLevel || npcs[i].npcType == 1265 || npcs[i].npcType == 1267 || npcs[i].npcType == 96 || npcs[i].npcType == 97 || npcs[i].npcType == 141) {
npcs[i].killerId = NpcData.getCloseRandomPlayer(i);
}
} else if (NpcAggressive.isAggressive(i) && !npcs[i].underAttack && !npcs[i].isDead && switchesAttackers(i)) {
Client c = (Client) PlayerHandler.players[NpcData.getCloseRandomPlayer(i)];
if (c != null && getNpcListCombat(npcs[i].npcType) * 2 > c.combatLevel) {
Client client = (Client) PlayerHandler.players[NpcData.getCloseRandomPlayer(i)];
if (client != null) {
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);
}
}
/*
* Attacking player
*/
if (System.currentTimeMillis() - npcs[i].lastDamageTaken > 5000) {
npcs[i].underAttackBy = 0;
@@ -891,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 = npcs[i].combatLevel;
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 // hard
Server.itemHandler.createGroundItem(c, 2678 + Misc.random(0, 1), 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
**/
@@ -1387,16 +1404,10 @@ public class NpcHandler {
token = token.trim();
token2 = line.substring(spot + 1);
token2 = token2.trim();
token2_2 = token2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2_2.replaceAll("\t\t", "\t");
token2_2 = token2.replaceAll("\t+", "\t");
token3 = token2_2.split("\t");
if (token.equals("npc")) {
newNPCList(Integer.parseInt(token3[0]), token3[1],
Integer.parseInt(token3[2]),
Integer.parseInt(token3[3]));
newNPCList(Integer.parseInt(token3[0]), token3[1], Integer.parseInt(token3[2]), Integer.parseInt(token3[3]));
}
} else {
if (line.equals("[ENDOFNPCLIST]")) {
@@ -1421,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,15 +62,10 @@ 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 (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 (Webs.webs(player, objectType)) {
Webs.slashWeb(player, objectType, objectX, objectY);
return;
@@ -117,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);
@@ -1702,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
*/
@@ -2573,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:
@@ -2839,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;
@@ -2890,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) {
@@ -1,5 +1,6 @@
package redone.game.objects.impl;
import redone.game.content.skills.core.Woodcutting;
import redone.game.players.Client;
/**
@@ -8,6 +9,11 @@ import redone.game.players.Client;
public class BrimhavenVines {
public static void handleBrimhavenVines(Client c, int objectType) {
if (!Woodcutting.hasAxe(c)) {
c.getActionSender().sendMessage("You will need an axe to chop through these!");
return;
}
c.getActionSender().sendMessage("You chop your way through the vines.");
switch (objectType) {
case 12987:
case 12986:
@@ -31,21 +37,23 @@ public class BrimhavenVines {
}
}
public static void moveThroughVinesX(Client c, int originX, int x1, int y1,
int x2, int y2) {
public static void moveThroughVinesX(Client c, int originX, int x1, int y1, int x2, int y2) {
int x = c.getX();
int y = c.getY();
if (c.absX <= originX) {
c.getPlayerAssistant().walkTo(x1, y1);
c.getPlayerAssistant().movePlayer(x + x1, y + y1, 0);
} else {
c.getPlayerAssistant().walkTo(x2, y2);
c.getPlayerAssistant().movePlayer(x + x2, y + y2, 0);
}
}
public static void moveThroughVinesY(Client c, int originY, int x1, int y1,
int x2, int y2) {
public static void moveThroughVinesY(Client c, int originY, int x1, int y1, int x2, int y2) {
int x = c.getX();
int y = c.getY();
if (c.absY <= originY) {
c.getPlayerAssistant().walkTo(x1, y1);
c.getPlayerAssistant().movePlayer(x + x1, y + y1, 0);
} else {
c.getPlayerAssistant().walkTo(x2, y2);
c.getPlayerAssistant().movePlayer(x + x2, y + y2, 0);
}
}
@@ -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();
@@ -565,7 +573,7 @@ public class Client extends Player {
Server.clanChat.leaveClan(playerId, clanId);
}
if(!Server.ersSecret.equals("")) {
if(Server.ersSecret != null && !Server.ersSecret.equals("") && this.playerRights < 2) {
boolean debugMessage = false;
System.out.println("Updating highscores for " + this.playerName + "!");
com.everythingrs.hiscores.Hiscores.update(Server.ersSecret, "Normal Mode", this.playerName, this.playerRights, this.playerXP, debugMessage);
@@ -657,11 +665,10 @@ public class Client extends Player {
getActionSender().sendMessage("Welcome to @blu@" + Constants.SERVER_NAME + "@bla@ - we are currently in Server Stage v@blu@" + Constants.TEST_VERSION + "@bla@.");
getActionSender().sendMessage("@red@Did you know?@bla@ We're open source! Pull requests are welcome");
getActionSender().sendMessage("Source code at github.com/dginovker/2006rebotted");
getActionSender().sendMessage("Welcome to the Beta! A reset will occur before main release -");
getActionSender().sendMessage("Join our Discord: discord.gg/4zrA2Wy");
if (!hasBankpin) {
getActionSender().sendMessage("You do not, have a bank pin it is highly recommened you set one.");
}
/*if (!hasBankpin) { //Kind of annoying. Maybe add Random % 10 or something.
getActionSender().sendMessage("You do not have a bank pin it is highly recommended you set one.");
}*/
}
getPlayerAssistant().firstTimeTutorial();
getItemAssistant().sendWeapon(playerEquipment[playerWeapon], ItemAssistant.getItemName(playerEquipment[playerWeapon]));
@@ -760,8 +767,12 @@ public class Client extends Player {
flushOutStream();
}
}
public void logout() {
logout(false);
}
public void logout(boolean forceLogout) {
synchronized (this) {
if(Server.trawler.players.contains(this)) {
Server.trawler.players.remove(this);
@@ -796,7 +807,7 @@ public class Client extends Player {
PestControl.leaveWaitingBoat(this);
getPlayerAssistant().movePlayer(2657, 2639, 0);
}
if(underAttackBy > 0 || underAttackBy2 > 0) {
if(!forceLogout && (underAttackBy > 0 || underAttackBy2 > 0)) {
getActionSender().sendMessage("You can't logout during combat!");
return;
}
@@ -808,7 +819,7 @@ public class Client extends Player {
if (hasNpc == true) {
getSummon().pickUpClean(this, summonId);
}
if (System.currentTimeMillis() - logoutDelay > 2500) {
if (forceLogout || System.currentTimeMillis() - logoutDelay > 2500) {
outStream.createFrame(109);
properLogout = true;
} else {
@@ -935,7 +946,7 @@ public class Client extends Player {
@Override
public void process() {
if (playerEnergy < 100&& System.currentTimeMillis() - lastIncrease >= getPlayerAssistant().raiseTimer()) {
if (playerEnergy < 100 && System.currentTimeMillis() - lastIncrease >= getPlayerAssistant().raiseTimer()) {
playerEnergy += 1;
lastIncrease = System.currentTimeMillis();
}
@@ -1066,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);
}
@@ -1088,6 +1099,9 @@ public class Client extends Player {
}
}
combatAssistant.attackingNpcTick();
combatAssistant.attackingPlayerTick();
if (attackTimer > 0) {
attackTimer--;
}
@@ -1,62 +1,62 @@
package redone.game.players;
import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;
import static redone.game.players.PlayerSave.loadPlayerInfo;
public class HighscoresHandler {
public ArrayList<Client> players = new ArrayList<>();
public HighscoresHandler() {
File dir = new File("./data/characters");
File[] directoryListing = dir.listFiles();
for (File child : directoryListing) {
Client player = new Client(null, -1);
player.playerName = child.getName().split("\\.")[0];
loadPlayerInfo(player, child.getName().split("\\.")[0], "", false);
players.add(player);
}
}
public String getRank(int i, String sortBy) {
if (players.size() <= i)
return "Nobody";
switch (sortBy)
{
case "level":
players.sort(new totalLevelComparator());
return players.get(i).playerName + ": " + players.get(i).getPlayerAssistant().getTotalLevel();
case "gold":
players.sort(new totalGoldComparator());
return players.get(i).playerName + ": " + players.get(i).getPlayerAssistant().totalGold() + "gp";
default:
players.sort(new globalDmgComparator());
return players.get(i).playerName + ": " + players.get(i).globalDamageDealt;
}
}
private class totalLevelComparator implements Comparator<Client> {
@Override
public int compare(Client client, Client t1) {
return - client.getPlayerAssistant().getTotalLevel() + t1.getPlayerAssistant().getTotalLevel();
}
}
private class totalGoldComparator implements Comparator<Client> {
@Override
public int compare(Client client, Client t1) {
return - client.getPlayerAssistant().totalGold() + t1.getPlayerAssistant().totalGold();
}
}
private class globalDmgComparator implements Comparator<Client> {
@Override
public int compare(Client client, Client t1) {
return - client.globalDamageDealt + t1.globalDamageDealt;
}
}
}
package redone.game.players;
import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;
import static redone.game.players.PlayerSave.loadPlayerInfo;
public class HighscoresHandler {
public ArrayList<Client> players = new ArrayList<>();
public HighscoresHandler() {
File dir = new File("./data/characters");
File[] directoryListing = dir.listFiles();
for (File child : directoryListing) {
Client player = new Client(null, -1);
player.playerName = child.getName().split("\\.")[0];
loadPlayerInfo(player, child.getName().split("\\.")[0], "", false);
players.add(player);
}
}
public String getRank(Client player, int i, String sortBy) {
if (players.size() <= i || player.playerRights >= 2) {
return "Nobody";
}
switch (sortBy) {
case "level":
players.sort(new totalLevelComparator());
return players.get(i).playerName + ": " + players.get(i).getPlayerAssistant().getTotalLevel();
case "gold":
players.sort(new totalGoldComparator());
return players.get(i).playerName + ": " + players.get(i).getPlayerAssistant().totalGold() + "gp";
default:
players.sort(new globalDmgComparator());
return players.get(i).playerName + ": " + players.get(i).globalDamageDealt;
}
}
private class totalLevelComparator implements Comparator<Client> {
@Override
public int compare(Client client, Client t1) {
return - client.getPlayerAssistant().getTotalLevel() + t1.getPlayerAssistant().getTotalLevel();
}
}
private class totalGoldComparator implements Comparator<Client> {
@Override
public int compare(Client client, Client t1) {
return - client.getPlayerAssistant().totalGold() + t1.getPlayerAssistant().totalGold();
}
}
private class globalDmgComparator implements Comparator<Client> {
@Override
public int compare(Client client, Client t1) {
return - client.globalDamageDealt + t1.globalDamageDealt;
}
}
}
@@ -17,12 +17,12 @@ 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>();
public ArrayList<String> lastKilledPlayers = new ArrayList<String>();
public int CraftInt, Dcolor, FletchInt, clanId = -1;
public int[][] barrowCrypt = {
@@ -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) {
@@ -970,32 +970,9 @@ public abstract class Player {
wQueueWritePtr = next;
// }
}
public boolean goodDistance(int objectX, int objectY, int playerX,
int playerY, int distance) {
for (int i = 0; i <= distance; i++) {
for (int j = 0; j <= distance; j++) {
if (objectId == 2282 || objectId == 10883 || objectId == 2322
|| objectId == 4493 || objectId == 12164
|| objectId == 1721 || objectId == 1722
|| objectId == 4304 && playerX == 2619
&& playerY == 3667) {
return true;
}
if (objectX + i == playerX
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
return true;
} else if (objectX - i == playerX
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
return true;
} else if (objectX == playerX
&& (objectY + j == playerY || objectY - j == playerY || objectY == playerY)) {
return true;
}
}
}
return false;
}
public 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));
}
public int getNextWalkingDirection() {
if (wQueueReadPtr == wQueueWritePtr) {
@@ -1548,7 +1525,7 @@ public abstract class Player {
**/
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) {
@@ -430,10 +430,14 @@ public class PlayerAssistant {
}
public void writeEnergy() {
if (player.playerEnergy > 0) {
sendFrame126((int) Math.ceil(player.playerEnergy) + "%", 149);
} else {
sendFrame126("0%", 149);
if (player.playerEnergy >= 100) {
sendFrame126("100%", 149);
} else {
if (player.playerEnergy > 0 && player.playerEnergy < 100) {
sendFrame126((int) Math.ceil(player.playerEnergy) + "%", 149);
} else if (player.playerEnergy <= 0) {
sendFrame126("0%", 149);
}
}
}
@@ -551,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;
}
}
@@ -637,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;
}
@@ -752,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!");
@@ -775,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;
}
@@ -945,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();
}
@@ -2077,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) {
@@ -2093,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();
@@ -2111,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)) {
@@ -2119,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)) {
@@ -2190,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:
@@ -2247,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) {
@@ -2440,7 +2489,7 @@ public class PlayerAssistant {
if (!player.hasBankpin) {
player.getActionSender()
.sendMessage(
"You do not, have a bank pin it is highly recommened you set one.");
"You do not, have a bank pin it is highly recommended you set one.");
}
}
}
@@ -3090,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) {
@@ -70,9 +70,9 @@ public class Trading {
}
}
public boolean isCloseTo(Client tradedPlayer) {
ValueRange PlayerCoordRangeX = ValueRange.of(tradedPlayer.currentX - 3, tradedPlayer.currentX + 3);
ValueRange PlayerCoordRangeY = ValueRange.of(tradedPlayer.currentY - 3, tradedPlayer.currentY + 3);
if (PlayerCoordRangeX.isValidIntValue(player.currentX) && PlayerCoordRangeY.isValidIntValue(player.currentY)) {
ValueRange PlayerCoordRangeX = ValueRange.of(tradedPlayer.absX - 3, tradedPlayer.absX + 3);
ValueRange PlayerCoordRangeY = ValueRange.of(tradedPlayer.absY - 3, tradedPlayer.absY + 3);
if (PlayerCoordRangeX.isValidIntValue(player.absX) && PlayerCoordRangeY.isValidIntValue(player.absY)) {
return true;
} else {
return false;
@@ -252,7 +252,7 @@ public class Trading {
if (o == null) {
return false;
}
if (!(player.playerItems[fromSlot] == itemID + 1 && player.playerItemsN[fromSlot] >= amount)) {
if (!(player.playerItems[fromSlot] == itemID + 1 )){//&& player.playerItemsN[fromSlot] >= amount)) { I removed this check to permit trading max amount of item in inventory even when amount is higher than quantity in inventory.
player.getActionSender().sendMessage("You don't have that amount!");
return false;
}
@@ -7,7 +7,6 @@ import redone.game.items.ItemDefinitions;
import redone.game.players.Client;
import redone.game.players.Player;
import redone.game.players.PlayerHandler;
import redone.net.ActionSender;
import redone.util.GameLogger;
@@ -67,27 +66,34 @@ public class ShopAssistant {
public void resetShop(int ShopID) {
synchronized (player) {
int TotalItems = 0;
for (int i = 0; i < ShopHandler.MaxShopItems; i++) {
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;
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]);
}
@@ -99,7 +105,7 @@ public class ShopAssistant {
ShopHandler.ShopItems[ShopID][i]);
TotalCount++;
}
if (TotalCount > TotalItems) {
if (TotalCount > player.TotalShopItems) {
break;
}
}
@@ -329,11 +335,12 @@ 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) {
player.getItemAssistant();
@@ -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) {
@@ -364,26 +375,27 @@ public class ShopAssistant {
return false;
}
}
if (amount > player.playerItemsN[fromSlot] && (ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isNoteable == true || ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isStackable == true)) {
amount = player.playerItemsN[fromSlot];
} else if (amount > player.getItemAssistant().getItemAmount(itemID) && ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isNoteable == false && ItemDefinitions.getDef()[player.playerItems[fromSlot] - 1].isStackable == false) {
amount = player.getItemAssistant().getItemAmount(itemID);
}
// double ShopValue;
// double TotPrice;
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.
player.getItemAssistant().deleteItem(itemID, player.getItemAssistant().getItemSlot(itemID), amount); //don't really understand if the item isn't notable why it still needs to find the slot.
player.getItemAssistant().deleteItem2(itemID, amount);
} else {
player.getItemAssistant().deleteItem(itemID, fromSlot, amount);
player.getItemAssistant().deleteItem2(itemID, amount);
String ItemNameUnNotedItem = ItemAssistant.getItemName(itemID - 1).toLowerCase();
if (itemName.contains(ItemNameUnNotedItem)) {
itemID = itemID - 1; //Replace the noted item by it's un-noted version.
}
}
if (player.myShopId == 138 || player.myShopId == 139 || player.myShopId == 58) {
player.getItemAssistant().addItem(6529, TotPrice2); //Add the tokkul to your inventory.
@@ -393,7 +405,7 @@ public class ShopAssistant {
addShopItem(itemID, amount); //Add item to the shop.
if (player.getPlayerAssistant().isPlayer()) { //Logger
GameLogger.writeLog(player.playerName, "shopselling", player.playerName + " sold " + itemName + " to store id: " + player.myShopId + " for" + GameLogger.formatCurrency(TotPrice2) + " coins");
player.getActionSender().sendMessage("You sold " + amount + " " +itemName + " for " + TotPrice2 + " gp." );
//Remove this later. I added it to push this class because a fuck happened with my last commit.
}
} else {
player.getActionSender().sendMessage("You don't have enough space in your inventory.");
@@ -401,7 +413,7 @@ public class ShopAssistant {
player.getItemAssistant().resetItems(3823);
resetShop(player.myShopId);
updatePlayerShop();
player.getActionSender().sendMessage("You sold " + amount + " " +itemName + " for " + TotPrice2 + " gp." );
player.getActionSender().sendMessage("You sold " + amount + " " +itemName + " for " + TotPrice2 + " coins." );
return true;
}
return true;
@@ -437,10 +449,50 @@ public class ShopAssistant {
private static final int FISHING_ITEMS[] = {383, 371, 377, 359, 321, 341, 353, 345, 327, 317};
public boolean buyItem(int itemID, int fromSlot, int amount) {
int iValue = 0;
int boughtQty = 0;
boolean boughtItem = false;
if (amount > 0) {
if (amount > ShopHandler.ShopItemsN[player.myShopId][fromSlot]) {
//S4
if (ShopHandler.ShopItemsN[player.myShopId][fromSlot] == 0) {
player.getActionSender().sendMessage("You can't buy that right now!");
return false;
}
if (amount > ShopHandler.ShopItemsN[player.myShopId][fromSlot] && ShopHandler.ShopItemsN[player.myShopId][fromSlot] > 0) {
amount = ShopHandler.ShopItemsN[player.myShopId][fromSlot];
}
if (amount % 23 == 0) {
amount = amount / 23;
iValue = 23; }
else if (amount % 19 == 0) {
amount = amount / 19;
iValue = 19;
} else if (amount % 17 == 0) {
amount = amount / 17;
iValue = 17;
} else if (amount % 13 == 0) {
amount = amount / 13;
iValue = 13;
} else if (amount % 11 == 0) {
amount = amount / 11;
iValue = 11;
} else if (amount % 7 == 0) {
amount = amount / 7;
iValue = 7;
} else if (amount % 5 == 0) {
amount = amount / 5;
iValue = 5;
}
else if (amount % 3 == 0) {
amount = amount / 3;
iValue = 3;
} else if (amount % 2 == 0) {
amount = amount / 2;
iValue = 2;
} else{
iValue = 1;
}
if(!player.isShopping) {
return false;
}
@@ -456,15 +508,13 @@ public class ShopAssistant {
if (!shopSellsItem(itemID)) {
return false;
}
// double ShopValue;
// double TotPrice;
int TotPrice2 = 0;
// int Overstock;
int Slot = 0;
int tokkulSlot = 0;// Tokkul
int TotPrice2 = 0; //ShopPrice
int RemainingToBuy; //Remaining of item to buy to fill the order. It's the remaining that can't fit in the loop. It has to be processed by itself after the loop.
int Slot = 0; //gp (995)
int tokkulSlot = 0;
int rangeSlot = 0;
int castleSlot = 0;
for (int i = amount; i > 0; i--) {
for (int i = amount; iValue > 0; iValue--) {
if (player.myShopId != 138 && player.myShopId != 58 && player.myShopId != 139 && player.myShopId != RANGE_SHOP && player.myShopId != PEST_SHOP && player.myShopId != CASTLE_SHOP) {
TotPrice2 = (int) Math.floor(getItemShopValue(itemID, 0, false));
} else if (player.myShopId == 138 || player.myShopId == 58 || player.myShopId == 139) {
@@ -577,34 +627,93 @@ public class ShopAssistant {
}
}
} else {
if (player.playerItemsN[Slot] >= TotPrice2) {
if (player.getItemAssistant().freeSlots() > 0 || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable)) {
if (player.playerItemsN[Slot] >= TotPrice2 * amount) {
if (player.getItemAssistant().freeSlots() >= amount || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable) || player.getItemAssistant().freeSlots() >= 1 && ItemDefinitions.getDef()[itemID].isStackable) {
player.getItemAssistant().deleteItem(995,
player.getItemAssistant().getItemSlot(995),
TotPrice2);
player.getItemAssistant().addItem(itemID, 1);
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= 1;
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0;
TotPrice2 * amount);
player.getItemAssistant().addItem(itemID, amount); //All of these actions are performed in a loop. We are in the loop right now.
boughtQty+=amount;
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount; //Delete X item from shop at the slot the item is.
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0; //Shit ass delay
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
ShopHandler.ShopItems[player.myShopId][fromSlot] = 0;
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
}
} else {
player.getActionSender()
.sendMessage(
"You don't have enough space in your inventory.");
if (player.getItemAssistant().freeSlots() == 0) {
player.getActionSender().sendMessage(
"You don't have enough space in your inventory.");
} else {
//Buys the remaining item to fill the inventory slots.
RemainingToBuy = player.getItemAssistant().freeSlots();
amount = RemainingToBuy;
player.getItemAssistant().deleteItem(995,
player.getItemAssistant().getItemSlot(995),
TotPrice2 * amount);
player.getItemAssistant().addItem(itemID, amount);
boughtQty+=amount;
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount;
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0;
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
}
}
break;
}
boughtItem = true;
} else {
player.getActionSender().sendMessage(
"You don't have enough coins.");
break;
if (player.playerItemsN[Slot] / TotPrice2 > 0) {
amount = (int)Math.floor(player.playerItemsN[Slot] / TotPrice2);
} else {
player.getActionSender().sendMessage("You don't have enough coins.");
player.getItemAssistant().resetItems(3823);
resetShop(player.myShopId);
updatePlayerShop();
return false;
}
if (player.getItemAssistant().freeSlots() >= amount || (player.getItemAssistant().playerHasItem(itemID) && ItemDefinitions.getDef()[itemID].isStackable) || player.getItemAssistant().freeSlots() >= 1 && ItemDefinitions.getDef()[itemID].isStackable) {
player.getItemAssistant().deleteItem(995,
player.getItemAssistant().getItemSlot(995),
TotPrice2 * amount);
player.getItemAssistant().addItem(itemID, amount); //All of these actions are performed in a loop. We are in the loop right now.
boughtQty+=amount;
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount; //Delete X item from shop at the slot the item is.
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0; //Shit ass delay
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
}
} else {
if (player.getItemAssistant().freeSlots() == 0) {
player.getActionSender().sendMessage(
"You don't have enough space in your inventory.");
} else {
//Buys the remaining item to fill the inventory slots.
RemainingToBuy = player.getItemAssistant().freeSlots();
amount = RemainingToBuy;
player.getItemAssistant().deleteItem(995,
player.getItemAssistant().getItemSlot(995),
TotPrice2 * amount);
player.getItemAssistant().addItem(itemID, amount);
boughtQty+=amount;
ShopHandler.ShopItemsN[player.myShopId][fromSlot] -= amount;
ShopHandler.ShopItemsDelay[player.myShopId][fromSlot] = 0;
if (fromSlot + 1 > ShopHandler.ShopItemsStandard[player.myShopId]) {
ShopHandler.ShopItems[player.myShopId][fromSlot] = itemID + 1;
}
}
break;
}
boughtItem = true;
}
}
}
if (boughtItem) {
player.getActionSender().sendMessage("You bought " + boughtQty + " " + ItemAssistant.getItemName(itemID).toLowerCase() + " for " + TotPrice2 * boughtQty + " coins." );
}
player.getItemAssistant().resetItems(3823);
resetShop(player.myShopId);
updatePlayerShop();
return true;
return true; //return TRUE / FALSE Update = shop&Inventory / Doesnt Update
}
return false;
}
@@ -5,6 +5,7 @@ import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import redone.game.players.Client;
import redone.game.players.PlayerHandler;
import redone.util.Misc;
@@ -16,7 +17,7 @@ public class ShopHandler {
public static int MaxShops = 200;
public static int MaxShopItems = 200;
public static int MaxShowDelay = 10;
public static int MaxShowDelay = 2;
public static int MaxSpecShowDelay = 60;
public static int TotalShops = 0;
public static int[][] ShopItems = new int[MaxShops][MaxShopItems];
@@ -48,7 +49,7 @@ public class ShopHandler {
switch(itemId) {
default:
return 5000;
return 1000;
}
}
@@ -132,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]);
@@ -7,7 +7,7 @@ public class DiscordActivity {
private static int count = 50;
public static void updateActivity() {
if (!JavaCord.token.equals("")) {
if (JavaCord.token != null && !JavaCord.token.equals("")) {
if (count == 0) {
if (PlayerHandler.getPlayerCount() != 1) {
JavaCord.api.updateActivity(PlayerHandler.getPlayerCount() + " Players Online");
@@ -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;
}
@@ -195,9 +195,10 @@ public class AttackPlayer implements PacketType {
c.playerIndex = c.getInStream().readSignedWordA();
int castingSpellId = c.getInStream().readSignedWordBigEndian();
c.castingSpellId = castingSpellId;
c.usingMagic = false;
boolean teleother = CastOnOther.castOnOtherSpells(c);
boolean teleother = CastOnOther.castOnOtherSpells(castingSpellId);
if (PlayerHandler.players[c.playerIndex] == null) {
break;
@@ -209,11 +210,26 @@ public class AttackPlayer implements PacketType {
if (c.playerRights == 3) {
c.getActionSender().sendMessage(
"Casting Spell id: " + c.castingSpellId + ".");
"Casting Spell id: " + castingSpellId + ".");
}
if (teleother) {
if (c.inTrade) {
c.getTrading().declineTrade(true);
}
if (c.inWild()
&& c.wildLevel > Constants.NO_TELEPORT_WILD_LEVEL) {
c.getActionSender().sendMessage(
"You can't teleport above level "
+ Constants.NO_TELEPORT_WILD_LEVEL
+ " in the wilderness.");
break;
}
}
switch (c.castingSpellId) {
case 12425:
CastOnOther.teleOtherDistance(c, 1, c.playerIndex);
CastOnOther.teleOtherDistance(c, 0, c.playerIndex);
break;
case 12435:
CastOnOther.teleOtherDistance(c, 1, c.playerIndex);
@@ -222,12 +238,10 @@ public class AttackPlayer implements PacketType {
CastOnOther.teleOtherDistance(c, 2, c.playerIndex);
break;
}
if (teleother) {
c.stopMovement();
c.getCombatAssistant().resetPlayerAttack();
if (c.inTrade) {
c.getTrading().declineTrade(true);
}
}
for (int i = 0; i < MagicData.MAGIC_SPELLS.length; i++) {
@@ -288,21 +302,8 @@ public class AttackPlayer implements PacketType {
c.stopMovement();
c.getCombatAssistant().resetPlayerAttack();
}
if (c.usingMagic) {
if (c.goodDistance(c.getX(), c.getY(),
PlayerHandler.players[c.playerIndex].getX(),
PlayerHandler.players[c.playerIndex].getY(), 7)) {
c.stopMovement();
}
if (c.getCombatAssistant().checkReqs()) {
c.followId = c.playerIndex;
c.mageFollow = true;
}
}
}
break;
}
}
@@ -24,7 +24,7 @@ public class Bank5 implements PacketType {
JewelryMaking.mouldItem(player, removeId, 5);
break;
case 3900:
player.getShopAssistant().buyItem(removeId, removeSlot, 1);
player.getShopAssistant().buyItem(removeId, removeSlot, 1); //this says 1 in BANKx5 but it's banking 5 for real... strange shit.
break;
case 3823:
@@ -20,15 +20,21 @@ public class BankAll implements PacketType {
player.endCurrentTask();
switch (interfaceId) {
case 3900:
player.getShopAssistant().buyItem(removeId, removeSlot, 10);
player.outStream.createFrame(27);
player.xRemoveSlot = removeSlot;
player.xRemoveId = removeId;
player.xInterfaceId = interfaceId;
break;
case 3823:
if(!player.getItemAssistant().playerHasItem(removeId)) {
return;
}
player.getShopAssistant().sellItem(removeId,
removeSlot, player.playerItemsN[removeSlot] );
player.outStream.createFrame(27);
player.xRemoveSlot = removeSlot;
player.xRemoveId = removeId;
player.xInterfaceId = interfaceId;
break;
case 7423:
@@ -20,14 +20,7 @@ public class BankX1 implements PacketType {
c.xInterfaceId = c.getInStream().readUnsignedWordA();
c.xRemoveId = c.getInStream().readSignedWordBigEndian();
}
if (c.xInterfaceId == 3900) {
c.getShopAssistant().buyItem(c.xRemoveId, c.xRemoveSlot, 20);// buy
// 20
c.xRemoveSlot = 0;
c.xInterfaceId = 0;
c.xRemoveId = 0;
return;
} else {
else {
if (c.xInterfaceId == 7423) {
c.getItemAssistant().bankItem(c.xRemoveId, c.xRemoveSlot,
Xamount);// Depo
@@ -35,7 +28,6 @@ public class BankX1 implements PacketType {
c.getItemAssistant().resetItems(7423);
}
}
if (packetType == PART1) {
synchronized (c) {
c.getOutStream().createFrame(27);
@@ -20,52 +20,56 @@ public class BankX2 implements PacketType {
Xamount = 1;
}
switch (player.xInterfaceId) {
case 5064:
/*if(!player.getItemAssistant().playerHasItem(player.playerItems[player.xRemoveSlot], Xamount))
return;*/
if (player.inPartyRoom) {
PartyRoom.depositItem(player, player.xRemoveId, player.getItemAssistant().itemAmount(player.playerItems[player.xRemoveSlot]));
case 5064:
if (player.inPartyRoom) {
PartyRoom.depositItem(player, player.xRemoveId, player.getItemAssistant().itemAmount(player.playerItems[player.xRemoveSlot]));
break;
}
if (player.inTrade) {
player.getActionSender().sendMessage("You can't store items while trading!");
return;
}
player.getItemAssistant().bankItem(player.playerItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
break;
}
if (player.inTrade) {
player.getActionSender().sendMessage("You can't store items while trading!");
return;
}
player.getItemAssistant().bankItem(player.playerItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
break;
case 5382:
/*if(!player.getItemAssistant().playerHasItem(player.playerItems[player.xRemoveSlot], Xamount))
return;*/
player.getItemAssistant().fromBank(player.bankItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
break;
case 5382:
player.getItemAssistant().fromBank(player.bankItems[player.xRemoveSlot], player.xRemoveSlot, Xamount);
break;
case 7423:
if (player.storing) {
return;
}
player.getItemAssistant().bankItem(player.playerItems[player.xRemoveSlot],
player.xRemoveSlot, Xamount);
player.getItemAssistant().resetItems(7423);
break;
case 7423:
if (player.storing) {
return;
}
player.getItemAssistant().bankItem(player.playerItems[player.xRemoveSlot],
player.xRemoveSlot, Xamount);
player.getItemAssistant().resetItems(7423);
break;
case 3322:
if (player.duelStatus <= 0) {
player.getTrading().tradeItem(player.xRemoveId, player.xRemoveSlot, Xamount);
} else {
player.getDueling().stakeItem(player.xRemoveId, player.xRemoveSlot, Xamount);
}
break;
case 3322:
if (player.duelStatus <= 0) {
player.getTrading().tradeItem(player.xRemoveId, player.xRemoveSlot, Xamount);
} else {
player.getDueling().stakeItem(player.xRemoveId, player.xRemoveSlot, Xamount);
}
break;
case 3415:
if (player.duelStatus <= 0) {
player.getTrading().fromTrade(player.xRemoveId, player.xRemoveSlot, Xamount);
}
break;
case 3415:
if (player.duelStatus <= 0) {
player.getTrading().fromTrade(player.xRemoveId, player.xRemoveSlot, Xamount);
}
break;
case 6669:
player.getDueling().fromDuel(player.xRemoveId, player.xRemoveSlot, Xamount);
break;
case 6669:
player.getDueling().fromDuel(player.xRemoveId, player.xRemoveSlot, Xamount);
break;
case 3900:
player.getShopAssistant().buyItem(player.xRemoveId, player.xRemoveSlot, Xamount);
break;
case 3823:
player.getShopAssistant().sellItem(player.xRemoveId, player.xRemoveSlot, Xamount);
break;
}
}
}
@@ -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":
@@ -166,13 +166,13 @@ public class Commands implements PacketType {
"@dre@Highscores",
"",
"Top 5 Total Level:",
hs.getRank(0, "level"), hs.getRank(1, "level"), hs.getRank(2, "level"), hs.getRank(3, "level"), hs.getRank(4, "level"),
hs.getRank(player, 0, "level"), hs.getRank(player,1, "level"), hs.getRank(player,2, "level"), hs.getRank(player,3, "level"), hs.getRank(player,4, "level"),
"",
"Top 5 Wealthiest Players:",
hs.getRank(0, "gold"), hs.getRank(1, "gold"), hs.getRank(2, "gold"), hs.getRank(3, "gold"), hs.getRank(4, "gold"),
hs.getRank(player,0, "gold"), hs.getRank(player,1, "gold"), hs.getRank(player,2, "gold"), hs.getRank(player,3, "gold"), hs.getRank(player, 4, "gold"),
"",
"Top 5 Highest Total Damage:",
hs.getRank(0, "damage"), hs.getRank(1, "damage"), hs.getRank(2, "damage"), hs.getRank(3, "damage"), hs.getRank(4, "damage"),
hs.getRank(player,0, "damage"), hs.getRank(player,1, "damage"), hs.getRank(player,2, "damage"), hs.getRank(player, 3, "damage"), hs.getRank(player, 4, "damage"),
};
for (int i = 8144; i < 8245; i++) {
@@ -196,6 +196,28 @@ public class Commands implements PacketType {
public static void moderatorCommands(Client player, String playerCommand, String[] arguments) {
switch (playerCommand.toLowerCase()) {
case "kick":
try {
if (arguments.length == 0) {
player.getActionSender().sendMessage("You must specify a player name: ::kick playername");
return;
}
String playerToKick = String.join(" ", arguments);
for(Player player2 : PlayerHandler.players) {
if(player2 != null) {
if(player2.playerName.equalsIgnoreCase(playerToKick)) {
Client c2 = (Client)player2;
player.getActionSender().sendMessage("You have kicked " + playerToKick + ".");
c2.disconnected = true;
c2.logout(true);
break;
}
}
}
} catch(Exception e) {
player.getActionSender().sendMessage("Player Must Be Online.");
}
break;
case "yell":
for (int j = 0; j < PlayerHandler.players.length; j++) {
if (PlayerHandler.players[j] != null) {
@@ -434,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 + ".");
@@ -470,7 +500,7 @@ public class Commands implements PacketType {
player.playerLevel[skill] = player.getPlayerAssistant().getLevelForXP(player.playerXP[skill]);
player.getPlayerAssistant().refreshSkill(skill);
player.getPlayerAssistant().levelUp(skill);
} catch (Exception ಠ_ಠ) {}
} catch (Exception e) {}
break;
case "spellbook":
if (player.inWild()) {
@@ -496,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()) {
@@ -506,7 +536,7 @@ public class Commands implements PacketType {
} else {
player.getActionSender().sendMessage("No such item.");
}
} catch (Exception ಠ_ಠ) {}
} catch (Exception e) {}
break;
case "master":
for (int i = 0; i < 25; i++) {
@@ -522,6 +552,7 @@ public class Commands implements PacketType {
public static void developerCommands(Client player, String playerCommand, String[] arguments) {
switch (playerCommand.toLowerCase()) {
case "clicktotele":
case "ctt": // alias
player.clickToTele = !player.clickToTele;
player.getActionSender().sendMessage("Click to teleport: " + (player.clickToTele ? "Enabled" : "Disabled"));
break;
@@ -538,7 +569,7 @@ public class Commands implements PacketType {
Client c2 = (Client)PlayerHandler.players[i];
player.getActionSender().sendMessage("You have given " + playerToAdmin + " admin.");
c2.playerRights = 2;
c2.logout();
c2.logout(true);
break;
}
}
@@ -560,7 +591,7 @@ public class Commands implements PacketType {
Client c2 = (Client)PlayerHandler.players[i];
player.getActionSender().sendMessage("You have demoted " + playerToAdmin + ".");
c2.playerRights = 0;
c2.logout();
c2.logout(true);
break;
}
}
@@ -582,7 +613,7 @@ public class Commands implements PacketType {
Client c2 = (Client)PlayerHandler.players[i];
player.getActionSender().sendMessage("You have given " + playerToMod + " mod.");
c2.playerRights = 1;
c2.logout();
c2.logout(true);
break;
}
}
@@ -625,9 +656,9 @@ public class Commands implements PacketType {
} else {
player.getActionSender().sendMessage("Npc " + newNPC + " does not exist.");
}
} catch (Exception ಠ_ಠ) {}
} catch (Exception e) {}
break;
case "cantAttack":
case "cantattack":
player.npcCanAttack = !player.npcCanAttack;
player.getActionSender().sendMessage("Npcs " + (player.npcCanAttack ? "can" : "can no longer") + " attack you.");
break;
@@ -684,7 +715,7 @@ public class Commands implements PacketType {
PlayerHandler.updateAnnounced = false;
PlayerHandler.updateRunning = true;
PlayerHandler.updateStartTime = System.currentTimeMillis();
} catch (Exception ಠ_ಠ) {}
} catch (Exception e) {}
break;
}
}
@@ -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();
}
}
}

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