mirror of
https://gitlab.com/2009scape/2009scape.git
synced 2025-12-09 16:45:44 -07:00
commit
7cda4b92f0
28 changed files with 1279 additions and 836 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -10,3 +10,4 @@ CompiledServer/**/*.jar
|
|||
**/.idea/workspace.xml
|
||||
**/.idea/*
|
||||
*.class
|
||||
CompiledServer/
|
||||
|
|
|
|||
1
Server/.gitignore
vendored
1
Server/.gitignore
vendored
|
|
@ -13,3 +13,4 @@ data/profile/**
|
|||
*.eml
|
||||
*.userlibraries
|
||||
data/players/**
|
||||
data/eco/offer_dispatch_db.emp
|
||||
|
|
|
|||
|
|
@ -41,7 +41,6 @@ wef6qwe4r561:3:0:0:0:0:0:0:0:0:0:0:0:0:
|
|||
Sister 13:3:12600:9793:0:20590:6186:24325:0:13288:0:0:23285:0:
|
||||
IsidraJr:58:0:0:0:0:0:0:0:0:0:0:0:0:
|
||||
BeDeMaSa0891:3:0:0:0:0:0:0:0:0:0:0:0:0:
|
||||
Jazzy Otto:101:22689:0:22692:1419:22695:0:0:22698:0:0:22701:0:
|
||||
JustSkillezZ:50:1017:0:0:1387:426:0:0:428:0:0:0:0:
|
||||
Elcangri11:39:1017:1007:1727:1381:1035:1199:0:1033:0:1059:1061:0:
|
||||
haroldas 99r:13:1017:1019:1731:843:0:0:0:1015:0:1059:1061:0:
|
||||
|
|
@ -58,7 +57,6 @@ laitukas29:3:0:0:0:0:0:0:0:0:0:0:0:0:
|
|||
AFRODITA-23:38:0:0:0:0:0:0:0:0:0:0:0:0:
|
||||
Monrojas:50:0:1029:1725:1381:0:0:0:1099:0:1065:1061:0:
|
||||
stejler:114:21266:6570:19553:4151:21301:12954:0:21304:0:7462:11840:0:
|
||||
r0cK4eV3r:103:11850:11852:0:0:11854:0:0:11856:0:11858:11860:0:
|
||||
Loamjytuner:3:0:0:0:0:0:0:0:0:0:0:0:0:
|
||||
u smoke mid:92:12293:10499:10364:1387:1121:1197:0:1071:0:1065:11840:0:
|
||||
MIMIYEEET:64:0:10499:0:861:0:0:0:0:0:0:0:0:
|
||||
|
|
|
|||
|
|
@ -1 +1,11 @@
|
|||
sicriona:103:1163:1023:1725:1333:1127:1201:0:1079:0:2922:1061:0:
|
||||
#Format:
|
||||
#name:cblevel:helmet:cape:neck:weapon:chest:shield:unknown:legs:unknown:gloves:boots:
|
||||
sicriona:103:1163:1023:1725:1333:1127:1201:0:1079:0:2922:1061:0:
|
||||
czar:110:1149:6568:1704:4587:10564:6524:0:4585:0:1059:1061:
|
||||
loving puppy:95:11665:6568:1704:4587:8839:14767:0:8840:0:8842:1061:
|
||||
rattle63:83:14096:10499:1704:4151:14094:14767:0:14095:0:8842:1061:
|
||||
baluga:110:10828:6568:10354:4151:3140:6524:0:4087:0:8842:11732:
|
||||
crabcake:115:10828:10446:10354:4151:10564:6524:0:4087:0:8842:11732:
|
||||
Red:94:1163:6568:10354:7158:10564:0:0:4087:0:1059:11732:
|
||||
puglet:120:10828:6568:6585:11696:4757:0:0:8840:0:1059:3105:
|
||||
linux:10000:10828:10069:1725:4151:3140:14767:0:4087:0:1059:3105:
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load diff
|
|
@ -86,6 +86,7 @@ public abstract class ClueScrollPlugin extends MapZone implements Plugin<Object>
|
|||
}
|
||||
nextStage(player, clue);
|
||||
if (casket) {
|
||||
player.getStatisticsManager().getCLUES_COMPLETED().incrementAmount();
|
||||
player.getInventory().replace(level.getCasket(), clue.getSlot());
|
||||
} else {
|
||||
player.getInventory().remove(clue);
|
||||
|
|
|
|||
|
|
@ -154,6 +154,7 @@ public final class GatheringSkillPulse extends SkillPulse<GameObject> {
|
|||
Projectile.create(player, null, 1776, 35, 30, 20, 25).transform(player, new Location(player.getLocation().getX() + 2, player.getLocation().getY()), true, 25, 25).send();
|
||||
player.getSkills().addExperience(Skills.WOODCUTTING, resource.getExperience());
|
||||
player.getSkills().addExperience(Skills.FIREMAKING, resource.getExperience());
|
||||
player.getStatisticsManager().getLOGS_OBTAINED().incrementAmount();
|
||||
return false;
|
||||
}
|
||||
int reward = resource.getReward();
|
||||
|
|
@ -176,6 +177,7 @@ public final class GatheringSkillPulse extends SkillPulse<GameObject> {
|
|||
player.getPacketDispatch().sendMessage("You cut a branch from the Dramen tree.");
|
||||
} else {
|
||||
player.getPacketDispatch().sendMessage("You get some " + ItemDefinition.forId(reward).getName().toLowerCase() + ".");
|
||||
player.getStatisticsManager().getLOGS_OBTAINED().incrementAmount();
|
||||
}
|
||||
// Calculate if the player should receive a bonus gem or bonus ore or both
|
||||
if (!isMiningEssence && isMining) {
|
||||
|
|
|
|||
|
|
@ -211,6 +211,10 @@ public abstract class Entity extends Node {
|
|||
* @param killer The killer of this entity.
|
||||
*/
|
||||
public void finalizeDeath(Entity killer) {
|
||||
if (killer.isPlayer()) {
|
||||
if (!((Player)killer).isArtificial())
|
||||
((Player)killer).getStatisticsManager().getENTITIES_KILLED().incrementAmount();
|
||||
}
|
||||
skills.restore();
|
||||
skills.rechargePrayerPoints();
|
||||
impactHandler.getImpactQueue().clear();
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ import org.crandor.game.node.entity.player.link.prayer.PrayerType;
|
|||
import org.crandor.game.node.entity.player.link.quest.QuestRepository;
|
||||
import org.crandor.game.node.entity.player.link.request.RequestManager;
|
||||
import org.crandor.game.node.entity.player.link.skillertasks.SkillerTasks;
|
||||
import org.crandor.game.node.entity.player.link.statistics.PlayerStatisticsManager;
|
||||
import org.crandor.game.node.item.GroundItem;
|
||||
import org.crandor.game.node.item.GroundItemManager;
|
||||
import org.crandor.game.node.item.Item;
|
||||
|
|
@ -99,6 +100,7 @@ import org.crandor.net.packet.out.SkillLevel;
|
|||
import org.crandor.net.packet.out.UpdateSceneGraph;
|
||||
import org.crandor.plugin.Plugin;
|
||||
import org.crandor.tools.StringUtils;
|
||||
|
||||
import plugin.activity.pyramidplunder.PlunderObjectManager;
|
||||
|
||||
/**
|
||||
|
|
@ -302,6 +304,11 @@ public class Player extends Entity {
|
|||
* The jobs minigame manager.
|
||||
*/
|
||||
private final JobsMinigameManager jobsManager = new JobsMinigameManager(this);
|
||||
|
||||
/**
|
||||
* The statistics manager.
|
||||
*/
|
||||
private final PlayerStatisticsManager statisticsManager = new PlayerStatisticsManager(this);
|
||||
|
||||
/**
|
||||
* The logout plugins.
|
||||
|
|
@ -536,6 +543,10 @@ public class Player extends Entity {
|
|||
return;
|
||||
}
|
||||
getPacketDispatch().sendMessage("Oh dear, you are dead!");
|
||||
|
||||
if (!isArtificial()) {
|
||||
getStatisticsManager().getDEATHS().incrementAmount();
|
||||
}
|
||||
|
||||
//If player was a Hardcore Ironman, announce that they died
|
||||
if (this.getIronmanManager().getMode().equals(IronmanMode.HARDCORE)){ //if this was checkRestriction, ultimate irons would be moved to HARDCORE_DEAD as well
|
||||
|
|
@ -1342,4 +1353,8 @@ public class Player extends Entity {
|
|||
public JobsMinigameManager getJobsManager() {
|
||||
return jobsManager;
|
||||
}
|
||||
|
||||
public PlayerStatisticsManager getStatisticsManager() {
|
||||
return statisticsManager;
|
||||
}
|
||||
}
|
||||
|
|
@ -184,12 +184,11 @@ public class AIPlayer extends Player {
|
|||
++n;
|
||||
String line = sc.nextLine();
|
||||
if (rand.nextInt(n) == 0) { //Chance of overwriting line is lower and lower
|
||||
OSRScopyLine = line;
|
||||
if (line.length() < 3) //probably an empty line
|
||||
if (line.length() < 3 || line.startsWith("#")) //probably an empty line
|
||||
{
|
||||
System.out.println("Something went wrong reading line [" + line + "] from /data/botdata/" + fileName);
|
||||
updateRandomOSRScopyLine(fileName);
|
||||
continue;
|
||||
}
|
||||
OSRScopyLine = line;
|
||||
}
|
||||
}
|
||||
} catch (FileNotFoundException e) {
|
||||
|
|
@ -199,7 +198,9 @@ public class AIPlayer extends Player {
|
|||
}
|
||||
|
||||
private static String retrieveRandomName(String fileName) {
|
||||
updateRandomOSRScopyLine(fileName);
|
||||
do {
|
||||
updateRandomOSRScopyLine(fileName);
|
||||
} while (OSRScopyLine.startsWith("#")); //Comment
|
||||
return OSRScopyLine.split(":")[0];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,10 +66,12 @@ public class CombatState {
|
|||
bot.tick--;
|
||||
|
||||
bot.eat(379);
|
||||
bot.getSkills().setLevel(Skills.PRAYER, 99);
|
||||
bot.getSkills().setStaticLevel(Skills.PRAYER, 99);
|
||||
if (!(bot.getPrayer().getActive().contains(PrayerType.PROTECT_FROM_MELEE)))
|
||||
bot.getPrayer().toggle(PrayerType.PROTECT_FROM_MELEE);
|
||||
if (bot.randomType < 30) {
|
||||
bot.getSkills().setLevel(Skills.PRAYER, 99);
|
||||
bot.getSkills().setStaticLevel(Skills.PRAYER, 99);
|
||||
if (!(bot.getPrayer().getActive().contains(PrayerType.PROTECT_FROM_MELEE)))
|
||||
bot.getPrayer().toggle(PrayerType.PROTECT_FROM_MELEE);
|
||||
}
|
||||
|
||||
if (!bot.inCombat())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package org.crandor.game.node.entity.player.ai.minigamebots.pestcontrol;
|
|||
import org.crandor.game.node.Node;
|
||||
import org.crandor.game.node.entity.Entity;
|
||||
import org.crandor.game.node.entity.player.ai.pvmbots.PvMBots;
|
||||
import org.crandor.game.node.entity.player.link.prayer.PrayerType;
|
||||
import org.crandor.game.world.map.Location;
|
||||
import org.crandor.net.packet.in.InteractionPacket;
|
||||
import org.crandor.tools.RandomFunction;
|
||||
|
|
@ -88,6 +89,7 @@ public class PestControlTestBot extends PvMBots {
|
|||
}
|
||||
|
||||
private void attackNPCs() {
|
||||
this.getWalkingQueue().setRunning(true);
|
||||
List<Entity> creatures = FindTargets(this, 15);
|
||||
if (creatures == null || creatures.isEmpty())
|
||||
{
|
||||
|
|
@ -96,7 +98,11 @@ public class PestControlTestBot extends PvMBots {
|
|||
this.setCustomState("Going to portals");
|
||||
combathandler.goToPortals();
|
||||
} else {
|
||||
randomWalkAroundPoint(getMyPestControlSession(this).getSquire().getLocation(), 3);
|
||||
try {
|
||||
randomWalkAroundPoint(getMyPestControlSession(this).getSquire().getLocation(), 3);
|
||||
} catch (NullPointerException e) {
|
||||
//Do nothing, game just finished
|
||||
}
|
||||
movetimer = new Random().nextInt(15) + 6;
|
||||
}
|
||||
} else {
|
||||
|
|
@ -121,6 +127,10 @@ public class PestControlTestBot extends PvMBots {
|
|||
if (new Random().nextInt(insideBoatWalks) <= 1)
|
||||
{
|
||||
insideBoatWalks *= 1.5;
|
||||
if (new Random().nextInt(4) == 1)
|
||||
{
|
||||
this.getWalkingQueue().setRunning(!this.getWalkingQueue().isRunning());
|
||||
}
|
||||
if (new Random().nextInt(7) == 1)
|
||||
{
|
||||
this.walkToPosSmart(new Location(2660, 2638));
|
||||
|
|
@ -136,6 +146,10 @@ public class PestControlTestBot extends PvMBots {
|
|||
}
|
||||
|
||||
private void enterBoat() {
|
||||
if (getPrayer().getActive().contains(PrayerType.PROTECT_FROM_MELEE)) {
|
||||
getPrayer().toggle(PrayerType.PROTECT_FROM_MELEE);
|
||||
}
|
||||
|
||||
if (new Random().nextInt(3) <= 1) //Don't join instantly
|
||||
{
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import org.crandor.game.node.entity.player.ai.resource.task.ResourceTasks;
|
|||
import org.crandor.game.node.entity.player.ai.skillingbot.SkillingBotsBuilder;
|
||||
import org.crandor.game.system.task.Pulse;
|
||||
import org.crandor.game.world.GameWorld;
|
||||
import org.crandor.game.world.map.Location;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
|
|
@ -39,7 +40,6 @@ public class ResourceAIPManager {
|
|||
public void immerseWorld() { //There's probably a better place for this (it adds bot at bootup)
|
||||
PvMBotsBuilder.immersiveSpawns();
|
||||
LumbridgeBotHandler.immersiveLumbridge();
|
||||
//AIPBuilder.immersiveSpawns();
|
||||
//SkillingBotsBuilder.immersiveSpawnsSkillingBots();
|
||||
System.out.println("Loaded immerseWorld");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,12 +36,10 @@ public class SkillingBot extends AIPlayer {
|
|||
|
||||
switch (this.skill)
|
||||
{
|
||||
case Skills.MINING:
|
||||
default:
|
||||
break;
|
||||
case Skills.MINING:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// TODO Auto-generated constructor stub
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -176,7 +176,8 @@ public final class SkillingBotsBuilder extends AIPlayer {
|
|||
bot.getSkills().setLevel(Skills.FISHING, 25);
|
||||
bot.setInteractionRange(25);
|
||||
}
|
||||
|
||||
|
||||
//These bots are disabled because they somehow break pets
|
||||
public static void immersiveSpawnsSkillingBots()
|
||||
{
|
||||
// Varrock Mine
|
||||
|
|
|
|||
|
|
@ -149,6 +149,9 @@ public final class PlayerParser {
|
|||
case 46:
|
||||
player.getSkills().parseExpRate(buffer);
|
||||
break;
|
||||
case 47:
|
||||
player.getStatisticsManager().parse(buffer);
|
||||
break;
|
||||
default:
|
||||
System.err.println("[Player parsing] Unhandled opcode: " + opcode + " for " + player.getName() + " - [log=" + Arrays.toString(opcodeLog) + "].");
|
||||
break;
|
||||
|
|
@ -302,6 +305,8 @@ public final class PlayerParser {
|
|||
}
|
||||
|
||||
player.getSkills().saveExpRate(buffer.put((byte) 46));
|
||||
|
||||
player.getStatisticsManager().save(buffer.put((byte)47));
|
||||
|
||||
buffer.put((byte) 0); // EOF opcode
|
||||
buffer.flip();
|
||||
|
|
|
|||
|
|
@ -0,0 +1,115 @@
|
|||
package org.crandor.game.node.entity.player.link.statistics;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
import org.crandor.game.node.entity.player.info.login.SavingModule;
|
||||
|
||||
/**
|
||||
* Stuff
|
||||
* @author jamix77
|
||||
*
|
||||
*/
|
||||
public class PlayerStatisticsManager implements SavingModule {
|
||||
|
||||
/**
|
||||
* Array of statistics.
|
||||
*/
|
||||
private final ArrayList<Statistic> STATISTICS = new ArrayList<Statistic>();
|
||||
|
||||
|
||||
private Statistic
|
||||
AL_KHARID_GATE_PASSES,
|
||||
FLAX_PICKED,
|
||||
CLUES_COMPLETED,
|
||||
ENTITIES_KILLED,
|
||||
DEATHS,
|
||||
LOGS_OBTAINED;
|
||||
|
||||
|
||||
/**
|
||||
* The player instance for this manager.
|
||||
*/
|
||||
private final Player player;
|
||||
|
||||
|
||||
public PlayerStatisticsManager(Player player) {
|
||||
this.player = player;
|
||||
if (!player.isArtificial())
|
||||
initStats();
|
||||
}
|
||||
|
||||
private void initStats() {
|
||||
AL_KHARID_GATE_PASSES = new Statistic(player,this);
|
||||
FLAX_PICKED = new Statistic(player,this);
|
||||
CLUES_COMPLETED = new Statistic(player,this);
|
||||
LOGS_OBTAINED = new Statistic(player,this);
|
||||
ENTITIES_KILLED = new Statistic(player,this);
|
||||
DEATHS = new Statistic(player,this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(ByteBuffer buffer) {
|
||||
for (int i = 0; i < STATISTICS.size(); i++) {
|
||||
Statistic s = STATISTICS.get(i);
|
||||
buffer.put((byte) 1).putInt(i).putInt(s.getStatisticalAmount());
|
||||
}
|
||||
buffer.put((byte)0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void parse(ByteBuffer buffer) {
|
||||
int opcode;
|
||||
while ((opcode = buffer.get() & 0xFF) != 0) {
|
||||
switch (opcode) {
|
||||
case 1:
|
||||
int index = buffer.getInt();
|
||||
int amount = buffer.getInt();
|
||||
STATISTICS.get(index).setStatisticalAmount(amount);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a statistic to the arraylist.
|
||||
* @param statistic
|
||||
*/
|
||||
public void addStatistic(Statistic statistic) {
|
||||
STATISTICS.add(statistic);
|
||||
}
|
||||
|
||||
|
||||
public ArrayList<Statistic> getSTATISTICS() {
|
||||
return STATISTICS;
|
||||
}
|
||||
|
||||
public Statistic getAL_KHARID_GATE_PASSES() {
|
||||
return AL_KHARID_GATE_PASSES;
|
||||
}
|
||||
|
||||
public Statistic getFLAX_PICKED() {
|
||||
return FLAX_PICKED;
|
||||
}
|
||||
|
||||
public Statistic getCLUES_COMPLETED() {
|
||||
return CLUES_COMPLETED;
|
||||
}
|
||||
|
||||
public Statistic getLOGS_OBTAINED() {
|
||||
return LOGS_OBTAINED;
|
||||
}
|
||||
|
||||
public Statistic getENTITIES_KILLED() {
|
||||
return ENTITIES_KILLED;
|
||||
}
|
||||
|
||||
public Statistic getDEATHS() {
|
||||
return DEATHS;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
package org.crandor.game.node.entity.player.link.statistics;
|
||||
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
|
||||
/**
|
||||
* A singular statistic.
|
||||
* @author jamix77
|
||||
*
|
||||
*/
|
||||
public class Statistic {
|
||||
|
||||
/**
|
||||
* The player instance for this manager.
|
||||
*/
|
||||
private final Player player;
|
||||
|
||||
/**
|
||||
* The amount of the statistic.
|
||||
*/
|
||||
private int statisticalAmount;
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructs a new @{Code Statistic} object.
|
||||
* @param player
|
||||
*/
|
||||
public Statistic(Player player, PlayerStatisticsManager sm) {
|
||||
this(player,0,sm);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Constructs a new @{Code Statistic} object.
|
||||
* @param player
|
||||
* @param amount
|
||||
*/
|
||||
public Statistic(Player player,int amount, PlayerStatisticsManager sm) {
|
||||
this.player = player;
|
||||
this.statisticalAmount = amount;
|
||||
sm.addStatistic(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Increase only by one.
|
||||
*/
|
||||
public void incrementAmount() {
|
||||
increaseAmount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrease only by one.
|
||||
*/
|
||||
public void decrementAmount() {
|
||||
decreaseAmount(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Increase by a certain amount.
|
||||
* @param amount
|
||||
*/
|
||||
public void increaseAmount(int amount) {
|
||||
statisticalAmount += amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decrease by a certain amount.
|
||||
* @param amount
|
||||
*/
|
||||
public void decreaseAmount(int amount) {
|
||||
statisticalAmount -= amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the amount
|
||||
*/
|
||||
public int getStatisticalAmount() {
|
||||
return statisticalAmount;
|
||||
}
|
||||
|
||||
public void setStatisticalAmount(int statisticalAmount) {
|
||||
this.statisticalAmount = statisticalAmount;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import org.crandor.game.content.activity.ActivityManager;
|
|||
import org.crandor.game.interaction.OptionHandler;
|
||||
import org.crandor.game.node.Node;
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
import org.crandor.game.node.entity.player.ai.pvmbots.PvMBotsBuilder;
|
||||
import org.crandor.game.node.entity.player.info.Rights;
|
||||
import org.crandor.game.node.item.Item;
|
||||
import org.crandor.game.node.object.GameObject;
|
||||
|
|
@ -15,12 +16,17 @@ import org.crandor.game.world.map.RegionManager;
|
|||
import org.crandor.game.world.update.flag.context.Animation;
|
||||
import org.crandor.plugin.Plugin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Handles pest control objects.
|
||||
* @author Emperor
|
||||
*/
|
||||
public final class PCObjectHandler extends OptionHandler {
|
||||
|
||||
public boolean pcbotsSpawned = false;
|
||||
public ArrayList<String> playersJoined = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public Plugin<Object> newInstance(Object arg) throws Throwable {
|
||||
// Barricades
|
||||
|
|
@ -91,6 +97,17 @@ public final class PCObjectHandler extends OptionHandler {
|
|||
}
|
||||
switch (object.getId()) {
|
||||
case 14315: // Novice
|
||||
if (!pcbotsSpawned) { //First person to join gets bots to play with
|
||||
pcbotsSpawned = true;
|
||||
for (int pestBotsAmount = 0; pestBotsAmount < 20; pestBotsAmount++) {
|
||||
PvMBotsBuilder.createPestControlTestBot(new Location(2657, 2640));
|
||||
}
|
||||
}
|
||||
if (!playersJoined.contains(player.getUsername())) { //You also get +1 bot for every friend
|
||||
playersJoined.add(player.getUsername());
|
||||
PvMBotsBuilder.createPestControlTestBot(new Location(2657, 2640));
|
||||
}
|
||||
|
||||
startActivity(player, "pest control novice", Location.create(2661, 2639, 0));
|
||||
return true;
|
||||
case 25631: // Intermediate
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package plugin.command;
|
||||
|
||||
import org.crandor.game.container.Container;
|
||||
import org.crandor.game.container.impl.EquipmentContainer;
|
||||
import org.crandor.game.content.skill.Skills;
|
||||
import org.crandor.game.interaction.Interaction;
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
|
|
@ -145,7 +146,7 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
player.setAttribute("aip_legion", PVPAIPActions.pvp_players = new ArrayList<>());
|
||||
}
|
||||
for (int i = 0; i < size; i++) {
|
||||
final AIPlayer aip = AIPBuilder.create( generateLocation(player));
|
||||
final AIPlayer aip = AIPBuilder.create(generateLocation(player));
|
||||
aip.setControler(player);
|
||||
aip.getAppearance().setGender(RandomFunction.random(3) == 1 ? Gender.FEMALE : Gender.MALE);
|
||||
|
||||
|
|
@ -216,6 +217,25 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
case "immersiveworld":
|
||||
case "immersive":
|
||||
ResourceAIPManager.get().immerseWorld();
|
||||
player.sendMessage("Started immersive world, 2");
|
||||
return true;
|
||||
case "botdataform":
|
||||
//Dumps your current character info in the form used by data/botdata
|
||||
//name:cblevel:helmet:cape:neck:weapon:chest:shield:unknown:legs:unknown:gloves:boots:
|
||||
System.out.println(player.getUsername() + ":"
|
||||
+ player.getProperties().getCurrentCombatLevel() + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_HAT) + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_CAPE) + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_AMULET) + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_WEAPON) + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_CHEST) + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_SHIELD) + ":"
|
||||
+ "0" + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_LEGS) + ":"
|
||||
+ "0" + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_HANDS) + ":"
|
||||
+ player.getEquipment().getAsId(EquipmentContainer.SLOT_FEET) + ":"
|
||||
);
|
||||
return true;
|
||||
case "fishtest":
|
||||
SkillingBotsBuilder.spawnTroutLumbridge(new Location(3241, 3242));
|
||||
|
|
@ -254,7 +274,7 @@ public final class AIPCommandPlugin extends CommandPlugin {
|
|||
try {
|
||||
arg2 = Integer.parseInt(args[1]);
|
||||
} catch (Exception e) {
|
||||
arg2 = 123;
|
||||
arg2 = 20;
|
||||
}
|
||||
for (int pestBotsAmount = 0; pestBotsAmount < arg2; pestBotsAmount++) {
|
||||
PvMBotsBuilder.createPestControlTestBot(player.getLocation());
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import org.crandor.game.node.entity.player.ai.resource.ResourceAIPManager;
|
|||
import org.crandor.game.node.entity.player.info.login.PlayerParser;
|
||||
import org.crandor.game.node.entity.player.link.IronmanMode;
|
||||
import org.crandor.game.node.entity.player.link.appearance.Gender;
|
||||
import org.crandor.game.node.entity.player.link.music.MusicEntry;
|
||||
import org.crandor.game.node.entity.player.link.quest.Quest;
|
||||
import org.crandor.game.node.entity.player.link.skillertasks.Difficulty;
|
||||
import org.crandor.game.node.entity.state.EntityState;
|
||||
|
|
@ -100,6 +101,17 @@ public final class DeveloperCommandPlugin extends CommandPlugin {
|
|||
@Override
|
||||
public boolean parse(final Player player, String name, String[] args) {
|
||||
switch (name) {
|
||||
case "unlockmusic":
|
||||
for (MusicEntry me : MusicEntry.getSongs().values()) {
|
||||
player.getMusicPlayer().unlock(me.getId());
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "playsong":
|
||||
player.getMusicPlayer().play(MusicEntry.getSongs().get(Integer.parseInt(args[1])));
|
||||
player.sendMessage("Playing song: " + MusicEntry.getSongs().get(Integer.parseInt(args[1])).getName());
|
||||
break;
|
||||
case "find":
|
||||
try {
|
||||
player.getAttributes().put("spawning_items", true);
|
||||
|
|
|
|||
|
|
@ -2,10 +2,14 @@ package plugin.command;
|
|||
|
||||
import org.crandor.ServerConstants;
|
||||
import org.crandor.game.component.Component;
|
||||
import org.crandor.game.content.skill.Skills;
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
import org.crandor.game.node.entity.player.info.PlayerDetails;
|
||||
import org.crandor.game.node.entity.player.info.Rights;
|
||||
import org.crandor.game.node.entity.player.info.login.PlayerParser;
|
||||
import org.crandor.game.node.entity.player.link.IronmanMode;
|
||||
import org.crandor.game.node.entity.player.link.RunScript;
|
||||
import org.crandor.game.node.entity.player.link.music.MusicEntry;
|
||||
import org.crandor.game.node.entity.player.link.quest.Quest;
|
||||
import org.crandor.game.node.entity.player.link.quest.QuestRepository;
|
||||
import org.crandor.game.system.command.CommandPlugin;
|
||||
|
|
@ -53,6 +57,27 @@ public final class PlayerCommandPlugin extends CommandPlugin {
|
|||
TutorialStage.load(player, stage, false);
|
||||
break;
|
||||
*/
|
||||
case "stats":
|
||||
|
||||
|
||||
player.setAttribute("runscript", new RunScript() {
|
||||
@Override
|
||||
public boolean handle() {
|
||||
try {
|
||||
Player target = new Player(PlayerDetails.getDetails((String)value));
|
||||
PlayerParser.parse(target);
|
||||
if (!target.getDetails().parse()) return true;
|
||||
sendHiscore(player,target);
|
||||
}
|
||||
catch (Exception e) {player.getDialogueInterpreter().sendPlainMessage(false, "That isn't a valid name.");}
|
||||
return true;
|
||||
}
|
||||
});
|
||||
player.getDialogueInterpreter().sendInput(true, "Enter a username:");
|
||||
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case "shop":
|
||||
CREDIT_STORE.open(player);
|
||||
|
|
@ -254,6 +279,49 @@ public final class PlayerCommandPlugin extends CommandPlugin {
|
|||
player.getPacketDispatch().sendString("<col=ecf0f1>::bankresettabs", 275, lineId++);
|
||||
player.getPacketDispatch().sendString("<col=2c3e50>Reset all of your bank tabs.", 275, lineId++);
|
||||
}
|
||||
|
||||
private void sendHiscore(Player player, Player target) {
|
||||
if (player.getInterfaceManager().isOpened()) {
|
||||
player.sendMessage("Finish what you're currently doing.");
|
||||
return;
|
||||
}
|
||||
player.getInterfaceManager().open(new Component(275));
|
||||
//CLear old data
|
||||
for (int i = 0; i < 311; i++) {
|
||||
player.getPacketDispatch().sendString("", 275, i);
|
||||
}
|
||||
// Title
|
||||
//14 Ult IM
|
||||
//13 IM
|
||||
//15 HCIM
|
||||
player.getPacketDispatch().sendString("" + (target.getRights() == Rights.ADMINISTRATOR ? "<img=1>" : (target.getRights() == Rights.PLAYER_MODERATOR ? "<img=0>" : (target.getIronmanManager().getMode() == IronmanMode.STANDARD ? "<img=13>" : (target.getIronmanManager().getMode() == IronmanMode.ULTIMATE ? "<img=14>" : (target.getIronmanManager().getMode() == IronmanMode.HARDCORE ? "<img=15>" : ""))))) + "<col=ae1515>" + target.getUsername() + "</col>'s stats.", 275, 2);
|
||||
|
||||
// Content
|
||||
int lineId = 11;
|
||||
player.getPacketDispatch().sendString("Total level: " + target.getSkills().getTotalLevel(), 275, lineId++);
|
||||
player.getPacketDispatch().sendString("Total xp: " + StringUtils.getFormattedNumber(target.getSkills().getTotalXp()), 275, lineId++);
|
||||
for (int i = 0; i < Skills.SKILL_NAME.length; i++) {
|
||||
player.getPacketDispatch().sendString("" + Skills.SKILL_NAME[i] + ": " + target.getSkills().getStaticLevel(i) + " (" + StringUtils.getFormattedNumber((int) Math.round(target.getSkills().getExperience(i))) + ")", 275, lineId++);
|
||||
}
|
||||
|
||||
//stats
|
||||
player.getPacketDispatch().sendString("<col=ecf0f1>(Since 27/03/2020)</col> Al kharid passes: " + target.getStatisticsManager().getAL_KHARID_GATE_PASSES().getStatisticalAmount(), 275, lineId++);
|
||||
player.getPacketDispatch().sendString("<col=ecf0f1>(Since 27/03/2020)</col> Logs chopped: " + target.getStatisticsManager().getLOGS_OBTAINED().getStatisticalAmount(), 275, lineId++);
|
||||
player.getPacketDispatch().sendString("<col=ecf0f1>(Since 27/03/2020)</col> Flax picked: " + target.getStatisticsManager().getFLAX_PICKED().getStatisticalAmount(), 275, lineId++);
|
||||
player.getPacketDispatch().sendString("<col=ecf0f1>(Since 27/03/2020)</col> Clue scrolls completed: " + target.getStatisticsManager().getCLUES_COMPLETED().getStatisticalAmount(), 275, lineId++);
|
||||
player.getPacketDispatch().sendString("<col=ecf0f1>(Since 27/03/2020)</col> Enemies killed: " + target.getStatisticsManager().getENTITIES_KILLED().getStatisticalAmount(), 275, lineId++);
|
||||
player.getPacketDispatch().sendString("<col=ecf0f1>(Since 27/03/2020)</col> Deaths: " + target.getStatisticsManager().getDEATHS().getStatisticalAmount(), 275, lineId++);
|
||||
player.getPacketDispatch().sendString("Music tracks unlocked: " + target.getMusicPlayer().getUnlocked().size() + "/" + MusicEntry.getSongs().size(), 275, lineId++);
|
||||
|
||||
|
||||
//quests
|
||||
player.getPacketDispatch().sendString("", 275, lineId++);
|
||||
player.getPacketDispatch().sendString("<u><col=0000FF>Quests Completed:", 275, lineId++);
|
||||
for (Quest q : QuestRepository.getQuests().values()) {
|
||||
player.getPacketDispatch().sendString("" + (q.isCompleted(target) ? "<col=00FF00>" : "<col=ae1515>") + q.getName() + " ", 275, lineId++);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends information about donating.
|
||||
|
|
|
|||
|
|
@ -103,6 +103,7 @@ public final class BorderGuardDialogue extends DialoguePlugin {
|
|||
}
|
||||
if (player.getInventory().remove(COINS)) {
|
||||
DoorActionHandler.handleAutowalkDoor(player, door);
|
||||
player.getStatisticsManager().getAL_KHARID_GATE_PASSES().incrementAmount();
|
||||
} else {
|
||||
player.getPacketDispatch().sendMessage("You need 10 gold coins to pay the toll.");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package plugin.dialogue;
|
|||
|
||||
import org.crandor.game.content.dialogue.DialoguePlugin;
|
||||
import org.crandor.game.content.dialogue.FacialExpression;
|
||||
import org.crandor.game.content.skill.Skills;
|
||||
import org.crandor.game.node.entity.npc.NPC;
|
||||
import org.crandor.game.node.entity.player.Player;
|
||||
import org.crandor.game.node.entity.player.link.quest.Quest;
|
||||
|
|
@ -104,6 +105,9 @@ public final class CaveMonk extends DialoguePlugin {
|
|||
end();
|
||||
break;
|
||||
case 20:
|
||||
if (player.getSkills().getLevel(Skills.PRAYER) > 2 && player.getSkills().getPrayerPoints() > 2) {
|
||||
player.getSkills().decrementPrayerPoints(player.getSkills().getLevel(Skills.PRAYER) - 2);
|
||||
}
|
||||
player.getProperties().setTeleportLocation(DUNGEON);
|
||||
end();
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -120,6 +120,7 @@ public final class FieldPickingPlugin extends OptionHandler {
|
|||
int charge = object.getCharge();
|
||||
player.getAudioManager().send(2581);
|
||||
player.getPacketDispatch().sendMessage("You pick some flax.");
|
||||
player.getStatisticsManager().getFLAX_PICKED().incrementAmount();
|
||||
if (charge > 1000 + RandomFunction.random(2, 8)) {
|
||||
object.setActive(false);
|
||||
object.setCharge(1000);
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ public class TollGateOptionPlugin extends OptionHandler {
|
|||
player.getInventory().remove(new Item(995, 10));
|
||||
player.getPacketDispatch().sendMessage("You quickly pay the 10 gold toll and go through the gates.");
|
||||
DoorActionHandler.handleAutowalkDoor(player, (GameObject) node);
|
||||
player.getStatisticsManager().getAL_KHARID_GATE_PASSES().incrementAmount();
|
||||
return true;
|
||||
} else {
|
||||
player.getPacketDispatch().sendMessage("You need 10 gold to pass through the gates.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue