opt-in random events

This commit is contained in:
dginovker
2019-06-21 10:38:39 -04:00
parent 37be342311
commit 8b585228c4
131 changed files with 32 additions and 16 deletions
+1
View File
@@ -0,0 +1 @@
2006Redone Server/data/characters/
@@ -61,6 +61,8 @@ public class RandomEventHandler {
} }
public static void addRandom(Client player) { public static void addRandom(Client player) {
if (player.randomToggle)
{
if (player.randomActions >= CALL_RANDOM) { if (player.randomActions >= CALL_RANDOM) {
callRandom(player); callRandom(player);
if (player.playerIsBusy() && !player.hasSandwhichLady) { if (player.playerIsBusy() && !player.hasSandwhichLady) {
@@ -75,3 +77,4 @@ public class RandomEventHandler {
} }
} }
} }
}
@@ -80,7 +80,8 @@ public abstract class Player {
recievedReward = false, poison, golemSpawned = false, zombieSpawned = false, shadeSpawned = false, recievedReward = false, poison, golemSpawned = false, zombieSpawned = false, shadeSpawned = false,
treeSpiritSpawned = false, chickenSpawned = false, clickedTree = false, filter = true, treeSpiritSpawned = false, chickenSpawned = false, clickedTree = false, filter = true,
stopPlayer = false, npcCanAttack = true, gliderOpen = false, hasSandwhichLady = false, stopPlayer = false, npcCanAttack = true, gliderOpen = false, hasSandwhichLady = false,
isHarvesting, openDuel = false, killedJad = false, canHealersRespawn = true, playerIsBusy = false, miningRock; isHarvesting, openDuel = false, killedJad = false, canHealersRespawn = true, playerIsBusy = false, miningRock,
randomToggle = false;
public int thankedForDonation, saveDelay, playerKilled, gertCat, restGhost, public int thankedForDonation, saveDelay, playerKilled, gertCat, restGhost,
romeojuliet, runeMist, vampSlayer, cookAss, doricQuest, romeojuliet, runeMist, vampSlayer, cookAss, doricQuest,
@@ -220,6 +220,9 @@ public class PlayerSave {
case "ratdied2": case "ratdied2":
player.ratdied2 = Boolean.parseBoolean(token2); player.ratdied2 = Boolean.parseBoolean(token2);
break; break;
case "randomToggle":
player.randomToggle = Boolean.parseBoolean(token2);
break;
case "questStages": case "questStages":
player.questStages = Integer.parseInt(token2); player.questStages = Integer.parseInt(token2);
break; break;
@@ -835,6 +838,10 @@ public class PlayerSave {
characterfile.write(Boolean.toString(player.ratdied2), 0, Boolean characterfile.write(Boolean.toString(player.ratdied2), 0, Boolean
.toString(player.ratdied2).length()); .toString(player.ratdied2).length());
characterfile.newLine(); characterfile.newLine();
characterfile.write("randomToggle = ", 0, 15);
characterfile.write(Boolean.toString(player.randomToggle), 0, Boolean
.toString(player.randomToggle).length());
characterfile.newLine();
characterfile.write("teleblock-length = ", 0, 19); characterfile.write("teleblock-length = ", 0, 19);
characterfile.write(Integer.toString(tbTime), 0, characterfile.write(Integer.toString(tbTime), 0,
Integer.toString(tbTime).length()); Integer.toString(tbTime).length());
@@ -2,7 +2,6 @@ package redone.net.packets.impl;
import redone.Connection; import redone.Connection;
import redone.Constants; import redone.Constants;
import redone.game.content.combat.magic.MagicTeleports;
import redone.game.items.ItemAssistant; import redone.game.items.ItemAssistant;
import redone.game.npcs.NpcHandler; import redone.game.npcs.NpcHandler;
import redone.game.players.Client; import redone.game.players.Client;
@@ -60,17 +59,22 @@ public class Commands implements PacketType {
player.getPlayerAssistant().closeAllWindows(); player.getPlayerAssistant().closeAllWindows();
break; break;
case "commands": case "commands":
player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck"); player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle");
break; break;
case "loc": case "loc":
player.getActionSender().sendMessage(player.absX + "," + player.absY); player.getActionSender().sendMessage(player.absX + "," + player.absY);
break; break;
case "stuck": case "stuck":
player.getPlayerAssistant().startTeleport(LUMBRIDGE_X, LUMBRIDGE_Y, 0, "modern"); player.getPlayerAssistant().startTeleport(LUMBRIDGE_X, LUMBRIDGE_Y, 0, "modern");
player.playerStun = true; player.getActionSender().sendMessage("How did you manage that one..");
player.gfx100(80); player.gfx100(80);
player.startAnimation(404); player.startAnimation(404);
break; break;
case "randomtoggle":
player.randomToggle = !player.randomToggle;
String message = player.randomToggle ? "You will now receive random events." : "You will no longer receieve random events.";
player.getActionSender().sendMessage(message);
break;
case "highscores": case "highscores":
HighscoresHandler hs = new HighscoresHandler(); HighscoresHandler hs = new HighscoresHandler();
String[] highscores = new String[]{ String[] highscores = new String[]{
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

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