Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Thieving from Stalls
- *
- * @author Ethan Reid <PJGH #Rune-Server>
- */
- public class stalls {
- private static int xp;
- private static String Name;
- private static int Value;
- private static int Rate;
- private static int X;
- private static int Y;
- private static void failed(Player c) {
- c.getUpdateFlags().turnPlayerTo(X, Y);
- c.sendAnimation(Animation.create(834));
- NotComplete(c);
- NPC n = c.getCloseNpc(4);
- if (n != null) {
- n.killerId = c.getIndex();
- n.underAttack = true;
- n.forceChat("Hey you, what do you think you're doing!");
- return;
- }
- CallResets(c);
- }
- private static void success(Player c) {
- c.getUpdateFlags().turnPlayerTo(X, Y);
- c.sendAnimation(Animation.create(834));
- c.getSkills().addSkillXP((int) xp, Skills.THIEVING);
- c.getItems().addItem(995, Value);
- Complete(c);
- CallResets(c);
- }
- public static void Start(final Player c ,final int Original, final int objectX, final int objectY, final int face, int EXP,
- int Replace, int requirement, int time, String name, int coins) {
- xp = EXP + Misc.random(400);
- Name = name;
- X = objectX;
- Y = objectY;
- Value = coins;
- if(c.getSkills().getPlayerLevel()[Skills.THIEVING] < requirement) {
- c.getClient().sendMessage("You need a thieving level of at-least"+ requirement +".");
- return;
- }
- if(c.getItems().freeSlots() < 1) {
- c.getClient().sendMessage("You need atleast 1 free inventory slot.");
- return;
- }
- Rate = Misc.random(5);
- if(Rate != 4) {
- ObjectManager.addObject(new GameObject(634, objectX, objectY, 0, face, 10, Original, time));
- success(c);
- } else {
- failed(c);
- }
- }
- private static void resetXP() {
- xp = 0;
- }
- private static void ResetXY() {
- X = 0;
- Y = 0;
- }
- private static void ResetValue() {
- Value = 0;
- }
- private static void Complete(Player c) {
- c.getClient().sendMessage("You successfully thieve from the @blu@"+Name+" Stall@bla@.");
- c.getClient().sendMessage("You receive @blu@"+ xp +"@bla@ EXP.");
- c.getClient().sendMessage("You receive @blu@"+ Value +" Coins@bla@.");
- }
- private static void NotComplete(Player c) {
- c.getClient().sendMessage("You failed to thieve from the @blu@"+Name+" Stall@bla@.");
- c.getClient().sendMessage("Therefor you get@blu@ 0 Exp@bla@.");
- CallResets(c);
- }
- private static void CallResets(Player player) {
- ResetValue();
- resetXP();
- ResetXY();
- }
- private static void GiveTokens(Player player) {
- player.TeleTokens +=1;
- player.getClient().sendMessage("You receive: 1 Tele Token.");
- player.getClient().sendMessage("You now have: "+player.TeleTokens+"");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement