mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
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 :)
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
2006Redone\ Server/data/characters/
|
||||
.idea/
|
||||
.idea/workspace.xml
|
||||
|
||||
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8.0_222 (2)" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/CompiledServer" />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+128
-8
@@ -7,13 +7,13 @@
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="9c1d485e-b413-4c80-b742-7c5a88c1c73c" name="Default Changelist" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/misc.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/misc.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/2006Redone Server/src/redone/game/npcs/NpcHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/2006Redone Server/src/redone/game/npcs/NpcHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/2006Redone Server/src/redone/net/packets/impl/Commands.java" beforeDir="false" afterPath="$PROJECT_DIR$/2006Redone Server/src/redone/net/packets/impl/Commands.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/2006Redone Server/src/redone/world/ObjectHandler.java" beforeDir="false" afterPath="$PROJECT_DIR$/2006Redone Server/src/redone/world/ObjectHandler.java" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/net/packets/impl/Commands.class" beforeDir="false" afterPath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/net/packets/impl/Commands.class" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/world/ObjectHandler.class" beforeDir="false" afterPath="$PROJECT_DIR$/CompiledServer/production/2006rebotted/redone/world/ObjectHandler.class" 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" />
|
||||
@@ -21,9 +21,61 @@
|
||||
<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="ProjectId" id="1Sr1PyvKre5eWJ6XgOrqWrHM5hp" />
|
||||
<component name="PropertiesComponent">
|
||||
<property name="SHARE_PROJECT_CONFIGURATION_FILES" value="true" />
|
||||
@@ -44,7 +96,7 @@
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="RunManager" selected="Application.FileServer">
|
||||
<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" />
|
||||
@@ -87,8 +139,8 @@
|
||||
</list>
|
||||
<recent_temporary>
|
||||
<list>
|
||||
<item itemvalue="Application.FileServer" />
|
||||
<item itemvalue="Application.Server" />
|
||||
<item itemvalue="Application.FileServer" />
|
||||
<item itemvalue="Application.Client" />
|
||||
</list>
|
||||
</recent_temporary>
|
||||
@@ -106,17 +158,85 @@
|
||||
</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	" 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 @@
|
||||
[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
|
||||
@@ -2057,20 +2057,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();
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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,9 +252,6 @@ public class Trading {
|
||||
if (o == null) {
|
||||
return false;
|
||||
}
|
||||
player.getActionSender().sendMessage("amount: " + amount);
|
||||
player.getActionSender().sendMessage("player.playerItems[fromSlot]: " + player.playerItems[fromSlot]);
|
||||
player.getActionSender().sendMessage("itemID + 1: " + itemID + 1);
|
||||
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;
|
||||
|
||||
@@ -394,7 +394,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.");
|
||||
|
||||
@@ -181,6 +181,7 @@ public class AttackPlayer implements PacketType {
|
||||
* Attack player with magic
|
||||
**/
|
||||
case MAGE_PLAYER:
|
||||
c.getActionSender().sendMessage("maging");
|
||||
if (!c.mageAllowed) {
|
||||
c.mageAllowed = true;
|
||||
break;
|
||||
@@ -195,9 +196,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 +211,28 @@ public class AttackPlayer implements PacketType {
|
||||
|
||||
if (c.playerRights == 3) {
|
||||
c.getActionSender().sendMessage(
|
||||
"Casting Spell id: " + c.castingSpellId + ".");
|
||||
"Casting Spell id: " + castingSpellId + ".");
|
||||
}
|
||||
|
||||
if (teleother) {
|
||||
c.stopMovement();
|
||||
c.getCombatAssistant().resetPlayerAttack();
|
||||
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 +241,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++) {
|
||||
@@ -290,9 +307,8 @@ public class AttackPlayer implements PacketType {
|
||||
}
|
||||
|
||||
if (c.usingMagic) {
|
||||
if (c.goodDistance(c.getX(), c.getY(),
|
||||
PlayerHandler.players[c.playerIndex].getX(),
|
||||
PlayerHandler.players[c.playerIndex].getY(), 7)) {
|
||||
if (c.goodDistance(c.getX(), c.getY(), PlayerHandler.players[c.playerIndex].getX(), PlayerHandler.players[c.playerIndex].getY(), 7))
|
||||
{
|
||||
c.stopMovement();
|
||||
}
|
||||
if (c.getCombatAssistant().checkReqs()) {
|
||||
@@ -302,7 +318,6 @@ public class AttackPlayer implements PacketType {
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user