Compare commits

...

5 Commits

Author SHA1 Message Date
dginovker f39993e3d9 Latest compile + jars 2019-12-12 04:54:04 -05:00
Mr Extremez 6ad9d1f7e9 Random fixes (#273)
- Cant open nest if you do not have space
- Added working yo yo
- Added monks robe spawns
- Added ability to make god pages
- Removed a few warnings

closes #265
closes #262
closes #259
closes #243
2019-12-12 04:32:56 -05:00
Danial 8ec8a92d20 Fix for boots of lightness (#272) 2019-12-12 04:32:06 -05:00
Gptaqbc c891e4741e Added Winter theme and fixed couple items that werent wore in the correct slot (#271)
Added Winter theme and fixed couple items that werent wore in the correct slot
2019-12-12 04:31:21 -05:00
Daniel Ginovker 64ae22188f Small shop QoL (#267)
* Shop command clarification

* small syntax
2019-12-11 00:43:58 -05:00
42 changed files with 109 additions and 46 deletions
@@ -35,5 +35,6 @@ public class ClientSettings {
public static final BigInteger RSA_MODULUS = new BigInteger("91553247461173033466542043374346300088148707506479543786501537350363031301992107112953015516557748875487935404852620239974482067336878286174236183516364787082711186740254168914127361643305190640280157664988536979163450791820893999053469529344247707567448479470137716627440246788713008490213212272520901741443");
public static final BigInteger RSA_EXPONENT = new BigInteger("65537");
public final static Boolean SNOW = true;
}
+3
View File
@@ -25,6 +25,9 @@ public final class Flo {
return;
} else if (i == 1) {
anInt390 = stream.read3Bytes();
if (ClientSettings.SNOW) {
anInt390 = 0xffffff;
}
method262(anInt390);
} else if (i == 2) {
anInt391 = stream.readUnsignedByte();
@@ -11,6 +11,8 @@
1935:1:3211:3212
88:1:2654:9767
1931:1:3209:3214
542:1:3059:3488:1
544:1:3059:3487:1
1923:1:3208:3214
882:1:3205:3228
2313:1:3033:9849
@@ -37,6 +37,8 @@ public class BotHandler {
return;
}
player.getPacketSender().sendMessage("Shop commands- ::withdrawshop, ::closeshop");
Client playerShop = getPlayerShop(player);
if (playerShop == null) {
@@ -141,11 +141,11 @@ public class Item {
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" };
"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" };
"sallet", "Facemask", "Bearhead"};
public static boolean isFullBody(int itemId) {
String weapon = getItemName(itemId);
@@ -276,6 +276,8 @@ public class Item {
case 1167:
case 5525:
case 4168:
case 4502:
case 1037:
case 1025:
case 7112:
case 7124:
@@ -1439,7 +1439,11 @@ public class ItemAssistant {
}
}
}
if (wearID == 4079) {
c.startAnimation(1458);
return false;
}
switch (wearID) {
// Dragon daggers/sword
case 1215:
@@ -13,6 +13,7 @@ import com.rebotted.game.content.skills.fletching.Stringing;
import com.rebotted.game.content.skills.herblore.GrindingAction;
import com.rebotted.game.content.skills.herblore.Herblore;
import com.rebotted.game.items.impl.CapeDye;
import com.rebotted.game.items.impl.GodPages;
import com.rebotted.game.items.impl.WeaponPoison;
import com.rebotted.game.npcs.impl.MilkCow;
import com.rebotted.game.objects.impl.CrystalChest;
@@ -98,7 +99,7 @@ public class UseItem {
}
public static void ItemonItem(Player player, int itemUsed, int useWith) {
public static void itemOnItem(Player player, int itemUsed, int useWith) {
LogCuttingInterface.handleItemOnItem(player, itemUsed, useWith);
ArrowMaking.makeArrow(player, itemUsed, useWith);
Stringing.StringBow(player, itemUsed, useWith);
@@ -111,6 +112,7 @@ public class UseItem {
}
GrindingAction.init(player, itemUsed, useWith);
CapeDye.dyeItem(player, itemUsed, useWith);
GodPages.itemOnItemHandle(player, useWith, itemUsed);
if (Herblore.isIngredient(itemUsed) || Herblore.isIngredient(useWith)) {
Herblore.setupPotion(player, itemUsed, useWith);
}
@@ -49,29 +49,18 @@ public class Weight extends ItemDefinitions {
*/
public static void updateWeight(Player player) {
if (player != null) {
player.getPacketSender().writeWeight((int) player.weight);
player.weight = 0;
// Inventory items
for (int playerItem : player.playerItems) {
if (playerItem > -1) {// inventory
for (ItemList i1 : GameEngine.itemHandler.ItemList) {
if (i1 != null) {
if (i1.itemId == playerItem) {
calcWeight(player, playerItem, "addItem");
}
}
}
calcWeight(player, playerItem, "addItem");
}
}
// Equiped items
for (int element : player.playerEquipment) {
if (element > -1) {// equipment
for (ItemList i1 : GameEngine.itemHandler.ItemList) {
if (i1 != null) {
if (i1.itemId == element) {
calcWeight(player, element, "addItem");
}
}
}
if (element == 88) player.weight -= 4.5;
else calcWeight(player, element, "addItem");
}
}
}
@@ -0,0 +1,40 @@
package com.rebotted.game.items.impl;
import com.rebotted.game.players.Player;
public class GodPages {
public static void fillBook(Player player, int oldBook, int newBook, int page1, int page2, int page3) {
if (player.getItemAssistant().playerHasItem(oldBook, 1) && player.getItemAssistant().playerHasItem(page1, 1) && player.getItemAssistant().playerHasItem(page2, 1) && player.getItemAssistant().playerHasItem(page3, 1)) {
player.getItemAssistant().deleteItem(oldBook, player.getItemAssistant().getItemSlot(oldBook), 1);
player.getItemAssistant().deleteItem(page1, player.getItemAssistant().getItemSlot(page1), 1);
player.getItemAssistant().deleteItem(page2, player.getItemAssistant().getItemSlot(page2), 1);
player.getItemAssistant().deleteItem(page3, player.getItemAssistant().getItemSlot(page3), 1);
player.getItemAssistant().addItem(newBook, 1);
} else {
player.getPacketSender().sendMessage("You need all 3 pages to fill the book!");
}
}
public static void itemOnItemHandle(Player player, int useWith, int itemUsed) {
if ((useWith == 3827) || (useWith == 3827) || (useWith == 3827) && (itemUsed == 3839)) { // sara
fillBook(player, 3839, 3840, 3827, 3828, 3829);
}
if ((itemUsed == 3827) || (itemUsed == 3828) || (itemUsed == 3829) || (useWith == 3839)) {// sara
fillBook(player, 3839, 3840, 3827, 3828, 3829);
}
if ((useWith == 3831) || (useWith == 3832) || (useWith == 3833) && (itemUsed == 3841)) { // zam
fillBook(player, 3841, 3842, 3831, 3832, 3833);
}
if ((itemUsed == 3831) || (itemUsed == 3832) || (itemUsed == 3833) || (useWith == 3841)) { // zam
fillBook(player, 3841, 3842, 3831, 3832, 3833);
}
if ((useWith == 3835) || (useWith == 3836) || (useWith == 3837) && (itemUsed == 3843)) { // guth
fillBook(player, 3843, 3844, 3835, 3836, 3837);
}
if ((itemUsed == 3835) || (itemUsed == 3836) || (itemUsed == 3837) || (useWith == 3843)) { // guth
fillBook(player, 3843, 3844, 3835, 3836, 3837);
}
}
}
@@ -794,6 +794,7 @@ public class PacketSender {
if (player.getOutStream() == null) return this;
player.outStream.createFrame(240);
DecimalFormat twoDForm = new DecimalFormat("#.##");
weight = Math.max(0, weight);
player.outStream.writeWord(Integer.valueOf(twoDForm.format(weight)));
return this;
}
@@ -1,6 +1,5 @@
package com.rebotted.net.packets.impl;
import com.rebotted.GameConstants;
import com.rebotted.game.content.random.PartyRoom;
import com.rebotted.game.items.GameItem;
import com.rebotted.game.items.Item;
@@ -4,7 +4,6 @@ import com.rebotted.GameConstants;
import com.rebotted.GameEngine;
import com.rebotted.game.content.music.Music;
import com.rebotted.game.globalworldobjects.Doors;
import com.rebotted.game.players.Client;
import com.rebotted.game.players.Player;
import com.rebotted.net.packets.PacketType;
import com.rebotted.world.GlobalDropsHandler;
@@ -72,7 +72,9 @@ public class ClickItem implements PacketType {
return;
}
switch (itemId) {
case 4079:
player.startAnimation(1457);
break;
case 407:
if (Misc.random(1) == 0) {
player.getItemAssistant().addItem(409, 1);
@@ -182,25 +184,37 @@ public class ClickItem implements PacketType {
// break;
case 5070:
player.getPacketSender().sendMessage("You search the nest.");
player.getItemAssistant().addItem(5076, 1);
player.getItemAssistant().deleteItem(itemId, 1);
player.getItemAssistant().addItem(5075, 1);
if (player.getItemAssistant().freeSlots() >= 2) {
player.getPacketSender().sendMessage("You search the nest.");
player.getItemAssistant().addItem(5076, 1);
player.getItemAssistant().deleteItem(itemId, 1);
player.getItemAssistant().addItem(5075, 1);
} else {
player.getPacketSender().sendMessage("You do not have enough inventory space to do that.");
}
break;
case 5071:
if (player.getItemAssistant().freeSlots() >= 2) {
player.getPacketSender().sendMessage("You search the nest.");
player.getItemAssistant().addItem(5078, 1);
player.getItemAssistant().deleteItem(itemId, 1);
player.getItemAssistant().addItem(5075, 1);
break;
} else {
player.getPacketSender().sendMessage("You do not have enough inventory space to do that.");
}
break;
case 5072:
player.getPacketSender().sendMessage("You search the nest.");
player.getItemAssistant().addItem(5077, 1);
player.getItemAssistant().deleteItem(itemId, 1);
player.getItemAssistant().addItem(5075, 1);
break;
if (player.getItemAssistant().freeSlots() >= 2) {
player.getPacketSender().sendMessage("You search the nest.");
player.getItemAssistant().addItem(5077, 1);
player.getItemAssistant().deleteItem(itemId, 1);
player.getItemAssistant().addItem(5075, 1);
} else {
player.getPacketSender().sendMessage("You do not have enough inventory space to do that.");
}
break;
case 5073:
player.getItemAssistant().handleTreeSeeds(itemId);
@@ -104,10 +104,12 @@ public class Commands implements PacketType {
BotHandler.playerShop(player);
break;
case "withdrawshop":
player.getPacketSender().sendMessage("Shorter version: ::wshop");
case "wshop":
BotHandler.takeCoins(player);
break;
case "closeshop":
player.getPacketSender().sendMessage("Shorter version: ::cshop");
case "cshop":
BotHandler.closeShop(player);
break;
@@ -149,7 +151,7 @@ public class Commands implements PacketType {
player.getPacketSender().closeAllWindows();
break;
case "commands":
player.getPacketSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle, ::debug, ::togglegfx, ::shop, ::withdrawshop, ::closeshop");
player.getPacketSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle, ::debug, ::togglegfx, ::shop");
break;
case "loc":
player.getPacketSender().sendMessage(player.absX + "," + player.absY);
@@ -27,6 +27,9 @@ public class ItemClick2 implements PacketType {
}
switch (itemId) {
case 4079:
c.startAnimation(1459);
break;
}
}
@@ -33,7 +33,10 @@ public class ItemClick3 implements PacketType {
player.endCurrentTask();
switch (itemId) {
case 4079:
player.startAnimation(1460);
break;
case 2552:
case 2554:
case 2556:
@@ -16,7 +16,7 @@ public class ItemOnItem implements PacketType {
return;
}
player.endCurrentTask();
UseItem.ItemonItem(player, itemUsed, useWith);
UseItem.itemOnItem(player, itemUsed, useWith);
}
}
@@ -11,7 +11,6 @@ import com.rebotted.game.content.skills.firemaking.Firemaking;
import com.rebotted.game.content.skills.firemaking.LogData;
import com.rebotted.game.items.ItemAssistant;
import com.rebotted.game.items.impl.RareProtection;
import com.rebotted.game.players.Client;
import com.rebotted.game.players.Player;
import com.rebotted.net.packets.PacketType;
import com.rebotted.util.GameLogger;
@@ -2,6 +2,7 @@ package com.rebotted.net.packets.impl;
import com.rebotted.game.content.random.PartyRoom;
import com.rebotted.game.content.skills.crafting.JewelryMaking;
import com.rebotted.game.items.Weight;
import com.rebotted.game.items.impl.RareProtection;
import com.rebotted.game.players.Player;
import com.rebotted.net.packets.PacketType;
@@ -16,16 +17,14 @@ public class RemoveItem implements PacketType {
int interfaceId = c.getInStream().readUnsignedWordA();
int removeSlot = c.getInStream().readUnsignedWordA();
int removeId = c.getInStream().readUnsignedWordA();
if (removeId == 88) {
c.weight += 4.5;
c.getPacketSender().writeWeight((int) c.weight);
}
if (!RareProtection.removeItem(c, removeId)) {
return;
}
c.endCurrentTask();
Weight.updateWeight(c);
switch (interfaceId) {
case 4233:
@@ -90,11 +89,11 @@ public class RemoveItem implements PacketType {
case 1121:
case 1122:
case 1123:
c.getSmithing().readInput(c.playerLevel[c.playerSmithing],
Integer.toString(removeId), c, 1);
c.getSmithing().readInput(c.playerLevel[c.playerSmithing], Integer.toString(removeId), c, 1);
break;
}
Weight.updateWeight(c);
}
}
@@ -1,5 +1,6 @@
package com.rebotted.net.packets.impl;
import com.rebotted.game.items.Weight;
import com.rebotted.game.items.impl.RareProtection;
import com.rebotted.game.players.Player;
import com.rebotted.net.packets.PacketType;
@@ -14,6 +15,7 @@ public class WearItem implements PacketType {
player.wearId = player.getInStream().readUnsignedWord();
player.wearSlot = player.getInStream().readUnsignedWordA();
player.interfaceId = player.getInStream().readUnsignedWordA();
Weight.updateWeight(player);
if (!RareProtection.equipItem(player)) {
return;
}
@@ -47,16 +49,13 @@ public class WearItem implements PacketType {
player.getPlayerAssistant().emptyPouch(pouch);
return;
}
if (player.wearId == 88 && player.playerEquipment[10] != 88) {
player.weight -= 4.5;
player.getPacketSender().writeWeight((int) player.weight);
}
if (player.wearSlot == player.playerHat) {
player.getPacketSender().setConfig(491, 0);
}
player.getPlayerAssistant().handleTiara();
player.getItemAssistant().wearItem(player.wearId, player.wearSlot);
Weight.updateWeight(player);
}
}
Binary file not shown.