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,17 +61,20 @@ public class RandomEventHandler {
}
public static void addRandom(Client player) {
if (player.randomActions >= CALL_RANDOM) {
callRandom(player);
if (player.playerIsBusy() && !player.hasSandwhichLady) {
player.getPlayerAssistant().closeAllWindows();
if (player.randomToggle)
{
if (player.randomActions >= CALL_RANDOM) {
callRandom(player);
if (player.playerIsBusy() && !player.hasSandwhichLady) {
player.getPlayerAssistant().closeAllWindows();
}
} else {
int nextRandom = CALL_RANDOM - player.randomActions;
if (player.playerRights == 3) {
player.getActionSender().sendMessage("Next random will be in " + nextRandom + " more random actions.");
}
player.randomActions += 1;
}
} else {
int nextRandom = CALL_RANDOM - player.randomActions;
if (player.playerRights == 3) {
player.getActionSender().sendMessage("Next random will be in " + nextRandom + " more random actions.");
}
player.randomActions += 1;
}
}
}
@@ -41,8 +41,8 @@ public abstract class Player {
restoreStatsDelay, logoutDelay, buryDelay, foodDelay, potDelay,
doorDelay, doubleDoorDelay, buySlayerTimer, lastIncrease,
boneDelay, botAttempts, leverDelay = 0, farmTime, searchObjectDelay = 0;
private Npc specialTarget = null;
private Npc specialTarget = null;
public void setSpecialTarget(Npc target) {
this.specialTarget = target;
}
@@ -80,7 +80,8 @@ public abstract class Player {
recievedReward = false, poison, golemSpawned = false, zombieSpawned = false, shadeSpawned = false,
treeSpiritSpawned = false, chickenSpawned = false, clickedTree = false, filter = true,
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,
romeojuliet, runeMist, vampSlayer, cookAss, doricQuest,
@@ -220,6 +220,9 @@ public class PlayerSave {
case "ratdied2":
player.ratdied2 = Boolean.parseBoolean(token2);
break;
case "randomToggle":
player.randomToggle = Boolean.parseBoolean(token2);
break;
case "questStages":
player.questStages = Integer.parseInt(token2);
break;
@@ -835,6 +838,10 @@ public class PlayerSave {
characterfile.write(Boolean.toString(player.ratdied2), 0, Boolean
.toString(player.ratdied2).length());
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(Integer.toString(tbTime), 0,
Integer.toString(tbTime).length());
@@ -2,7 +2,6 @@ package redone.net.packets.impl;
import redone.Connection;
import redone.Constants;
import redone.game.content.combat.magic.MagicTeleports;
import redone.game.items.ItemAssistant;
import redone.game.npcs.NpcHandler;
import redone.game.players.Client;
@@ -60,17 +59,22 @@ public class Commands implements PacketType {
player.getPlayerAssistant().closeAllWindows();
break;
case "commands":
player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck");
player.getActionSender().sendMessage("::players, ::highscores, ::loc, ::stuck, ::randomtoggle");
break;
case "loc":
player.getActionSender().sendMessage(player.absX + "," + player.absY);
break;
case "stuck":
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.startAnimation(404);
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":
HighscoresHandler hs = new HighscoresHandler();
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