Thread: 667 Warriors Guild

Results 1 to 8 of 8
  1. #1 667 Warriors Guild 
    Registered Member
    Join Date
    Mar 2010
    Age
    33
    Posts
    703
    Thanks given
    237
    Thanks received
    70
    Rep Power
    32
    Seems to work fine. Most probs work on 718 as the 667 is matrix.
    Yes I know I could of used the controller system but screw that it sucks lol
    Was making a 667 but its been put on hold due to being busy so thought id share.

    Figure out how to use the class. All methods you will need are in here.
    Code:
    package com.rs.game.player.content;
    
    import com.rs.game.Animation;
    import com.rs.game.ForceTalk;
    import com.rs.game.World;
    import com.rs.game.WorldTile;
    import com.rs.game.item.Item;
    import com.rs.game.npc.NPC;
    import com.rs.game.player.Player;
    import com.rs.game.tasks.WorldTask;
    import com.rs.game.tasks.WorldTasksManager;
    import com.rs.utils.Misc;
    
    public class WarriorsGuild {
    	/*
    	 * 100% crezzy
    	 */
    	public static String armUsed;
    	public static NPC npc;
    	private static int tokenAmount;
    
    	public static int armToSpawn() {
    		if (armUsed == null)
    			return 0;
    		switch (armUsed) {
    		case "RUNE":
    			tokenAmount = 30;
    			return 4284;
    		case "ADDY":
    			tokenAmount = 25;
    			return 4283;
    		case "MITH":
    			tokenAmount = 20;
    			return 4282;
    		case "BLACK":
    			tokenAmount = 15;
    			return 4281;
    		case "STEEL":
    			tokenAmount = 10;
    			return 4280;
    		default:
    			return 0;
    		}
    	}
    
    	/*
    	 * 1 should = a 10% chance of getting a defender
    	 */
    	public void cyclopsDeath(Player killer, NPC cyclops) {
    		if(killer.getInventory().containsItem(20072, 1))
    			return;
    		int random = Misc.random(10);
    		Item defToDrop = (getDefString(killer) == "Dragon" ? new Item(20072)
    				: new Item(getWhichDef(killer) + 1));
    		if (random <= 199)
    			if (inClopsRoom(killer)) {
    				World.addGroundItem(defToDrop, cyclops.getLastWorldTile(),
    						killer, false, 1, false);
    				killer.sm("You have got the "
    						+ getDefString(killer)
    						+ " Defender within this drop. Please discard your old defender.");
    			} else
    				return;
    		else
    			return;
    	}
    
    	private String getDefString(Player p) {
    		if (p.getInventory().containsItem(8844, 1))
    			return "Steel";
    		else if (p.getInventory().containsItem(8846, 1))
    			return "Black";
    		else if (p.getInventory().containsItem(8847, 1))
    			return "Mithril";
    		else if (p.getInventory().containsItem(8848, 1))
    			return "Addy";
    		else if (p.getInventory().containsItem(8849, 1))
    			return "Rune";
    		else if (p.getInventory().containsItem(8850, 1)
    				|| p.getInventory().containsItem(20072, 1))
    			return "Dragon";
    		else
    			return "Iron";
    	}
    
    	private int getWhichDef(Player p) {
    		switch (getDefString(p)) {
    		case "Iron":
    			return 8844;
    		case "Steel":
    			return 8845;
    		case "Black":
    			return 8846;
    		case "Mithril":
    			return 8847;
    		case "Addy":
    			return 8848;
    		case "Rune":
    			return 8849;
    		case "dragon":
    			return 20072;
    		default:
    			return 0;
    		}
    	}
    
    	private static boolean inClopsRoom(Player p) {
    		return (p.getX() >= 2847 && p.getX() <= 2876 && p.getY() >= 3534
    				&& p.getY() <= 3556 || p.getX() >= 2838 && p.getX() <= 2847
    				&& p.getY() >= 3543 && p.getY() <= 3556) ? true : false;
    	}
    
    	private WorldTask CyclopsTask;
    
    	private int ticked = 0;
    
    	private void armTick(final Player p, final NPC n) {
    		WorldTasksManager.schedule(new WorldTask() {
    			@Override
    			public void run() {
    				if (!(p.getX() >= 2849 && p.getX() <= 2861 && p.getY() >= 3530 && p
    						.getY() <= 3541) || !World.getPlayers().contains(p)) {
    					p.armSpawned = false;
    					n.sendDeath(n);
    					this.stop();
    				} else if (p.getX() >= 2849 && p.getX() <= 2861
    						&& p.getY() >= 3530 && p.getY() <= 3541 && n.isDead()) {
    					deleteArmAdd(p, true);
    					armUsed = null;
    					this.stop();
    				}
    			}
    		}, 0, 1);
    	}
    
    	private boolean canSpawn(Player p) {
    		if (p.armSpawned) {
    			p.sm("You need to kill the current Npc before spawning another!");
    			return false;
    		}
    		if (armUsed == "RUNE" || armUsed == "ADDY" || armUsed == "MITH"
    				|| armUsed == "BLACK" || armUsed == "STEEL")
    			return true;
    		else
    			return false;
    	}
    
    	public void cyclopDoorEvent(final Player player) {
    		player.sm(inClopsRoom(player) ? "You left the Cyclops chamber."
    				: (player.getInventory().compairItemAmount(8851, 100)) ? "You need atleast 100 tokens in your inventory to enter into the Cyclops Chamber!"
    						: "You enter the Cyclops chamber."
    								+ (getDefString(player) != "" ? " The Cyclops are currently dropping "
    										+ getDefString(player) + " Defenders."
    										: ""));
    		if (player.getInventory().compairItemAmount(8851, 100)
    				&& !inClopsRoom(player))
    			return;
    		else {
    			player.setNextWorldTile(new WorldTile(player.getX()
    					+ (inClopsRoom(player) ? -1 : +2), player.getY(), player
    					.getPlane()));
    			if (!inClopsRoom(player))
    				WorldTasksManager.schedule(new WorldTask() {
    					@Override
    					public void run() {
    						if (!World.getPlayers().contains(player))
    							this.stop();
    						player.getInventory().deleteItem(8851, 10);
    						CyclopsTask = this;
    						locationCheck(player);
    						if (!player.getInventory().containsItem(8851, 10)
    								&& inClopsRoom(player)) {
    							player.setNextWorldTile(new WorldTile(2843, 3536, 2));
    							player.sm("All your tokens in your inventory have been used up.");
    							locationCheck(player);
    							this.stop();
    							return;
    						}
    					}
    				}, 0, 10);
    		}
    	}
    
    	private void deleteAddArm(Player p, int i1, int i2, int i3, boolean adding) {
    		int[] items = { i1, i2, i3 };
    		for (int i = 0; i < items.length; i++)
    			if (!adding)
    				p.getInventory().deleteItem(items[i], 1);
    			else {
    				p.getInventory().addItem(items[i], 1);
    				p.armSpawned = false;
    			}
    	}
    
    	private void deleteArmAdd(Player p, boolean adding) {
    		if (adding)
    			p.getInventory().addItem(8851, tokenAmount);
    		if (armUsed != null)
    			switch (armUsed) {
    			case "RUNE":
    				deleteAddArm(p, 1079, 1163, 1127, adding ? true : false);
    				break;
    			case "STEEL":
    				deleteAddArm(p, 1069, 1119, 1157, adding ? true : false);
    				break;
    			case "BLACK":
    				deleteAddArm(p, 1077, 1125, 1165, adding ? true : false);
    				break;
    			case "MITH":
    				deleteAddArm(p, 1071, 1121, 1159, adding ? true : false);
    				break;
    			case "ADDY":
    				deleteAddArm(p, 1073, 1123, 1161, adding ? true : false);
    				break;
    			}
    	}
    
    	private boolean hasItems(Player p, int i1, int i2, int i3, String arm) {
    		if (!p.getInventory().containsItem(i1, 1)
    				|| !p.getInventory().containsItem(i2, 1)
    				|| !p.getInventory().containsItem(i3, 1)) {
    			p.sm("You need all of the pieces of " + arm + " Armour.");
    			return false;
    		} else
    			return true;
    
    	}
    
    	private void locationCheck(final Player player) {
    		WorldTasksManager.schedule(new WorldTask() {
    			@Override
    			public void run() {
    				if (!inClopsRoom(player))
    					if (ticked > 20) {
    						ticked++;
    						this.stop();
    						locationCheck(player);
    					} else {
    						CyclopsTask.stop();
    						this.stop();
    					}
    			}
    		}, 0, 20);
    		return;
    	}
    
    	public void npcSpawnStuff(NPC n) {
    		npc = n;
    		npc.setNextForceTalk(new ForceTalk("I'm Alive!"));
    		npc.setNextAnimation(new Animation(1056, 1));
    		npc.setForceMultiArea(false);
    	}
    
    	public void setString(Player p, int itemId) {
    		if (itemId == 1079 || itemId == 1163 || itemId == 1127)
    			if (hasItems(p, 1079, 1163, 1127, "Rune"))
    				armUsed = "RUNE";
    			else if (itemId == 1069 || itemId == 1119 || itemId == 1157)
    				if (hasItems(p, 1069, 1119, 1157, "Steel"))
    					armUsed = "STEEL";
    				else if (itemId == 1077 || itemId == 1125 || itemId == 1165)
    					if (hasItems(p, 1077, 1125, 1065, "Black"))
    						armUsed = "BLACK";
    					else if (itemId == 1071 || itemId == 1121 || itemId == 1159)
    						if (hasItems(p, 1071, 1121, 1159, "Mithril"))
    							armUsed = "MITH";
    						else if (itemId == 1073 || itemId == 1123
    								|| itemId == 1161)
    							if (hasItems(p, 1073, 1123, 1161, "Addy"))
    								armUsed = "ADDY";
    	}
    
    	public void spawnArm(Player p, int x, int y) {
    		if (canSpawn(p)) {
    			World.spawnNPC(armToSpawn(), new WorldTile(x, y, p.getPlane()), -1,
    					true, true);
    			p.armSpawned = true;
    			deleteArmAdd(p, false);
    			p.addWalkSteps(p.getX() == 2851 ? 2851 : 2857, 3537, 5, true);
    			npc.setTarget(p);
    			p.getHintIconsManager().addHintIcon(npc, 0, -1, false);
    			armTick(p, npc);
    		}
    	}
    }
    Why do mods give infractions? No fker cares if they get banned from an RSPS forums. At the end of the day its a Runescape private server forums full of noobs and it takes 30 secs to make an new account.
    Reply With Quote  
     

  2. #2  
    Registered Member
    medic's Avatar
    Join Date
    Sep 2013
    Posts
    1,581
    Thanks given
    821
    Thanks received
    560
    Rep Power
    1129
    nicee
    Reply With Quote  
     

  3. #3  
    Extreme Donator

    TaterMater's Avatar
    Join Date
    Aug 2011
    Posts
    1,511
    Thanks given
    218
    Thanks received
    375
    Rep Power
    121
    Warriors Guild consists of many more activities then just cyclops and animated armour.

    Reply With Quote  
     

  4. #4  
    Registered Member
    Join Date
    Mar 2010
    Age
    33
    Posts
    703
    Thanks given
    237
    Thanks received
    70
    Rep Power
    32
    Quote Originally Posted by TaterMater View Post
    Warriors Guild consists of many more activities then just cyclops and animated armour.
    Like what lol? If your talking about them other bull s**t things there then you've got another thing coming if I'm wasting my time coding them lol.....
    Anyway what am I supposed to call it if not warriors guild lol?
    Why do mods give infractions? No fker cares if they get banned from an RSPS forums. At the end of the day its a Runescape private server forums full of noobs and it takes 30 secs to make an new account.
    Reply With Quote  
     

  5. #5  
    Extreme Donator

    TaterMater's Avatar
    Join Date
    Aug 2011
    Posts
    1,511
    Thanks given
    218
    Thanks received
    375
    Rep Power
    121
    Also you should change your shitty code to the original Matrx, Example:

    Code:
    p.sm
    changed to:

    Code:
    p.getPackets().sendGameMessage
    Just makes it easier for noobs.

    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Mar 2010
    Age
    33
    Posts
    703
    Thanks given
    237
    Thanks received
    70
    Rep Power
    32
    Quote Originally Posted by TaterMater View Post
    Also you should change your shitty code to the original Matrx, Example:

    Code:
    p.sm
    changed to:

    Code:
    p.getPackets().sendGameMessage
    Just makes it easier for noobs.
    Its not a tutorial so I don't care for noobs and the p.sm method was already in the source? So get off your high horse Mr I used to own TizenX (what ever the hell that is) so I put it in my sig that it got shut down by jagex << Nobody cares lol....

    If you got a problem with the code then say something better than p.sm lmao... and btw I never claimed the code to be good, just seems to work fine. Tbh it was just a rough copy, raw code if you will ready to be tidied up.
    Why do mods give infractions? No fker cares if they get banned from an RSPS forums. At the end of the day its a Runescape private server forums full of noobs and it takes 30 secs to make an new account.
    Reply With Quote  
     

  7. #7  
    Registered Member
    Velocity's Avatar
    Join Date
    Jan 2009
    Age
    28
    Posts
    2,028
    Thanks given
    1,013
    Thanks received
    2,376
    Rep Power
    4112
    • Use an enum for the armour type
    • Use .equals instead of == for string comparison, you'll understand why later
    • Java ships with an API that has a Rectangle class. Rectangle.contains(Point p) to avoid burning them eyes
    • The "return;" statement in locationCheck() makes no sense
    • Work on your bracket placing, as it's unpleasing to look at.


    Few points of constructive criticism.
    xxxxxxx
    Reply With Quote  
     

  8. Thankful user:


  9. #8  
    Registered Member
    Join Date
    Mar 2010
    Age
    33
    Posts
    703
    Thanks given
    237
    Thanks received
    70
    Rep Power
    32
    Quote Originally Posted by Velocity View Post
    • Use an enum for the armour type
    • Use .equals instead of == for string comparison, you'll understand why later
    • Java ships with an API that has a Rectangle class. Rectangle.contains(Point p) to avoid burning them eyes
    • The "return;" statement in locationCheck() makes no sense
    • Work on your bracket placing, as it's unpleasing to look at.


    Few points of constructive criticism.
    Did think about using an enum for armour type but didn't bother for some reason. (Most probs would of done on final draft)
    Yeah I should of used equals, dunno why I didn't lol
    Not heard of that rectangle class, will look into it thanks.
    Yeah hat return doesn't make no sense. Only now noticed, good spot lol.
    The bracket placing is eclipse. I just use auto format (right click, correct indentation) Lazy I know but don't really care for what it looks like lol.

    Thanks for the feedback, constructive criticism is always good. Will be looking into the rectangle class.
    Why do mods give infractions? No fker cares if they get banned from an RSPS forums. At the end of the day its a Runescape private server forums full of noobs and it takes 30 secs to make an new account.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Warriors guild 667 Event help
    By cr3zzy in forum Help
    Replies: 1
    Last Post: 11-16-2013, 06:24 PM
  2. Warriors guild 667 Event help
    By cr3zzy in forum Tutorials
    Replies: 2
    Last Post: 11-16-2013, 01:38 AM
  3. 667/*** Warrior Guild
    By Sam' in forum Tutorials
    Replies: 9
    Last Post: 06-25-2012, 10:38 PM
  4. Warrior Guild
    By atrum in forum Requests
    Replies: 0
    Last Post: 08-26-2008, 03:11 PM
  5. Warrior Guild MiniGame - Untested
    By Cold Poet in forum Tutorials
    Replies: 31
    Last Post: 05-26-2008, 04:24 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •