Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
dginovker committed Jan 1, 2020
2 parents 3437877 + 33ef596 commit 9272195
Show file tree
Hide file tree
Showing 18 changed files with 162 additions and 208 deletions.
Binary file modified 2006Redone Client/bin/Main.class
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public void delayedHit(int i) { // npc hit delay
NpcHandler.npcs[i].updateRequired = true;
}
if (CombatConstants.COMBAT_SOUNDS) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
return;
}
c.getPacketSender().sendSound(CombatSounds.getNpcBlockSound(NpcHandler.npcs[c.oldNpcIndex].npcType), 100, 0);
}
NpcHandler.npcs[i].facePlayer(c.playerId);
Expand Down Expand Up @@ -152,7 +155,7 @@ public void delayedHit(int i) { // npc hit delay
c.getPlayerAssistant().refreshSkill(4);
}
if (damage > 0) {
if (NpcHandler.npcs[i].npcType >= 3777 && NpcHandler.npcs[i].npcType <= 3780 || PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType)) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
c.pcDamage += damage;
}
}
Expand Down Expand Up @@ -232,7 +235,7 @@ public void delayedHit(int i) { // npc hit delay
c.getPlayerAssistant().refreshSkill(6);

if (damage > 0) {
if (NpcHandler.npcs[i].npcType >= 3777 && NpcHandler.npcs[i].npcType <= 3780 || PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType)) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
c.pcDamage += damage;
}
}
Expand Down Expand Up @@ -353,7 +356,7 @@ public void applyNpcMeleeDamage(int i, int damageMask) {
}
}
if (damage > 0) {
if (NpcHandler.npcs[i].npcType >= 3777 && NpcHandler.npcs[i].npcType <= 3780 || PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType)) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
c.pcDamage += damage;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public enum SpellTeleport {
LUMBRIDGE(31,4143, 41, 3222, 3218, 0, new int[][]{{563, 1}, {557, 1}, {556, 3}}, "modern"),
FALADOR(37, 4146, 48, 2965, 3378, 0, new int[][]{{563, 1}, {555, 1}, {556, 3}}, "modern"),
CAMELOT(45, 4150, 55.5, 2757, 3479, 0, new int[][]{{563, 1}, {556, 5}}, "modern"),
ARDOUGNE(51, 6004, 61, 2262, 3304, 0, new int[][]{{563, 2}, {555, 2}}, "modern"),
ARDOUGNE(51, 6004, 61, 2662, 3304, 0, new int[][]{{563, 2}, {555, 2}}, "modern"),
WATCHTOWER(58, 6005, 68, 2547, 3112, 1, new int[][]{{563, 2}, {557, 2}}, "modern"),
TROLLHEIM(61, 29031, 68, 2893, 3679, 0, new int[][]{{563, 2}, {554, 2}}, "modern"),
APE_ATOLL(64, 72038, 74, 2798, 2798, 1, new int[][]{{563, 2}, {554, 2}, {555, 2}, {1963, 1}}, "modern"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.rebotted.game.content.combat.CombatConstants;
import com.rebotted.game.content.combat.melee.MeleeData;
import com.rebotted.game.content.minigames.FightCaves;
import com.rebotted.game.content.minigames.PestControl;
import com.rebotted.game.content.music.sound.CombatSounds;
import com.rebotted.game.content.music.sound.SoundList;
import com.rebotted.game.npcs.NpcData;
Expand Down Expand Up @@ -182,14 +183,11 @@ public static void attackPlayer(Player c, int i) {
NpcHandler.npcs[i].attackTimer = NpcData.getNpcDelay(i);
NpcHandler.npcs[i].hitDelayTimer = NpcData.getHitDelay(i);
NpcHandler.npcs[i].attackType = 0;
if (CombatConstants.COMBAT_SOUNDS
&& NpcHandler.npcs[i].npcType < 3177
&& NpcHandler.npcs[i].npcType > 3180) {
c.getPacketSender()
.sendSound(
CombatSounds
.getNpcAttackSounds(NpcHandler.npcs[i].npcType),
100, 0);
if (CombatConstants.COMBAT_SOUNDS) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
return;
}
c.getPacketSender().sendSound(CombatSounds.getNpcAttackSounds(NpcHandler.npcs[i].npcType), 100, 0);
}
if (special) {
loadSpell2(i);
Expand All @@ -202,14 +200,11 @@ public static void attackPlayer(Player c, int i) {
if (NpcHandler.multiAttacks(i)) {
multiAttackGfx(i, NpcHandler.npcs[i].projectileId);
NpcData.startAnimation(NpcEmotes.getAttackEmote(i), i);
if (CombatConstants.COMBAT_SOUNDS
&& NpcHandler.npcs[i].npcType < 3177
&& NpcHandler.npcs[i].npcType > 3180) {
c.getPacketSender()
.sendSound(
CombatSounds
.getNpcAttackSounds(NpcHandler.npcs[i].npcType),
100, 0);
if (CombatConstants.COMBAT_SOUNDS) {
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
return;
}
c.getPacketSender().sendSound(CombatSounds.getNpcAttackSounds(NpcHandler.npcs[i].npcType), 100, 0);
}
NpcHandler.npcs[i].oldIndex = c.playerId;
return;
Expand Down Expand Up @@ -242,11 +237,10 @@ public static void attackPlayer(Player c, int i) {
NpcHandler.npcs[i].oldIndex = c.playerId;
NpcData.startAnimation(NpcEmotes.getAttackEmote(i), i);
if (CombatConstants.COMBAT_SOUNDS) {
c.getPacketSender()
.sendSound(
CombatSounds
.getNpcAttackSounds(NpcHandler.npcs[i].npcType),
100, 0);
if (PestControl.npcIsPCMonster(NpcHandler.npcs[i].npcType) || PestControl.isPCPortal(NpcHandler.npcs[i].npcType)) {
return;
}
c.getPacketSender().sendSound(CombatSounds.getNpcAttackSounds(NpcHandler.npcs[i].npcType), 100, 0);
}
c.getPacketSender().closeAllWindows();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
import com.rebotted.event.CycleEventContainer;
import com.rebotted.event.CycleEventHandler;
import com.rebotted.game.content.combat.CombatConstants;
import com.rebotted.game.content.skills.fletching.LogCuttingInterface;
import com.rebotted.game.items.ItemAssistant;
import com.rebotted.game.npcs.Npc;
import com.rebotted.game.npcs.NpcHandler;
import com.rebotted.game.objects.Objects;
import com.rebotted.game.players.Client;
import com.rebotted.game.players.Player;
import com.rebotted.game.players.PlayerHandler;
import com.rebotted.util.Misc;
import com.rebotted.world.clip.Region;

Expand All @@ -37,8 +33,6 @@ public DwarfCannon(Player player2) {

public final int steelBarID = 2353;

private final int ammoMouldID = 4;

public boolean settingUp = false;

private int setUpStage = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public class RangeData {
public final static int[] BOWS = { 9185, 839, 845, 847, 851, 855, 859, 841,
843, 849, 853, 857, 861, 4212, 4214, 4215, 11235, 4216, 4217, 4218,
4219, 4220, 4221, 4222, 4223, 6724, 4734, 4934, 4935, 4936, 4937 };
public final static int[] ARROWS = { 882, 884, 886, 888, 890, 892, 4740,
public final static int[] ARROWS = { 882, 883, 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, 4740,
11212, 9140, 9141, 4142, 9143, 9144, 9240, 9241, 9242, 9243, 9244,
9245, 4150, 4160, 4172 };
public final static int[] NO_ARROW_DROP = { 4212, 4214, 4215, 4216, 4217,
Expand Down Expand Up @@ -50,10 +50,8 @@ public static boolean usingHally(Player c) {
case 3202:
case 3204:
return true;

default:
return false;
}
return false;
}

public static int correctBowAndArrows(Player c) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.rebotted.game.content.minigames;

import java.util.concurrent.CopyOnWriteArrayList;

import com.rebotted.GameConstants;
import com.rebotted.GameEngine;
import com.rebotted.game.content.combat.prayer.PrayerDrain;
Expand All @@ -17,8 +16,6 @@
import com.rebotted.util.GameLogger;
import com.rebotted.util.Misc;

import static com.rebotted.game.content.music.sound.SoundList.DUEL_WON;

public class Dueling {

private final Player player;
Expand Down Expand Up @@ -575,7 +572,7 @@ public void startDuel() {
player.getPlayerAssistant().requestUpdates();
}

public static void HandleForfeit(Player player)
public static void handleForfeit(Player player)
{
Client opponent = (Client) PlayerHandler.players[player.duelingWith];
opponent.getDueling().duelVictory();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public class PestControl {
public int ravager = 3742 + Misc.random(4);
public int torcher = 3752 + Misc.random(7);
public int splater = 3727 + Misc.random(4);


private final int[][] pcNPCData = { { 3777, 2628, 2591 }, // portal
{ 3778, 2680, 2588 }, // portal
Expand Down Expand Up @@ -150,40 +151,6 @@ public static void setGameInterface() {
}
}

/*
* private void setBoatInterface() { try { for (Client c :
* waitingBoat.keySet()) { if (c != null) { try { if (gameStarted) {
* c.getPlayerAssistant().sendString("Next Departure: " + (waitTimer +
* gameTimer)/60 + " minutes", 21120); } else {
* c.getPlayerAssistant().sendString("Next Departure: " + waitTimer + "",
* 21120); } c.getPlayerAssistant().sendString("Players Ready: " +
* playersInBoat() + "", 21121); c.getPlayerAssistant().sendString("(Need "
* + PLAYERS_REQUIRED + " to 25 players)", 21122);
* c.getPlayerAssistant().sendString("Points: " + c.pcPoints + "", 21123);
* switch (waitTimer) { case 60: c.getPacketDispatcher
* ().sendMessage("Next game will start in: 60 seconds."); break; case 30:
* c.
* getPacketDispatcher().sendMessage("Next game will start in: 30 seconds."
* ); break; } } catch (RuntimeException e) { // TODO Auto-generated catch
* block e.printStackTrace(); } } } } catch (RuntimeException e) {
* System.out.println("Failed to set interfaces"); e.printStackTrace(); } }
*/

/*
* private void setGameInterface() { for (Client player :
* gamePlayers.keySet()) { if (player != null) { for (int i = 0; i <
* portalHealth.length; i++) { if (portalHealth[i] > 0) {
* player.getPlayerAssistant().sendString("" + portalHealth[i] + "", 21111 +
* i); } else player.getPlayerAssistant().sendString("Dead", 21111 + i); }
* player.getPlayerAssistant().sendString("" + KNIGHTS_HEALTH, 21115);
* player.getPlayerAssistant().sendString("" + player.pcDamage, 21116); if
* (gameTimer > 60) {
* player.getPlayerAssistant().sendString("Time remaining: " +
* (gameTimer/60) + " minutes", 21117); } else {
* player.getPlayerAssistant().sendString("Time remaining: " + gameTimer +
* " seconds", 21117); } } } }
*/

/***
* Moving players to arena if there's enough players
*/
Expand All @@ -208,10 +175,10 @@ private void startGame() {
}
player.getPlayerAssistant().movePlayer(2656 + Misc.random3(3), 2614 - Misc.random3(4), 0);
player.getDialogueHandler().sendDialogues(599, 3790);
player.getPacketSender().sendMessage("The Pest Control Game has begun!");
player.getPacketSender().sendMessage("The Pest Control game has begun!");
player.npcCanAttack = true;
gamePlayers.put(player, team);
}

waitingBoat.clear();
}

Expand Down Expand Up @@ -322,14 +289,12 @@ private void cleanUpPlayer() {
player.poisonDamage = 0;
PrayerDrain.resetPrayers(player);
for (int i = 0; i < 24; i++) {
player.playerLevel[i] = player.getPlayerAssistant()
.getLevelForXP(player.playerXP[i]);
player.playerLevel[i] = player.getPlayerAssistant().getLevelForXP(player.playerXP[i]);
player.getPlayerAssistant().refreshSkill(i);
}
player.specAmount = 10;
player.pcDamage = 0;
player.getItemAssistant().addSpecialBar(
player.playerEquipment[player.playerWeapon]);
player.getItemAssistant().addSpecialBar(player.playerEquipment[player.playerWeapon]);
}
}

Expand Down Expand Up @@ -425,7 +390,11 @@ public static boolean isInPcBoat(Player player) {
}

public static boolean npcIsPCMonster(int npcType) {
return npcType >= 3727 && npcType <= 3776;
return (npcType >= 3727 && npcType <= 3776);
}

public static boolean isPCPortal(int npcType) {
return (npcType >= 3777 && npcType <= 3780);
}

private void spawnNPC() {
Expand All @@ -434,8 +403,8 @@ private void spawnNPC() {
GameEngine.npcHandler.spawnNpc2(aPcNPCData[0], aPcNPCData[1], aPcNPCData[2], 0, 0, 200, 0, 0, playersInGame() * 200, false);
}
for (int[] voidMonsters : voidMonsterData) {
//Server.npcHandler.spawnNpc2(voidMonsters[0], voidMonsters[1], voidMonsters[2], 0, 1, voidMonsters[NpcHandler.getNpcListHP(voidMonsters[0])], NpcHandler.getNpcListCombat(voidMonsters[0])/10, NpcHandler.getNpcListCombat(voidMonsters[0]), playersInGame() * 200);
GameEngine.npcHandler.spawnNpc2(voidMonsters[0], voidMonsters[1], voidMonsters[2], 0, 1, 500, 20, 200, 25, false);
//GameEngine.npcHandler.spawnNpc2(voidMonsters[0], voidMonsters[1], voidMonsters[2], 0, 1, voidMonsters[NpcHandler.getNpcListHP(voidMonsters[0])], NpcHandler.getNpcListCombat(voidMonsters[0])/10, NpcHandler.getNpcListCombat(voidMonsters[0]), playersInGame() * 200);
GameEngine.npcHandler.spawnNpc2(voidMonsters[0], voidMonsters[1], voidMonsters[2], 0, 1, 50, 20, 75, 50, true);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ public static void showInformation(Player client) {
client.getPacketSender().sendFrame126("I can start this quest by speaking to Sir Amik Varze in", 8147);
client.getPacketSender().sendFrame126("Falador Castle.", 8148);
client.getPacketSender().sendFrame126("", 8149);
client.getPacketSender().sendFrame126("QUEST REQUIREMENTS:", 8150);
client.getPacketSender().sendFrame126("Quest Requirements:", 8150);
client.getPacketSender().sendFrame126("12 Quest Points", 8151);
} else if (client.blackKnight == 1) {
client.getPacketSender().sendFrame126("@str@I've Talked with Sir Amik Varze", 8147);
client.getPacketSender().sendFrame126("@str@I've talked with Sir Amik Varze", 8147);
client.getPacketSender().sendFrame126("He wants me to kill 30 Black Knights and", 8148);
client.getPacketSender().sendFrame126("collect their notes.", 8149);
client.getPacketSender().sendFrame126("", 8150);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static void showInformation(Player client) {
client.getPacketSender().sendFrame126("Port Sarim", 8148);
client.getPacketSender().sendFrame126("", 8149);
client.getPacketSender().sendFrame126(
"There are no minimum requirments.", 8150);
"There are no minimum requirements.", 8150);
} else if (client.pirateTreasure == 1) {
client.getPacketSender().sendFrame126("Pirate's Treasure", 8144);
client.getPacketSender().sendFrame126(
Expand Down
Loading

0 comments on commit 9272195

Please sign in to comment.