Jump to content

durky

Member
  • Content count

    8
  • Joined

  • Last visited

  1. https://www.youtube.com/watch?v=gDOorkFCxzA Website - www.runeunity.com Client - www.runeunity.com/unity.jar
  2. I did not write this, But i used it in mine, Modified it slightly to work with my servers methods. flower poker. package RuneUnity.model.players; import RuneUnity.Server; import RuneUnity.model.players.Client; import RuneUnity.event.CycleEventHandler; import RuneUnity.event.CycleEvent; import RuneUnity.event.CycleEventContainer; import RuneUnity.clip.region.Region; /** * Class MithrilSeeds * Handles Mithril Seeds * @author I'mAGeek * START: 8:01 AM 3/22/2012 * FINISH: 8:20 AM 3/22/2012 */ public class MithrilSeeds { public static int rFlower[] = {2460,2462,2464,2466,2468,2470,2472,2474,2476}; public static int flower() { return rFlower[(int)(Math.random()*rFlower.length)]; } public static void plantMithrilSeed(Client c) { final int[] coords = new int[2]; coords[0] = c.absX; coords[1] = c.absY; if (c.getItems().playerHasItem(299,1)) { c.getItems().deleteItem(299, 1); c.getPA().addSkillXP(2500, 19); c.startAnimation(827); Server.objectHandler.createAnObject(c, Client.randomFlower(), coords[0], coords[1]); c.getDH().sendDialogues(22, -1); } } public static void processFlower(Client c) { final int[] coords = new int[2]; coords[0] = c.absX; coords[1] = c.absY; Server.objectHandler.createAnObject(c, -1, coords[0], coords[1]); Server.objectHandler.createAnObject(c, Client.randomFlower(), coords[0], coords[1]); if (Region.getClipping(c.getX() - 1, c.getY(), c.heightLevel, -1, 0)) { c.getPA().walkTo(-1, 0); } else if (Region.getClipping(c.getX() + 1, c.getY(), c.heightLevel, 1, 0)) { c.getPA().walkTo(1, 0); } else if (Region.getClipping(c.getX(), c.getY() - 1, c.heightLevel, 0, -1)) { c.getPA().walkTo(0, -1); } else if (Region.getClipping(c.getX(), c.getY() + 1, c.heightLevel, 0, 1)) { c.getPA().walkTo(0, 1); } c.turnPlayerTo(coords[0] + 1, coords[1]); c.sendMessage("You plant a flower!"); CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() { @Override public void execute(CycleEventContainer container) { for (int j = 0; j < PlayerHandler.players.length; j++) { if (PlayerHandler.players[j] != null) { Client c = (Client)PlayerHandler.players[j]; Server.objectHandler.createAnObject(c, -1, coords[0], coords[1]); container.stop(); } } } @Override public void stop() { } }, 100); } public static void pickupFlowers(Client c) { final int[] coords = new int[2]; coords[0] = c.absX; coords[1] = c.absY; Server.objectHandler.createAnObject(c, -1, coords[0], coords[1]); c.getItems().addItem(flower(), 1); } } Dicing package RuneUnity.model.content; import RuneUnity.event.Event; import RuneUnity.event.EventContainer; import RuneUnity.event.EventManager; import RuneUnity.model.items.Item; import RuneUnity.model.players.Client; import RuneUnity.model.players.dialogue.DialogueAction; import RuneUnity.model.players.dialogue.DialogueContainer; import RuneUnity.net.ServerStatus; import RuneUnity.util.Misc; import RuneUnity.world.clanchat.ClanHandler; /** * @author Jayden */ public class Dicing { private static Dicing dicing = new Dicing(); public static Dicing getDicing() { return dicing; } private enum Dice { REGULAR(15084, -1, -1), DIE_4_SIDES(15100, 4, 2069), DIE_6_SIDES(15086, 6, 2072), DICE_6_SIDES(15088, 12, 2074), DIE_8_SIDES(15090, 8, 2071), DIE_10_SIDES(15092, 10, 2070), DIE_12_SIDES(15094, 12, 2073), DIE_20_SIDES(15096, 20, 2068), DICE_UP_TO_100(15098, 100, 2075); private int id; private int sides; private int graphic; private Dice(int id, int sides, int graphic) { this.id = id; this.sides = sides; this.graphic = graphic; } public int getId() { return id; } public int getSides() { return sides; } public int getGraphic() { return graphic; } public static Dice get(int id) { for (Dice die : Dice.values()) { if (die.getId() == id) { return die; } } return null; } } public enum RollType { Private, Clan } public Dicing() { } public boolean hasDiceBag(Client c) { for (Item i : c.inventory) { for (Dice die : Dice.values()) { if (die.getId() == i.getId()) { return true; } } } return false; } public boolean isDiceBag(int itemId) { for (Dice die : Dice.values()) { if (die.getId() == itemId) { return true; } } return false; } public void showDiceSelection(final Client c, final int itemId) { DialogueContainer.CreateDialogue(c, new DialogueAction() { @Override public void execute(DialogueContainer container) { if (!c.getItems().playerHasItem(itemId)) { return; } switch (container.getOptionId()) { case 1: c.getItems().deleteItem(itemId, 1); if (container.getCurrentDialogueId() == 1) { c.getItems().addItem(15086, 1); // 6-sided die } else if (container.getCurrentDialogueId() == 2) { c.getItems().addItem(15092, 1); // 10-sided die } break; case 2: c.getItems().deleteItem(itemId, 1); if (container.getCurrentDialogueId() == 1) { c.getItems().addItem(15088, 1); // two 6-sided die } else if (container.getCurrentDialogueId() == 2) { c.getItems().addItem(15094, 1); // 12-sided die } break; case 3: c.getItems().deleteItem(itemId, 1); if (container.getCurrentDialogueId() == 1) { c.getItems().addItem(15100, 1); // 4-sided die } else if (container.getCurrentDialogueId() == 2) { c.getItems().addItem(15096, 1); // 20-sided die } break; case 4: c.getItems().deleteItem(itemId, 1); if (container.getCurrentDialogueId() == 1) { c.getItems().addItem(15090, 1); // 8-sided die } else if (container.getCurrentDialogueId() == 2) { c.getItems().addItem(15098, 1); // two 10-sided dice } break; case 5: if (container.getCurrentDialogueId() == 1) { container.showOptions(2); } else if (container.getCurrentDialogueId() == 2) { container.showOptions(1); } break; } } @Override public void preExecution(DialogueContainer container) { container.addAdditionalOptions("One 10-sided die", "One 12-sided die", "One 20-sided die", "Two 10-sided dice for 1-100", "Back..."); } }, "One 6-sided die", "Two 6-sided dice", "One 4-sided die", "One 8-sided die", "More..."); } public void rollDice(final Client c, final int itemId, final RollType type) { final Dice die = Dice.get(itemId); if (die == null || c.performingAction || !hasDiceBag(c)) { return; } if (type == RollType.Clan && c.clanId == -1) { c.sendMessage("You are not currently in a channel."); return; } c.sendMessage("Rolling..."); c.forceAnim(11900); c.turnPlayerTo(c.getX(), c.getY() - 1); c.getPA().createPlayersStillGfx(die.getGraphic(), c.getX(), (c.getY() - 1), 0, 0); c.performingAction = true; EventManager.getSingleton().addEvent(new Event() { @Override public void execute(EventContainer container) { int random = Misc.random(1, die.getSides()); if (type == RollType.Private) { c.sendMessage("You rolled @[email protected]" + random + "@[email protected] on the " + c.getItems().getItemName(itemId).toLowerCase() + "."); } else if (type == RollType.Clan) { String message = String.format("Clan chat member @[email protected]%[email protected]@ rolled @[email protected]%[email protected]@ on the %s.", c.formattedName, random, c.getItems().getItemName(itemId).toLowerCase()); ClanHandler.getClanHandler().serverMessageToClan(message, c.clanId); if (c.clanId == ClanHandler.WORLD_CHAT) { ServerStatus.getServerStatus().queueWorldChatMessageUpdate(message); } } c.performingAction = false; container.stop(); } }, 1600); } }
  3. Everything for highscores is already coded in to the server and added on website, I just can't get it to actually display the results, i think its something to do with Mysql. Voting needs coded in. trying to stay on budget send me some decent offers. server is 24/7 just getting ready to do official release but, can't get highscores or voting to work. add my skype, Jdurky
  4. Thanks for the source, I'm going to put a lot of work in to it. [quote name='JoezMC']Hi, I can't get the cache file correct like where do I put it for the client to run? [COLOR="silver"][SIZE=1]- - - Updated - - -[/SIZE][/COLOR] please help me fix this[/QUOTE] read the error it will tell you where to put the cache. should be place under c -> program files > users > (name)> right there.
×