Thread: Making a pvp world.

Results 1 to 3 of 3
  1. #1 Making a pvp world. 
    Banned
    Join Date
    Mar 2011
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    How can i make my world pvp everywhere and then make 1 place safe?
    I don't know how cause i have never done something like this...
    EDIT: Forgot to mention it's PI.
    Reply With Quote  
     

  2. #2  
    Banned
    Join Date
    Mar 2011
    Posts
    12
    Thanks given
    0
    Thanks received
    0
    Rep Power
    0
    bump
    Reply With Quote  
     

  3. #3  
    Donator

    Arithium's Avatar
    Join Date
    May 2010
    Age
    31
    Posts
    4,721
    Thanks given
    199
    Thanks received
    1,256
    Rep Power
    1114
    player.java add
    Code:
    public boolean isInPvP() {
    		if(absX > 1 && absX < 5000 && absY > 1 && absY < 5000) {	
    			return true;
    		}
    		return false;
    	}
    	
    	public boolean safeZone() {
    		if(absX > 2608 && absX < 2617 && absY > 3087 && absY < 3098 || 
    			absX > 2612 && absX < 2621 && absY > 3330 && absY < 3335 ||
    			absX > 2620 && absX < 2621 && absY > 3334 && absY < 3334 ||
    			absX > 2943 && absX < 2927 && absY > 3368 && absY < 3373 ||
    			absX > 2948 && absX < 2949 && absY > 3368 && absY < 3368 ||
    			absX > 3009 && absX < 3018 && absY > 3355 && absY < 3358 ||
    			absX > 2649 && absX < 2655 && absY > 3279 && absY < 3287) {	
    			return true;
    		}
    		return false;
    	}
    Code:
    package server.model.players;
    
    import server.model.players.*;
    import server.Server;
    import server.util.Misc;
    
    public class PvpCombat {
    
    	private Client c;
    	public PvpCombat(Client Client) {
    		this.c = Client;
    	}
    
    
    	public void HighAndLow() {                     
            if (c.combatLevel < 15) {
                int Low = 3;
                int High = c.combatLevel + 12;
                c.getPA().sendFrame126("@yel@"+Low+"@yel@ - @yel@"+High+"", 199);
            }
            if (c.combatLevel > 15 && c.combatLevel < 114) {
                int Low = c.combatLevel - 12;
                int High = c.combatLevel + 12;
                c.getPA().sendFrame126("@yel@"+Low+"@yel@ - @yel@"+High+"", 199);
            }
            if (c.combatLevel > 114) {
                int Low = c.combatLevel - 12;
                int High = 126;
                c.getPA().sendFrame126("@yel@"+Low+"@yel@ - @yel@"+High+"", 199);
            }
     
        }
    		/**
    			Potential Drops
    		**/
    		
    		private static int[][] randomDrops = {{13879,12},{13879,12},{13883,12},{4675,1},{1340,1},{13879,12},{13883,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{13858,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{13883,12},{1079,1},{13879,12},{13883,12},{1351,1},{1319,1},{13879,12},{13883,12},{1333,1},{1359,1},{1704,1},{157,3},{145,2},{175,4},{1379,1},{1381,1},{1393,1},{861,1},{6731,1},{6733,1},{4712,1},{1340,1},{1725,1},{1729,1},{1731,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{1127,1},{391,2},{1093,1},{4087,1},{4585,1},{3140,1},{6737,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{11732,1},
    			{11235,1},{11335,1},{391,2},{11212,40},{4151,1},{1351,1},{1319,1},{1333,1},{1359,1},{6585,1},{1187,1},{13861,1},{1379,1},{1381,1},{1393,1},{861,1},{4675,1}};
    		private static int[][] lowEP = {{13879,12},{13883,12},{4675,1},{1340,1},{13879,12},{13883,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{13858,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1}};
    		private static int[][] medEP = {{13879,12},{13879,12},{13883,12},{4675,1},{1340,1},{13879,12},{13883,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{13858,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{13883,12},{1187,1},{13879,12},{13883,12},{1704,1},{13879,12},{13883,12},{157,3},{145,2},{175,4},{13879,12},{13883,12},{1704,1},{157,3},{145,2},{175,4},{6731,1},{6733,1},{13879,12},{13883,12},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{1305,1},{391,2},{1377,1},{1540,1},{1434,1},{1702,1},{5698,1},{3204,1},{6528,1},{10384,1},{10386,1},{10388,1},{10390,1}};
    		private static int[][] highEP = {{13879,12},{13883,12},{868,50},{13879,12},{13883,12},{1704,1},{157,3},{145,2},{175,4},{995,14700},{995,22500},{4151,1},{6585,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{391,2},{4714,1},{4712,1},{13890,1},{4716,1},{4718,1},{4720,1},{4722,1},{4675,1},{4091,1},{4093,1},
    			{4095,1},{13879,12},{13883,12},{4097,1},{13879,12},{13883,12},{4675,1},{1340,1},{13879,12},{13883,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{13858,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{13879,12},{13883,12},{4101,1},{13879,12},{13883,12},{4103,1},{868,50},{13879,12},{13883,12},{1351,1},{1319,1},{1333,1},{1359,1},{995,14700},{995,22500},{1351,1},{1319,1},{1333,1},{1359,1},{4105,1},{4107,1},{4111,1},{13879,12},{13883,12},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1340,1},{1725,1},{1729,1},{1731,1},{1093,1},{1127,1},{1163,1},{1201,1},
    			{4587,1},{1149,1},{4724,1},{13879,12},{13883,12},{4726,1},{4728,1},{4730,1},{13879,12},{13883,12},{4732,1},{4734,1},{13879,12},{13883,12},{391,2},{4736,1},{4738,1},{4745,1},{1351,1},{1340,1},{13879,12},{13883,12},{1725,1},{1729,1},{1731,1},{1319,1},{1333,1},{13879,12},{13883,12},{1359,1},{4712,1},{4714,1},{4740,1},{4741,1},{4743,1},{4745,1}};
    		private static int[][] mHighEP = {{13879,12},{13879,12},{13883,12},{4675,1},{1340,1},{13879,12},{13883,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{13858,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{13883,12},{3140,1},{13879,12},{13883,12},{1704,1},{157,3},{145,2},{175,4},{391,2},{4585,1},{4087,1},{13902,1},{4151,1},{6585,1},{1187,1},{1305,1},{1377,1},{13879,12},{13883,12},{1540,1},{1434,1},{1702,1},{5698,1},{3204,1},{6528,1},{10384,1},{10386,1},{10388,1},{10390,1},
    			{4714,1},{13879,12},{13883,12},{4712,1},{13879,12},{13883,12},{4716,1},{4718,1},{4720,1},{13879,12},{13883,12},{1351,1},{1319,1},{1333,1},{1359,1},{1340,1},{1379,1},{1381,1},{1393,1},{13879,12},{13883,12},{861,1},{1725,1},{1729,1},{1731,1},{6731,1},{1351,1},{1319,1},{1333,1},{1359,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{4722,1},{4724,1},{13899,1},{4726,1},{4728,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{4730,1},{4732,1},{391,2},{4734,1},
    			{4736,1},{13879,12},{13883,12},{4738,1},{13879,12},{13883,12},{4745,1},{13879,12},{13883,12},{4712,1},{4714,1},{13879,12},{13883,12},{4740,1},{1351,1},{1319,1},{1333,1},{1359,1},{391,2},{4741,1},{995,5815},{995,300000},{1085,1},{1089,1},{1351,1},{4743,1},{4745,1}};
    		private static int[][] xEP = {{13879,12},{13883,12},{868,50},{13879,12},{13883,12},{1099,1},{1165,1},{1351,1},{1319,1},{1333,1},{1359,1},{1149,1},{1185,1},{1704,1},{157,3},{145,2},{175,4},{995,14700},{995,22500},{391,2},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{391,2},{4675,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{4105,1},{391,2},{13873,1},{13879,12},{13883,12},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},
    			{1163,1},{1201,1},{4587,1},{1340,1},{1725,1},{13879,12},{13883,12},{1729,1},{1731,1},{1149,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{13905,1},{391,2},{995,5815},{995,300000},{1085,1},{1089,1},{1351,1},{391,2},{1079,1},{13879,12},{13883,12},{391,2},{13858,1},{391,2},{13861,1},{391,2},{13864,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},{4720,1},{4722,1},{4736,1},{4738,1},{4749,1},{4751,1},{13879,12},{13883,12},{391,2},{13876,1},{391,2},{13870,1},{13879,12},{13883,12},{1127,1},{1093,1},{4087,1},{4585,1},{3140,1},{6737,1},{6731,1},{6733,1},{4712,1},{4714,1},{4716,1},{4718,1},
    			{4720,1},{4722,1},{4736,1},{13879,12},{13883,12},{13879,12},{13883,12},{391,2},{13879,12},{13883,12},{13879,12},{13883,12},{391,2},{13879,12},{13883,12},{4738,1},{13879,12},{13883,12},{1704,1},{157,3},{1379,1},{1381,1},{1393,1},{861,1},{145,2},{13879,12},{13883,12},{175,4},{13879,12},{13883,12},{4749,1},{4751,1},{13879,12},{13883,12},{11732,1},
    			{391,2},{1340,1},{1725,1},{1729,1},{13879,12},{13883,12},{13879,12},{13883,12},{1731,1},{13879,12},{13883,12},{11235,1},{1079,1},{1127,1},{1099,1},{1165,1},{1149,1},{1351,1},{1319,1},{1333,1},{1359,1},{1379,1},{1381,1},{13879,12},{13883,12},{13879,12},{13883,12},{1393,1},{861,1},{1185,1},{391,2},{1093,1},{4087,1},{4585,1},{3140,1},{995,5815},{995,300000},{1085,1},{1089,1},{1340,1},{1725,1},{1729,1},{1731,1},{1351,1},{13879,12},{13883,12},{4675,1},{1340,1},{13879,12},{13883,12},{1725,1},{1729,1},{1351,1},{1319,1},{1333,1},{1359,1},{1731,1},{391,2},{1351,1},{1319,1},{1333,1},{1359,1},{4091,1},{4093,1},{4095,1},{4097,1},{4101,1},{4103,1},{1340,1},{1725,1},{1729,1},{1731,1},{4105,1},{13858,1},{4107,1},{4111,1},{4113,1},{4115,1},{4117,1},{4131,1},{1079,1},{1093,1},{1127,1},{1163,1},{1201,1},{4587,1},{1149,1},{6737,1},{6731,1},{11335,1},{11212,40},{4151,1},{6585,1},{1187,1},{4675,1},{13879,12},{13883,12},{13879,12},{13883,12},{1351,1},{1319,1},{1333,1},{1359,1},{13899,1},{13893,1},
    			{13887,1},{13890,1},{391,2},{1099,1},{1165,1},{13879,12},{13883,12},{13879,12},{13883,12},{1149,1},{1185,1},{13890,1},{391,2},{13896,1},{391,2},{13902,1},{995,5815},{1351,1},{1319,1},{1333,1},{1359,1},{995,300000},{1085,1},{1089,1},{1351,1}};
    		
    	public static void checkPotential(Client c) {
    		if (c.isInPvP()) {
    			if (++c.epDelay == 750) {
    			if(c.getItems().getCarriedWealth() > 300000 || c.getPA().getWearingAmount2() > 200000) {
    				c.earningPotential += 13 + Misc.random(12);
    				if (c.earningPotential > 100) 
    					c.earningPotential = 100;
    				c.sendMessage("Your EP increases to: " + c.earningPotential + ".");
    				} else {
    				c.sendMessage("You must risk more than 300K to increase your EP!");
    				}
    				c.epDelay = 0;
    			}
    		}
    	}
    	
    	public static void checkTeleport(Client c) {
    		if (c.isInPvP())
    			if (c.underAttackBy > 0) {
    				c.earningPotential -= 10 + Misc.random(5);
    				c.sendMessage("You now have "+c.earningPotential+" EP since you teleported in combat!");
    				if (c.earningPotential < 0)
    					c.earningPotential = 0;
    		}
    	}
    	
    	public static void giveBonusDrops(Client c, Client c2) {
            Client o = (Client) Server.playerHandler.players[c.killerId];
    		Client pl = (Client) Server.playerHandler.players[c.killerId];
    		if (c.isInPvP() && c2.isInPvP()) {
    			if(c2.getItems().getCarriedWealth() > 300000 || c2.getPA().getWearingAmount2() > 200000) {
    				if (c.earningPotential >= 0 && c.earningPotential <= 9) {
    					c.earningPotential -= 0 + Misc.random(7);
    					if (c.earningPotential < 0)
    						c.earningPotential = 0;
    						int random = (int)(Math.random() * (lowEP.length - 1));
    						Server.itemHandler.createGroundItem(c, lowEP[random][0], c2.absX, c2.absY, 
    										lowEP[random][1], c.playerId);
    						c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    					}	
    					if (c.earningPotential >= 10 && c.earningPotential <= 24) {
    						c.earningPotential -= 10 + Misc.random(15);
    						if (c.earningPotential < 0)
    							c.earningPotential = 0;
    							int random = (int)(Math.random() * (medEP.length - 1));
    							Server.itemHandler.createGroundItem(c, medEP[random][0], c2.absX, c2.absY, 
    										medEP[random][1], c.playerId);
    							c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    						}	
    					if (c.earningPotential >= 25 && c.earningPotential <= 49) {
    						c.earningPotential -= 20 + Misc.random(15);
    						if (c.earningPotential < 0)
    							c.earningPotential = 0;
    							int random = (int)(Math.random() * (highEP.length - 1));
    							Server.itemHandler.createGroundItem(c, highEP[random][0], c2.absX, c2.absY, 
    										highEP[random][1], c.playerId);
    							c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    					}	
    					if (c.earningPotential >= 50 && c.earningPotential <= 89) {
    						c.earningPotential -= 30 + Misc.random(25);
    						if (c.earningPotential < 0)
    							c.earningPotential = 0;
    							int random = (int)(Math.random() * (mHighEP.length - 1));
    							Server.itemHandler.createGroundItem(c, mHighEP[random][0], c2.absX, c2.absY, 
    														mHighEP[random][1], c.playerId);
    							c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    					}			
    					if (c.earningPotential >= 85) {
    						c.earningPotential -= 40 + Misc.random(50);
    						int random = (int)(Math.random() * (xEP.length - 1));
    						Server.itemHandler.createGroundItem(c, xEP[random][0], c2.absX, c2.absY, 
    														xEP[random][1], c.playerId);
    						c.sendMessage("Your EP decreased to: "+c.earningPotential+".");
    					}
    				}
    			}
    		}
    	}
    to server.model.players folder. client.java replace the walkableInterface for inWild with
    Code:
     if(isInPvP() && !safeZone()) {
                int modY = absY > 6400 ?  absY - 6400 : absY;
                wildLevel = 12;
                headIconPk = 0;
                getPA().walkableInterface(197);
    			PvpCombat.checkPotential(this);
    			//getPA().walkableInterface(6673);
    			getPA().sendFrame126("				            @or1@Current EP: " + earningPotential + "", 6570);
    				getPA().sendFrame126("", 6664);
    				getPA().sendFrame126("", 6572);
    				getPA().sendFrame126("", 6665);
                getPA().showOption(3, 0, "Attack", 1);
                if(Config.SINGLE_AND_MULTI_ZONES) {
                    if(inMulti()) {
                        getPvP().HighAndLow();
                    } else {
                        getPvP().HighAndLow();
                    }
                } else {
                    getPA().multiWay(-1);
                    getPvP().HighAndLow();
    			}
    		} else if(safeZone()){
    			getPA().walkableInterface(197);
    			getPA().showOption(3, 0, "Null", 1);
    			if(Config.SINGLE_AND_MULTI_ZONES) {
    				if(inMulti()) {
    					getPA().sendFrame126("@gre@SafeZone", 199);
    				} else {
    					getPA().sendFrame126("@gre@SafeZone", 199);
    				}
    			} else {
    				getPA().multiWay(-1);
    				getPA().sendFrame126("@gre@SafeZone", 199);
    			}
    at the top add
    Code:
    private PvpCombat pvpCombat = new PvpCombat(this);
    with the others at the bottom add
    Code:
    public PvpCombat getPvP() {
    		return pvpCombat;
    	}
    itemassistant.java add
    Code:
    public void dropAllItemsPVP() {
    		Client o = (Client) Server.playerHandler.players[c.killerId];
    				PvpCombat.giveBonusDrops(o, c);
    	}
    import
    Code:
    import server.model.players.PvpCombat;
    in client.java and itemassistant.java
    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. Replies: 18
    Last Post: 04-12-2011, 10:32 PM
  2. Replies: 8
    Last Post: 03-01-2011, 09:44 PM
  3. Replies: 17
    Last Post: 01-07-2010, 11:35 PM
  4. Making Whole World Wildy.
    By 'Craig in forum Help
    Replies: 6
    Last Post: 11-10-2008, 12:59 PM
  5. Making world full not apply for mods+admin rep++
    By xx k03d xx in forum Tutorials
    Replies: 4
    Last Post: 06-15-2008, 02:04 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
  •