Various thing (#400)

- Nearly perfected fight caves now (should fix wave spawning, some dialogue bugs, instance issues)
- Added fully working monkey gree grees
- Fixed somes skill interface typos
- Added ability to dye goblin mails
- Fixed restless ghost quest interface typo
- Clarified herb cleaning required level message
This commit is contained in:
Mr Extremez
2020-03-24 12:46:01 -05:00
committed by GitHub
parent a55a0fdefb
commit 43f4b14dbf
20 changed files with 1121 additions and 921 deletions
@@ -6,7 +6,7 @@ public class GameConstants {
public final static String SERVER_NAME = "2006rebotted", SERVER_VERSION = "Server Stage v " + GameConstants.TEST_VERSION + "."; public final static String SERVER_NAME = "2006rebotted", SERVER_VERSION = "Server Stage v " + GameConstants.TEST_VERSION + ".";
public final static double TEST_VERSION = 2.1; public final static double TEST_VERSION = 2.2;
public final static int ITEM_LIMIT = 15000, MAXITEM_AMOUNT = Integer.MAX_VALUE, CLIENT_VERSION = 999999, public final static int ITEM_LIMIT = 15000, MAXITEM_AMOUNT = Integer.MAX_VALUE, CLIENT_VERSION = 999999,
WORLD = 1, IPS_ALLOWED = 250, CONNECTION_DELAY = 100, WORLD = 1, IPS_ALLOWED = 250, CONNECTION_DELAY = 100,
@@ -3,6 +3,7 @@ package com.rebotted.game.content.combat.melee;
import com.rebotted.game.content.combat.magic.MagicData; import com.rebotted.game.content.combat.magic.MagicData;
import com.rebotted.game.items.ItemAssistant; import com.rebotted.game.items.ItemAssistant;
import com.rebotted.game.items.ItemConstants; import com.rebotted.game.items.ItemConstants;
import com.rebotted.game.items.impl.Greegree.MonkeyData;
import com.rebotted.game.players.Player; import com.rebotted.game.players.Player;
public class MeleeData { public class MeleeData {
@@ -307,6 +308,9 @@ public class MeleeData {
public static int getWeaponAnimation(Player c) { public static int getWeaponAnimation(Player c) {
String weaponName = ItemAssistant.getItemName(c.playerEquipment[ItemConstants.WEAPON]).toLowerCase(); String weaponName = ItemAssistant.getItemName(c.playerEquipment[ItemConstants.WEAPON]).toLowerCase();
MonkeyData data = MonkeyData.forId(c.playerEquipment[ItemConstants.WEAPON]);
if (data != null)
return data.getAttackAnim();
if (c.playerEquipment[c.playerWeapon] <= 0) { if (c.playerEquipment[c.playerWeapon] <= 0) {
switch (c.fightMode) { switch (c.fightMode) {
case 0: case 0:
@@ -397,6 +401,9 @@ public class MeleeData {
&& c.playerEquipment[c.playerShield] <= 8850) { && c.playerEquipment[c.playerShield] <= 8850) {
return 4177; return 4177;
} }
MonkeyData data = MonkeyData.forId(c.playerEquipment[ItemConstants.WEAPON]);
if (data != null)
return data.getBlockAnim();
switch (c.playerEquipment[c.playerWeapon]) { switch (c.playerEquipment[c.playerWeapon]) {
case 4755: case 4755:
return 2063; return 2063;
@@ -7,6 +7,7 @@ import com.rebotted.game.content.minigames.FightCaves;
import com.rebotted.game.content.minigames.PestControl; import com.rebotted.game.content.minigames.PestControl;
import com.rebotted.game.content.music.sound.CombatSounds; import com.rebotted.game.content.music.sound.CombatSounds;
import com.rebotted.game.content.music.sound.SoundList; import com.rebotted.game.content.music.sound.SoundList;
import com.rebotted.game.items.impl.Greegree.MonkeyData;
import com.rebotted.game.npcs.NpcData; import com.rebotted.game.npcs.NpcData;
import com.rebotted.game.npcs.NpcHandler; import com.rebotted.game.npcs.NpcHandler;
import com.rebotted.game.players.Client; import com.rebotted.game.players.Client;
@@ -115,6 +116,9 @@ public class NpcCombat {
|| NpcHandler.npcs[i].npcType == 752) { || NpcHandler.npcs[i].npcType == 752) {
return; return;
} }
if (Boundary.isIn(c, Boundary.APE_ATOLL) && MonkeyData.isWearingGreegree(c)) {
return;
}
if (NpcHandler.npcs[i].npcType == 1401 && Boundary.isIn(c, Boundary.TUTORIAL) || c.tutorialProgress < 36) { if (NpcHandler.npcs[i].npcType == 1401 && Boundary.isIn(c, Boundary.TUTORIAL) || c.tutorialProgress < 36) {
return; return;
} }
@@ -109,31 +109,31 @@ public class FightCaves {
int wave = player.waveId +1; int wave = player.waveId +1;
if (player.waveId < 62 && player.waveId > -1) { if (player.waveId < 62 && player.waveId > -1) {
for (int j = 0; j < npcAmount; j++) { for (int j = 0; j < npcAmount; j++) {
int npc = WAVES[player.waveId][j]; int npc = WAVES[player.waveId][j];
int X = COORDINATES[j][0]; int X = COORDINATES[j][0];
int Y = COORDINATES[j][1]; int Y = COORDINATES[j][1];
int H = player.heightLevel;
int hp = getHp(npc);
int max = getMax(npc);
int atk = getAtk(npc);
int def = getDef(npc);
NpcHandler.spawnNpc(player, npc, X, Y, H, 0, hp, max, atk, def, true, false);
}
player.getPacketSender().sendMessage("You are now on wave @red@" + wave + "@bla@.");
} else if (player.waveId == 62) {
player.getDialogueHandler().sendDialogues(102, 2617);
int a = Misc.random(1);
int npc = WAVES[62][0];
int X = JAD_SPAWNS[a][0];
int Y = JAD_SPAWNS[a][1];
int H = player.heightLevel; int H = player.heightLevel;
int hp = getHp(npc); int hp = getHp(npc);
int max = getMax(npc); int max = getMax(npc);
int atk = getAtk(npc); int atk = getAtk(npc);
int def = getDef(npc); int def = getDef(npc);
NpcHandler.spawnNpc(player, npc, X, Y, H, 0, hp, max, atk, def, true, false); NpcHandler.spawnNpc(player, npc, X, Y, H, 0, hp, max, atk, def, true, false);
player.getPacketSender().sendMessage("You are now on wave @red@63@bla@.");
} }
player.getPacketSender().sendMessage("You are now on wave @red@" + wave + "@bla@.");
} else if (player.waveId == 62) {
player.getDialogueHandler().sendDialogues(102, 2617);
int a = Misc.random(1);
int npc = WAVES[62][0];
int X = JAD_SPAWNS[a][0];
int Y = JAD_SPAWNS[a][1];
int H = player.heightLevel;
int hp = getHp(npc);
int max = getMax(npc);
int atk = getAtk(npc);
int def = getDef(npc);
NpcHandler.spawnNpc(player, npc, X, Y, H, 0, hp, max, atk, def, true, false);
player.getPacketSender().sendMessage("You are now on wave @red@63@bla@.");
}
player.tzhaarToKill = npcAmount; player.tzhaarToKill = npcAmount;
player.tzhaarKilled = 0; player.tzhaarKilled = 0;
} }
@@ -156,14 +156,15 @@ public class FightCaves {
} }
public static void spawnHealers(Player c, int i, int amount) { public static void spawnHealers(Player c, int i, int amount) {
if (c.spawnedHealers < 4) { if (c.spawnedHealers < 4) {
int hp = getHp(YT_HURKOT); int hp = getHp(YT_HURKOT);
int max = getMax(YT_HURKOT); int max = getMax(YT_HURKOT);
int atk = getAtk(YT_HURKOT); int atk = getAtk(YT_HURKOT);
int def = getDef(YT_HURKOT); int def = getDef(YT_HURKOT);
for (int i1 = 0; i1 < amount; i1++) { for (int i1 = 0; i1 < amount; i1++) {
NpcHandler.spawnNpc(c, YT_HURKOT, HEALER_COORDS[i1][0], HEALER_COORDS[i1][1], c.heightLevel, 0, hp, max, atk, def, false, false); NpcHandler.spawnNpc(c, YT_HURKOT, HEALER_COORDS[i1][0], HEALER_COORDS[i1][1], c.heightLevel, 0, hp, max, atk, def, false, false);
} }
c.tzhaarToKill += 4;
c.spawnedHealers = amount; c.spawnedHealers = amount;
c.canHealersRespawn = false; c.canHealersRespawn = false;
} }
@@ -193,26 +194,20 @@ public class FightCaves {
public static void tzKekEffect(Client player, int i) { public static void tzKekEffect(Client player, int i) {
if (NpcHandler.npcs[i].npcType == TZ_KEK) { if (NpcHandler.npcs[i].npcType == TZ_KEK) {
int x = NpcHandler.npcs[i].absX + 2; int x = NpcHandler.npcs[i].absX + 2;
int y = NpcHandler.npcs[i].absY + 2; int y = NpcHandler.npcs[i].absY + 2;
int x1 = NpcHandler.npcs[i].absX - 2; int x1 = NpcHandler.npcs[i].absX - 2;
int y1 = NpcHandler.npcs[i].absY - 2; int y1 = NpcHandler.npcs[i].absY - 2;
int hp = getHp(TZ_KEK_SPAWN); int hp = getHp(TZ_KEK_SPAWN);
int max = getMax(TZ_KEK_SPAWN); int max = getMax(TZ_KEK_SPAWN);
int atk = getAtk(TZ_KEK_SPAWN); int atk = getAtk(TZ_KEK_SPAWN);
int def = getDef(TZ_KEK_SPAWN); int def = getDef(TZ_KEK_SPAWN);
if (player != null) { if (player != null) {
if (player.tzKekTimer == 0) { if (player.tzKekTimer == 0) {
if (NpcHandler.npcs[i].isDead) { if (NpcHandler.npcs[i].isDead) {
NpcHandler.spawnNpc(player, TZ_KEK_SPAWN, x, y, NpcHandler.spawnNpc(player, TZ_KEK_SPAWN, x, y, player.heightLevel, 0, hp, max, atk, def, true, false);
player.heightLevel, 0, hp, max, atk, def, true, NpcHandler.spawnNpc(player, TZ_KEK_SPAWN, x1, y1, player.heightLevel, 0, hp, max, atk, def, true, false);
false); player.tzhaarToKill += 2;
NpcHandler.spawnNpc(player, TZ_KEK_SPAWN, x1, y1,
player.heightLevel, 0, hp, max, atk, def, true,
false);
} }
} }
} }
@@ -20,7 +20,7 @@ public class RestlessGhost {
client.getPacketSender().sendString("Restless Ghost", 8144); client.getPacketSender().sendString("Restless Ghost", 8144);
client.getPacketSender().sendString("I can start this quest by speaking to Father Aereck in", 8147); client.getPacketSender().sendString("I can start this quest by speaking to Father Aereck in", 8147);
client.getPacketSender().sendString("Lumbridge", 8148); client.getPacketSender().sendString("Lumbridge", 8148);
client.getPacketSender().sendString("Minimum Requirments:", 8149); client.getPacketSender().sendString("Minimum Requirements:", 8149);
client.getPacketSender().sendString("None.", 8150); client.getPacketSender().sendString("None.", 8150);
} else if (client.restGhost == 1) { } else if (client.restGhost == 1) {
client.getPacketSender().sendString("Restless Ghost", 8144); client.getPacketSender().sendString("Restless Ghost", 8144);
@@ -1181,14 +1181,14 @@ public class SkillInterfaces {
menuLine("30", "Defence potion", 133, 5); menuLine("30", "Defence potion", 133, 5);
menuLine("34", "Agility potion", 3034, 6); menuLine("34", "Agility potion", 3034, 6);
menuLine("38", "Prayer restore potion", 139, 7); menuLine("38", "Prayer restore potion", 139, 7);
menuLine("45", "Super Attack potion", 145, 8); menuLine("45", "Super attack potion", 145, 8);
menuLine("48", "Super anti-poison", 181, 9); menuLine("48", "Super anti-poison", 181, 9);
menuLine("50", "Fishing potion", 151, 10); menuLine("50", "Fishing potion", 151, 10);
menuLine("52", "Super energy potion", 3018, 11); menuLine("52", "Super energy potion", 3018, 11);
menuLine("55", "Super Strength potion", 157, 12); menuLine("55", "Super strength potion", 157, 12);
menuLine("60", "Weapon poison", 187, 13); menuLine("60", "Weapon poison", 187, 13);
menuLine("63", "Super restore potion", 3026, 14); menuLine("63", "Super restore potion", 3026, 14);
menuLine("66", "Super Defence potion", 163, 15); menuLine("66", "Super defence potion", 163, 15);
menuLine("68", "Antidote+", 5945, 16); menuLine("68", "Antidote+", 5945, 16);
menuLine("69", "Ranging potion", 169, 17); menuLine("69", "Ranging potion", 169, 17);
menuLine("72", "Antifire potion", 2454, 18); menuLine("72", "Antifire potion", 2454, 18);
@@ -92,8 +92,7 @@ public class Potatoes extends SkillHandler {
return false; return false;
} }
if (!COOKING) { if (!COOKING) {
c.getPacketSender().sendMessage( c.getPacketSender().sendMessage("This skill is currently disabled.");
"This skill is currently disabled.");
return false; return false;
} }
if (c.getItemAssistant().playerHasItem(potato.getIngredient(), 1)) { if (c.getItemAssistant().playerHasItem(potato.getIngredient(), 1)) {
@@ -102,13 +101,10 @@ public class Potatoes extends SkillHandler {
c.getItemAssistant().deleteItem(6703, 1); c.getItemAssistant().deleteItem(6703, 1);
c.getPacketSender().sendMessage("You put the topping on."); c.getPacketSender().sendMessage("You put the topping on.");
c.getItemAssistant().addItem(potato.getNewPotatoID(), 1); c.getItemAssistant().addItem(potato.getNewPotatoID(), 1);
c.getPlayerAssistant().addSkillXP( c.getPlayerAssistant().addSkillXP(potato.getXP(), c.playerCooking);
potato.getXP(), c.playerCooking);
RandomEventHandler.addRandom(c); RandomEventHandler.addRandom(c);
} else { } else {
c.getPacketSender().sendMessage( c.getPacketSender().sendMessage("You need a cooking level of " + potato.getReq() + " to make this potato.");
"You need a cooking level of " + potato.getReq()
+ " to make this potato.");
} }
} }
return false; return false;
@@ -28,8 +28,7 @@ public class Herblore extends SkillHandler {
for (int[] element : CLEAN_DATA) { for (int[] element : CLEAN_DATA) {
if (itemId == element[0]) { if (itemId == element[0]) {
if (c.playerLevel[15] < element[2]) { if (c.playerLevel[15] < element[2]) {
c.getPacketSender().sendMessage("You cannot clean this herb."); c.getPacketSender().sendMessage("You need a higher herblore level to clean this herb.");
c.getPacketSender().sendMessage("You need a higher Herblore level.");
return; return;
} }
c.getItemAssistant().deleteItem(itemId, itemSlot, 1); c.getItemAssistant().deleteItem(itemId, itemSlot, 1);
@@ -556,7 +556,7 @@ public class DialogueHandler {
player.nextChat = 0; player.nextChat = 0;
break; break;
case 104: case 104:
sendNpcChat1("Well done in the cave, here, take TokKul as reward.", 2617, "TzHaar-Mej-Jal"); sendNpcChat1("Well done in the cave, here, take TokKul as a reward.", 2617, "TzHaar-Mej-Jal");
player.nextChat = 0; player.nextChat = 0;
break; break;
case 145: case 145:
@@ -564,8 +564,7 @@ public class DialogueHandler {
player.nextChat = 146; player.nextChat = 146;
break; break;
case 146: case 146:
sendNpcChat1("Give me a quest what?", player.talkingNpc, sendNpcChat1("Give me a quest what?", player.talkingNpc, "Wizard Mizgog");
"Wizard Mizgog");
player.nextChat = 147; player.nextChat = 147;
break; break;
case 147: case 147:
File diff suppressed because it is too large Load Diff
@@ -17,7 +17,7 @@ import com.rebotted.game.content.skills.herblore.Herblore;
import com.rebotted.game.content.skills.prayer.Ectofuntus; import com.rebotted.game.content.skills.prayer.Ectofuntus;
import com.rebotted.game.content.skills.prayer.Ectofuntus.EctofuntusData; import com.rebotted.game.content.skills.prayer.Ectofuntus.EctofuntusData;
import com.rebotted.game.content.skills.runecrafting.Tiaras; import com.rebotted.game.content.skills.runecrafting.Tiaras;
import com.rebotted.game.items.impl.CapeDye; import com.rebotted.game.items.impl.Dye;
import com.rebotted.game.items.impl.GodPages; import com.rebotted.game.items.impl.GodPages;
import com.rebotted.game.items.impl.WeaponPoison; import com.rebotted.game.items.impl.WeaponPoison;
import com.rebotted.game.npcs.impl.MilkCow; import com.rebotted.game.npcs.impl.MilkCow;
@@ -131,7 +131,14 @@ public class UseItem {
} }
BattleStaffs.makeBattleStaff(player, itemUsed, useWith); BattleStaffs.makeBattleStaff(player, itemUsed, useWith);
GrindingAction.init(player, itemUsed, useWith); GrindingAction.init(player, itemUsed, useWith);
CapeDye.dyeItem(player, itemUsed, useWith); Dye.dyeItem(player, itemUsed, useWith);
for (final int[] element : Dye.MAIL_DATA) {
if (itemUsed == element[0] && useWith == element[1] || itemUsed == element[1] && useWith == element[0]) {
player.getItemAssistant().deleteItem(element[0], 1);
player.getItemAssistant().deleteItem(element[1], 1);
player.getItemAssistant().addItem(element[2], 1);
}
}
GodPages.itemOnItemHandle(player, useWith, itemUsed); GodPages.itemOnItemHandle(player, useWith, itemUsed);
if (Herblore.isIngredient(itemUsed) || Herblore.isIngredient(useWith)) { if (Herblore.isIngredient(itemUsed) || Herblore.isIngredient(useWith)) {
Herblore.setupPotion(player, itemUsed, useWith); Herblore.setupPotion(player, itemUsed, useWith);
@@ -58,8 +58,11 @@ public class Weight extends ItemDefinition {
// Equiped items // Equiped items
for (int element : player.playerEquipment) { for (int element : player.playerEquipment) {
if (element > -1) {// equipment if (element > -1) {// equipment
if (element == 88) player.weight -= 4.5; if (element == 88) {
else calcWeight(player, element, "addItem"); player.weight -= 4.5;
} else {
calcWeight(player, element, "addItem");
}
} }
} }
} }
@@ -9,7 +9,7 @@ import com.rebotted.game.players.Player;
* @author Andrew (Mr Extremez) * @author Andrew (Mr Extremez)
*/ */
public enum CapeDye { public enum Dye {
RED_CAPE(1763, 1007), RED_CAPE(1763, 1007),
BLUE_CAPE(1767, 1021), BLUE_CAPE(1767, 1021),
@@ -21,7 +21,7 @@ public enum CapeDye {
int reward, itemUsed; int reward, itemUsed;
private CapeDye(int itemUsed, int reward) { private Dye(int itemUsed, int reward) {
this.itemUsed = itemUsed; this.itemUsed = itemUsed;
this.reward = reward; this.reward = reward;
} }
@@ -46,7 +46,7 @@ public enum CapeDye {
{1763, 1767, 1773} {1763, 1767, 1773}
}; };
public static boolean blockDye(Player player, CapeDye dye, int itemUsed, int useWith) { public static boolean blockDye(Player player, Dye dye, int itemUsed, int useWith) {
if (itemUsed == dye.getItemUsed() && ItemAssistant.getItemName(useWith).equalsIgnoreCase("Cape") && ItemData.itemIsNote[useWith]) { if (itemUsed == dye.getItemUsed() && ItemAssistant.getItemName(useWith).equalsIgnoreCase("Cape") && ItemData.itemIsNote[useWith]) {
player.getPacketSender().sendMessage("You can't dye a noted cape."); player.getPacketSender().sendMessage("You can't dye a noted cape.");
return true; return true;
@@ -60,7 +60,7 @@ public enum CapeDye {
} }
public static void dyeItem(Player player, int itemUsed, int useWith) { public static void dyeItem(Player player, int itemUsed, int useWith) {
for (CapeDye cape: CapeDye.values()) { for (Dye cape: Dye.values()) {
if (blockDye(player, cape, itemUsed, useWith)) { if (blockDye(player, cape, itemUsed, useWith)) {
return; return;
} }
@@ -163,8 +163,6 @@ public class Flowers {
player.getItemAssistant().addItem(flowerDecoder(object), 1); player.getItemAssistant().addItem(flowerDecoder(object), 1);
player.getPacketSender().sendMessage("You receive a random flower."); player.getPacketSender().sendMessage("You receive a random flower.");
player.startAnimation(827); player.startAnimation(827);
// c.getPA().checkObjectSpawn(c,-1, c.getX()+1, c.getY(), 1, 10);
// c.getPA().object(c,-1, c.getX()+1, c.getY(), 1, 10);
GameEngine.objectHandler.createAnObject(player, -1, player.getX() + 1, player.getY(), player.getH(), 1); GameEngine.objectHandler.createAnObject(player, -1, player.getX() + 1, player.getY(), player.getH(), 1);
player.turnPlayerTo(player.getX() + 1, player.getY()); player.turnPlayerTo(player.getX() + 1, player.getY());
} }
@@ -0,0 +1,138 @@
package com.rebotted.game.items.impl;
import com.rebotted.game.items.ItemConstants;
import com.rebotted.game.items.ItemData;
import com.rebotted.game.players.Player;
import com.rebotted.world.Boundary;
public class Greegree {
public static enum MonkeyData {
SMALL_NINJA(4024, 1480, 1386, 1380, 1381, 1383, -1),
LARGE_NINJA(4025, 1481, 1386, 1380, 1381, 1383, -1),
MONKEY_GUARD(4026, 1482, 1401, 1399, 1400, 1402, 1403),
BEARDED_MONKEY_GUARD(4027, 1483, 1401, 1399, 1400, 1402, 1403),
BLUE_FACE_MONKEY_GUARD(4028, 1484, 1401, 1399, 1400, 1402, 1403),
SMALL_ZOMBIE(4029, 1485, 1386, 1382, 1381, 1383,-1),
LARGE_MONKEY(4030, 1486, 1386, 1382, 1381, 1383, -1),
KARAMAJA_MONKEY(4031, 1487, 222, 219, 220, 220, 221);
int greegreeID, npcID, standAnim, walkAnim, runAnim, attackAnim, blockAnim;
private MonkeyData(int greegreeID, int npcID, int standAnim, int walkAnim, int runAnim, int attackAnim, int blockAnim) {
this.greegreeID = greegreeID;
this.npcID = npcID;
this.standAnim = standAnim;
this.walkAnim = walkAnim;
this.runAnim = runAnim;
this.attackAnim = attackAnim;
this.blockAnim = blockAnim;
}
public int getGreegreeID() {
return greegreeID;
}
public int getNpcID() {
return npcID;
}
public int getStandAnim() {
return standAnim;
}
public int getWalkAnim() {
return walkAnim;
}
public int getRunAnim() {
return runAnim;
}
public int getBlockAnim() {
return blockAnim;
}
public int getAttackAnim() {
return attackAnim;
}
public static MonkeyData forId(int id) {
for (MonkeyData data: MonkeyData.values())
if (data.greegreeID == id)
return data;
return null;
}
public static boolean isWearingGreegree(Player p) {
return MonkeyData.forId(p.playerEquipment[ItemConstants.WEAPON]) != null;
}
public static boolean isAnim(int animId) {
for (MonkeyData data: MonkeyData.values())
if (data.attackAnim == animId || data.blockAnim == animId)
return true;
return false;
}
}
public static boolean canWear(Player player) {
return (Boundary.isIn(player, Boundary.APE_ATOLL) || Boundary.isIn(player, Boundary.ARDOUGNE_ZOO));
}
public static boolean attemptGreegree(Player p, int weaponID) {
int targetSlot = ItemData.targetSlots[weaponID];
if (MonkeyData.forId(weaponID) == null && targetSlot != ItemConstants.WEAPON && MonkeyData.isWearingGreegree(p)) {
p.getPacketSender().sendMessage("You can't equip that while wearing a greegree.");
return false;
}
if (weaponID >= 4024 && weaponID <= 4031) {
if (!canWear(p) && !MonkeyData.isWearingGreegree(p)) {
p.getPacketSender().sendMessage("You can't equip that here.");
return false;
}
}
MonkeyData data = MonkeyData.forId(weaponID);
if (MonkeyData.isWearingGreegree(p) || data != null) {
if (data != null) {
setAnimations(p, data);
} else {
resetAnimations(p);
}
p.gfx100(359);
return true;
}
return true;
}
public static void setAnimations(Player p, MonkeyData data) {
p.npcId2 = data.getNpcID();
p.isNpc = true;
p.playerStandIndex = data.getStandAnim();
p.playerWalkIndex = data.getWalkAnim();
p.playerRunIndex = data.getRunAnim();
p.playerTurnIndex = data.getWalkAnim();
p.playerTurn180Index = data.getWalkAnim();
p.playerTurn90CWIndex = data.getWalkAnim();
p.playerTurn90CCWIndex = data.getWalkAnim();
p.getPlayerAssistant().requestUpdates();
}
public static void resetAnimations(Player p) {
p.npcId2 = -1;
p.isNpc = false;
p.getPlayerAssistant().resetAnimation();
p.gfx100(359);
}
public static boolean attemptRemove(Player p, int slot) {
if (slot == ItemConstants.WEAPON && MonkeyData.isWearingGreegree(p)) {
resetAnimations(p);
} else if (slot != ItemConstants.WEAPON && MonkeyData.isWearingGreegree(p)) {
p.getPacketSender().sendMessage("You can't remove items while wearing a greegree.");
return false;
}
return true;
}
}
@@ -527,8 +527,9 @@ public class NpcHandler {
if (npcs[i].npcType == FightCaves.YT_HURKOT) { if (npcs[i].npcType == FightCaves.YT_HURKOT) {
Player c = ((Client)PlayerHandler.players[npcs[i].spawnedBy]); Player c = ((Client)PlayerHandler.players[npcs[i].spawnedBy]);
int ranHeal = Misc.random(10); int ranHeal = Misc.random(10);
if (ranHeal == 10) if (ranHeal == 10) {
FightCaves.healJad(c, i); FightCaves.healJad(c, i);
}
} }
if (PlayerHandler.players[npcs[i].spawnedBy] != null) { if (PlayerHandler.players[npcs[i].spawnedBy] != null) {
for (int o = 0; o < PlayerHandler.players[npcs[i].spawnedBy].barrowsNpcs.length; o++) { for (int o = 0; o < PlayerHandler.players[npcs[i].spawnedBy].barrowsNpcs.length; o++) {
@@ -558,8 +559,7 @@ public class NpcHandler {
npcs[i].underAttackBy = 0; npcs[i].underAttackBy = 0;
} }
if ((npcs[i].killerId > 0 || npcs[i].underAttack) if ((npcs[i].killerId > 0 || npcs[i].underAttack) && !npcs[i].walkingHome && retaliates(npcs[i].npcType)) {
&& !npcs[i].walkingHome && retaliates(npcs[i].npcType)) {
if (!npcs[i].isDead) { if (!npcs[i].isDead) {
int p = npcs[i].killerId; int p = npcs[i].killerId;
if (PlayerHandler.players[p] != null) { if (PlayerHandler.players[p] != null) {
@@ -568,7 +568,7 @@ public class NpcHandler {
if (npcs[i] == null) { if (npcs[i] == null) {
continue; continue;
} }
stepAway(c,i); stepAway(c, i);
if (npcs[i].attackTimer == 0) { if (npcs[i].attackTimer == 0) {
NpcCombat.attackPlayer(c, i); NpcCombat.attackPlayer(c, i);
} }
@@ -1186,8 +1186,7 @@ public class NpcHandler {
int playerX = PlayerHandler.players[playerId].absX; int playerX = PlayerHandler.players[playerId].absX;
int playerY = PlayerHandler.players[playerId].absY; int playerY = PlayerHandler.players[playerId].absY;
npcs[i].randomWalk = false; npcs[i].randomWalk = false;
if (goodDistance(npcs[i].getX(), npcs[i].getY(), playerX, playerY, if (goodDistance(npcs[i].getX(), npcs[i].getY(), playerX, playerY, distanceRequired(i))) {
distanceRequired(i))) {
return; return;
} }
@@ -23,7 +23,6 @@ import com.rebotted.game.content.combat.prayer.PrayerData;
import com.rebotted.game.content.combat.prayer.PrayerDrain; import com.rebotted.game.content.combat.prayer.PrayerDrain;
import com.rebotted.game.content.combat.range.DwarfCannon; import com.rebotted.game.content.combat.range.DwarfCannon;
import com.rebotted.game.content.combat.range.RangeData; import com.rebotted.game.content.combat.range.RangeData;
import com.rebotted.game.content.consumables.Food;
import com.rebotted.game.content.consumables.Potions; import com.rebotted.game.content.consumables.Potions;
import com.rebotted.game.content.guilds.impl.RangersGuild; import com.rebotted.game.content.guilds.impl.RangersGuild;
import com.rebotted.game.content.minigames.Barrows; import com.rebotted.game.content.minigames.Barrows;
@@ -74,6 +73,7 @@ import com.rebotted.game.items.ItemAssistant;
import com.rebotted.game.items.ItemConstants; import com.rebotted.game.items.ItemConstants;
import com.rebotted.game.items.impl.PotionMixing; import com.rebotted.game.items.impl.PotionMixing;
import com.rebotted.game.items.impl.Teles; import com.rebotted.game.items.impl.Teles;
import com.rebotted.game.items.impl.Greegree.MonkeyData;
import com.rebotted.game.npcs.Npc; import com.rebotted.game.npcs.Npc;
import com.rebotted.game.npcs.NpcActions; import com.rebotted.game.npcs.NpcActions;
import com.rebotted.game.npcs.NpcHandler; import com.rebotted.game.npcs.NpcHandler;
@@ -813,8 +813,7 @@ public abstract class Player {
getPacketSender().showOption(3, 0, "Attack", 1); getPacketSender().showOption(3, 0, "Attack", 1);
} else { } else {
getPacketSender().sendMapState(0); getPacketSender().sendMapState(0);
if (!isSnowy) if (!isSnowy) {
{
getPacketSender().walkableInterface(-1); getPacketSender().walkableInterface(-1);
} }
getPacketSender().showOption(3, 0, "Null", 1); getPacketSender().showOption(3, 0, "Null", 1);
@@ -1344,7 +1343,7 @@ public abstract class Player {
chatEffects = true, acceptAid = false, recievedMask, chatEffects = true, acceptAid = false, recievedMask,
nextDialogue = false, autocasting = false, usedSpecial = false, nextDialogue = false, autocasting = false, usedSpecial = false,
mageFollow = false, dbowSpec = false, craftingLeather = false, mageFollow = false, dbowSpec = false, craftingLeather = false,
properLogout = false, secDbow = false, properLogout = false, secDbow = false, isNpc,
addStarter = false, accountFlagged = false, inPartyRoom = false, msbSpec = false, addStarter = false, accountFlagged = false, inPartyRoom = false, msbSpec = false,
hasBankPin, enterdBankpin, firstPinEnter, requestPinDelete, hasBankPin, enterdBankpin, firstPinEnter, requestPinDelete,
secondPinEnter, thirdPinEnter, fourthPinEnter, hasBankpin, secondPinEnter, thirdPinEnter, fourthPinEnter, hasBankpin,
@@ -2635,7 +2634,7 @@ public abstract class Player {
* Animations * Animations
**/ **/
public void startAnimation(int animId) { public void startAnimation(int animId) {
if (wearing2h() && animId == 829) { if (MonkeyData.isWearingGreegree(this) && !MonkeyData.isAnim(animId) || (wearing2h() && animId == 829)) {
return; return;
} }
if (animId == -1) { if (animId == -1) {
@@ -22,6 +22,7 @@ import com.rebotted.game.items.GameItem;
import com.rebotted.game.items.ItemAssistant; import com.rebotted.game.items.ItemAssistant;
import com.rebotted.game.items.ItemConstants; import com.rebotted.game.items.ItemConstants;
import com.rebotted.game.items.impl.LightSources; import com.rebotted.game.items.impl.LightSources;
import com.rebotted.game.items.impl.Greegree.MonkeyData;
import com.rebotted.game.npcs.Npc; import com.rebotted.game.npcs.Npc;
import com.rebotted.game.npcs.NpcHandler; import com.rebotted.game.npcs.NpcHandler;
import com.rebotted.util.GameLogger; import com.rebotted.util.GameLogger;
@@ -664,6 +665,10 @@ public class PlayerAssistant {
player.getPacketSender().sendMessage("You can't teleport while skilling!"); player.getPacketSender().sendMessage("You can't teleport while skilling!");
return; return;
} }
if (MonkeyData.isWearingGreegree(player)) {
player.getPacketSender().sendMessage("You can't teleport as a monkey.");
return;
}
if (!player.isDead && player.teleTimer == 0 if (!player.isDead && player.teleTimer == 0
&& player.respawnTimer == -6) { && player.respawnTimer == -6) {
if (player.playerIndex > 0 || player.npcIndex > 0) { if (player.playerIndex > 0 || player.npcIndex > 0) {
@@ -749,6 +754,10 @@ public class PlayerAssistant {
"You are teleblocked and can't teleport."); "You are teleblocked and can't teleport.");
return; return;
} }
if (MonkeyData.isWearingGreegree(player)) {
player.getPacketSender().sendMessage("You can't teleport as a monkey.");
return;
}
if (GameConstants.SOUND) { if (GameConstants.SOUND) {
player.getPacketSender().sendSound(SoundList.TELEPORT, 100, 0); player.getPacketSender().sendSound(SoundList.TELEPORT, 100, 0);
} }
@@ -784,6 +793,10 @@ public class PlayerAssistant {
player.getPacketSender().sendMessage("You can't teleport while in trade!"); player.getPacketSender().sendMessage("You can't teleport while in trade!");
return; return;
} }
if (MonkeyData.isWearingGreegree(player)) {
player.getPacketSender().sendMessage("You can't teleport as a monkey.");
return;
}
if (player.tutorialProgress < 36) { if (player.tutorialProgress < 36) {
player.getPacketSender().sendMessage("You can't teleport from tutorial island!"); player.getPacketSender().sendMessage("You can't teleport from tutorial island!");
return; return;
@@ -30,8 +30,7 @@ public class ItemOnGroundItem implements PacketType {
case 7331: case 7331:
case 7330: case 7330:
case 7329: case 7329:
Firemaking.attemptFire(player, itemUsed, groundItem, gItemX, gItemY, Firemaking.attemptFire(player, itemUsed, groundItem, gItemX, gItemY, true);
true);
break; break;
default: default:
@@ -4,6 +4,9 @@ import com.rebotted.game.content.skills.SkillHandler;
import com.rebotted.game.content.skills.cooking.Cooking; import com.rebotted.game.content.skills.cooking.Cooking;
import com.rebotted.game.content.skills.core.Fishing; import com.rebotted.game.content.skills.core.Fishing;
import com.rebotted.game.content.skills.smithing.Smelting; import com.rebotted.game.content.skills.smithing.Smelting;
import com.rebotted.game.items.ItemConstants;
import com.rebotted.game.items.impl.Greegree;
import com.rebotted.game.items.impl.Greegree.MonkeyData;
import com.rebotted.game.players.Client; import com.rebotted.game.players.Client;
import com.rebotted.game.players.Player; import com.rebotted.game.players.Player;
import com.rebotted.game.players.PlayerHandler; import com.rebotted.game.players.PlayerHandler;
@@ -17,9 +20,12 @@ public class Walking implements PacketType {
@Override @Override
public void processPacket(Player player, int packetType, int packetSize) { public void processPacket(Player player, int packetType, int packetSize) {
player.getDueling().checkDuelWalk(); player.getDueling().checkDuelWalk();
if (player.playerIsBusy()) { if (player.playerIsBusy()) {
player.playerIsBusy = false; player.playerIsBusy = false;
}
if (MonkeyData.isWearingGreegree(player) && !Greegree.canWear(player)) {
Greegree.resetAnimations(player);
player.getItemAssistant().removeItem(ItemConstants.WEAPON);
} }
if (player.canChangeAppearance) { //|| c.performingAction) { if (player.canChangeAppearance) { //|| c.performingAction) {
return; return;