Revert "Added new player commands"

This reverts commit 938b078592.
This commit is contained in:
Ceikry 2020-03-28 18:09:02 -05:00
parent 33c43b8a6a
commit 480c19dbe3

View file

@ -1,43 +1,26 @@
package plugin.command;
import org.crandor.ServerConstants;
import org.crandor.cache.def.impl.ItemDefinition;
import org.crandor.cache.def.impl.NPCDefinition;
import org.crandor.game.component.Component;
import org.crandor.game.content.skill.Skills;
import org.crandor.game.interaction.SpecialGroundInteraction;
import org.crandor.game.interaction.SpecialGroundItems;
import org.crandor.game.node.entity.npc.NPC;
import org.crandor.game.node.entity.npc.drop.NPCDropTables;
import org.crandor.game.node.entity.player.Player;
import org.crandor.game.node.entity.player.info.Rights;
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.quest.Quest;
import org.crandor.game.node.entity.player.link.quest.QuestRepository;
import org.crandor.game.node.item.ChanceItem;
import org.crandor.game.system.command.CommandPlugin;
import org.crandor.game.system.command.CommandSet;
import org.crandor.game.system.communication.ClanRepository;
import org.crandor.game.system.communication.CommunicationInfo;
import org.crandor.game.system.mysql.SQLManager;
import org.crandor.game.world.GameWorld;
import org.crandor.game.world.map.RegionManager;
import org.crandor.game.world.repository.Repository;
import org.crandor.game.world.update.flag.context.Animation;
import org.crandor.net.amsc.WorldCommunicator;
import org.crandor.plugin.InitializablePlugin;
import org.crandor.plugin.Plugin;
import org.crandor.tools.RandomFunction;
import org.crandor.tools.StringUtils;
import plugin.zone.GrandExchangeZone.CreditStore;
import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Random;
/**
* Handles a player command.
* @author Vexia
@ -211,20 +194,7 @@ public final class PlayerCommandPlugin extends CommandPlugin {
case "donate":
sendDonationInfo(player);
return true;
case "roll":
rollSkill(player);
return true;
case "drops":
if(arguments.length > 0) {
int npcid = toInteger(arguments[1]);
getDrops(player, npcid);
} else {
player.getPacketDispatch().sendMessage("Syntax: ::getdrops id");
}
return true;
case "npcs":
getNPCs(player);
return true;
case "reply":
if(player.getInterfaceManager().isOpened()){
player.sendMessage("<col=e74c3c>Please finish what you're doing first.");
@ -250,89 +220,6 @@ public final class PlayerCommandPlugin extends CommandPlugin {
return false;
}
/**
* ::npcs lists NPCs in the area and their IDs
* @author ceik
*/
public final void getNPCs(Player player){
player.getInterfaceManager().close();
final List<NPC> npcs = RegionManager.getLocalNpcs(player);
for (int i = 0; i < 311; i++) {
player.getPacketDispatch().sendString("", 275, i);
}
player.getPacketDispatch().sendString("<col=ecf0f1>Nearby NPCs</col>", 275, 2);
int lineid = 11;
for(NPC n : npcs){
player.getPacketDispatch().sendString("<col=05edce>[" + n.getId() + "]</col> " + "<col=f5fffe>" + n.getName() + "</col>",275,lineid++);
}
player.getInterfaceManager().open(new Component(275));
}
/**
* ::drops lists the drops for a specific NPC ID
* @author ceik
*/
public final void getDrops(Player player, int npc){
player.getInterfaceManager().close();
for (int i = 0; i < 311; i++) {
player.getPacketDispatch().sendString("", 275, i);
}
int lineid = 11;
List<ChanceItem> drops = NPCDefinition.forId(npc).getDropTables().getMainTable();
ListIterator drop = drops.listIterator();
player.getPacketDispatch().sendString("<col=ecf0f1>" + NPCDefinition.forId(npc).getName() + " (Level " + NPCDefinition.forId(npc).getCombatLevel() + ")</col>", 275, 2);
while(drop.hasNext()){
ChanceItem current = (ChanceItem) drop.next();
String rarity = "";
switch(current.getDropFrequency()){
case UNCOMMON:
rarity = "<col=edce05>UNCOMMON</col>";
break;
case RARE:
rarity = "<col=ff6b08>RARE</col>";
break;
case VERY_RARE:
rarity = "<col=ff0000>VERY RARE</col>";
break;
case COMMON:
rarity = "<col=04c91e>COMMON</col>";
break;
}
player.getPacketDispatch().sendString("(" + rarity + ") <col=f5fffe>" + ((current.getMinimumAmount() - current.getMaximumAmount() != 0) ? (current.getMinimumAmount() + "-" + current.getMaximumAmount()) : "") + " " +ItemDefinition.forId(current.getId()).getName() + "</col>", 275, lineid++);
}
player.getInterfaceManager().open(new Component(275));
}
/**
* ::roll command
* @author ceik
*/
public final void rollSkill(Player player){
boolean rareEventChance = RandomFunction.random(100) == 54;
if(rareEventChance){
int rareChoice = RandomFunction.random(2,5);
if(rareChoice % 5 == 0){
player.sendChat("Oh god! Somebody help me!");
player.getAnimator().reset();
player.getAnimator().forceAnimation(new Animation(3123));
return;
}
if(rareChoice % 2 == 0){
player.sendChat("Yibbly jibbly dibbly nibbly doo dah");
return;
}
if(rareChoice % 3 == 0){
player.sendChat("Oh god! Somebody help me!");
player.getAnimator().reset();
player.getAnimator().forceAnimation(new Animation(92));
return;
}
}
int skill = RandomFunction.random(0,23);
player.sendChat("I think I should train " + Skills.SKILL_NAME[skill]);
}
/**
* Sends commands.
* @param player the player.
@ -370,11 +257,6 @@ public final class PlayerCommandPlugin extends CommandPlugin {
player.getPacketDispatch().sendString("<col=2c3e50>Remove your bank pin.", 275, lineId++);
player.getPacketDispatch().sendString("<col=ecf0f1>::bankresettabs", 275, lineId++);
player.getPacketDispatch().sendString("<col=2c3e50>Reset all of your bank tabs.", 275, lineId++);
player.getPacketDispatch().sendString("<col=ecf0f1>::stats", 275, lineId++);
player.getPacketDispatch().sendString("<col=2c3e50>View a player's stats.", 275, lineId++);
player.getPacketDispatch().sendString("<col=ecf0f1>::roll", 275, lineId++);
player.getPacketDispatch().sendString("<col=2c3e50>Picks a skill to train for you, and perhaps more?", 275, lineId++);
}
/**