Thread: 2006Scape - Bringing back the good ol' days

Page 51 of 446 FirstFirst ... 41495051525361101151 ... LastLast
Results 501 to 510 of 4457
  1. #501  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Quote Originally Posted by Hi I'm Java View Post
    More content that was already in the base.

    Can your developers not code or something?

    Don't tell me its "redone" from its "shitty content"

    PJA was done by Brown, thing1, and scully, any of who are much superior programmers than 'Jimmy, much less you.
    They may know more than me but I know how to do it right. The code I've written looks x50 better then what was originally there.
     

  2. Thankful user:


  3. #502  
    Banned
    Join Date
    May 2011
    Posts
    244
    Thanks given
    56
    Thanks received
    118
    Rep Power
    0
    Quote Originally Posted by Vault View Post
    New Update!

    Cooking has been worked on and is almost 99% working. All that is needed to be added are items besides fish, as well as using items on each other to make other foods (flour + water = dough = bread). Check out the video on our youtube channel! Please make sure to discuss this update on our forums, as well as registering on the forums.

    Cooking -
    How is this an update when the server you're using already came with it?

    And, if Jimmy re-wrote the code, perhaps he can provide proof that he did so. Otherwise, it looks like this is another bogus update.

    I'm not trying to flame you, but it seems that way.
     

  4. #503  
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    Quote Originally Posted by 474 Server Improv View Post
    How is this an update when the server you're using already came with it?

    And, if Jimmy re-wrote the code, perhaps he can provide proof that he did so. Otherwise, it looks like this is another bogus update.

    I'm not trying to flame you, but it seems that way.
    Yes, 'Jimmy did re-code it. You can talk with him.
     

  5. #504  
    Banned

    Join Date
    Dec 2008
    Posts
    2,097
    Thanks given
    1,419
    Thanks received
    732
    Rep Power
    0
    Alright, I'll release a little bit of the code just so everyone will shutup about how we're not even doing anything.

    Code:
    package org.hyperion.rs2.action.impl;
    
    import java.util.Random;
    
    import org.hyperion.rs2.ScriptManager;
    import org.hyperion.rs2.action.Action;
    import org.hyperion.rs2.content.quest.impl.TutorialIsland;
    import org.hyperion.rs2.content.skills.news.Cooking.CookingItem;
    import org.hyperion.rs2.content.skills.news.Cooking.HeatSource;
    import org.hyperion.rs2.model.Player;
    import org.hyperion.rs2.model.Skills;
    
    /**
     * 
     * @author Jimmy
     * @author Clifton - Success rate formula
     */
    public class CookingAction extends Action {
    
    	private Player player;
    	private HeatSource heatSource;
    	private CookingItem cookingItem;
    	private int productionAmount;
    	private int fourTickDelay;
    
    	public CookingAction(Player player, HeatSource heatSource, CookingItem cookingItem, int productionAmount) {
    		super(player, 600);
    		this.player = player;
    		this.heatSource = heatSource;
    		this.cookingItem = cookingItem;
    		this.productionAmount = productionAmount;
    		player.playAnimation(heatSource.getAnimation());
    		player.getAttributes().put("cooking", null);
    		player.getActionSender().sendCloseInterface();
    	}
    
    	public CookingAction(Player player, HeatSource heatSource, CookingItem cookingItem) {
    		super(player, 600);
    		this.player = player;
    		this.heatSource = heatSource;
    		this.cookingItem = cookingItem;
    		this.productionAmount = 1;
    		player.playAnimation(heatSource.getAnimation());
    		player.getAttributes().put("cooking", null);
    	}
    
    	private boolean isSuccessful() {
    		double burnBonus = 0.0;
    		if(heatSource == HeatSource.STOVE) 
    			burnBonus = 3.0;
    		double burn_chance = (45.0 - burnBonus);
    		double cook_level = (double) player.getSkills().getLevel(Skills.COOKING);
    		double lev_needed = (double) cookingItem.getRequiredLevel();
    		double burn_stop = (double) cookingItem.getBurnStopLevel();
    		if(player.getEquipment().contains(775))
    			burn_stop = (double) cookingItem.getBurnStopLevelWith();
    		double multi_a = (burn_stop - lev_needed);
    		double burn_dec = (burn_chance / multi_a);
    		double multi_b = (cook_level - lev_needed);
    		burn_chance -= (multi_b * burn_dec);
    		Random random = new Random();
    		double randNum = random.nextDouble() * 100.0;
    
    		return burn_chance <= randNum; 
    	}
    
    	@Override
    	public void execute() {
    		if(!player.getInventory().contains(cookingItem.getRawItem()) ||
    				productionAmount < 1) {
    			this.stop();
    			return;
    		}
    		fourTickDelay++;
    		if(fourTickDelay % 4 != 0)
    			return;
    		if(productionAmount > 1)
    			player.playAnimation(heatSource.getAnimation());
    		productionAmount--;
    		player.getInventory().remove(cookingItem.getRawItem());
    		if(TutorialIsland.getStage(player) == 7 || TutorialIsland.getStage(player) != 8 &&
    				isSuccessful()) {
    			player.getInventory().add(cookingItem.getCookedItem());
    			player.getActionSender().sendMessage("You successfully cook the " + 
    					cookingItem.getCookedItem().getDefinition().getName() + ".");
    			player.getSkills().addExperience(Skills.COOKING, cookingItem.getExperience());
    		} else {
    			player.getInventory().add(cookingItem.getBurntItem());
    			player.getActionSender().sendMessage("You accidently burn the " + 
    					cookingItem.getCookedItem().getDefinition().getName() + ".");
    
    		}
    		if(TutorialIsland.getStage(player) == 7 || TutorialIsland.getStage(player) == 8) {
    			ScriptManager.getScriptManager().invokeWithFailTest("tutEndCooking", player);
    			this.stop();
    		}
    
    	}
    
    	@Override
    	public QueuePolicy getQueuePolicy() {
    		return QueuePolicy.NEVER;
    	}
    
    	@Override
    	public WalkablePolicy getWalkablePolicy() {
    		return WalkablePolicy.NON_WALKABLE;
    	}
    
    }
     

  6. Thankful user:


  7. #505  
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    Quote Originally Posted by 'jimmy View Post
    alright, i'll release a little bit of the code just so everyone will shutup about how we're not even doing anything.

    Code:
    package org.hyperion.rs2.action.impl;
    
    import java.util.random;
    
    import org.hyperion.rs2.scriptmanager;
    import org.hyperion.rs2.action.action;
    import org.hyperion.rs2.content.quest.impl.tutorialisland;
    import org.hyperion.rs2.content.skills.news.cooking.cookingitem;
    import org.hyperion.rs2.content.skills.news.cooking.heatsource;
    import org.hyperion.rs2.model.player;
    import org.hyperion.rs2.model.skills;
    
    /**
     * 
     * @author jimmy
     * @author clifton - success rate formula
     */
    public class cookingaction extends action {
    
        private player player;
        private heatsource heatsource;
        private cookingitem cookingitem;
        private int productionamount;
        private int fourtickdelay;
    
        public cookingaction(player player, heatsource heatsource, cookingitem cookingitem, int productionamount) {
            super(player, 600);
            this.player = player;
            this.heatsource = heatsource;
            this.cookingitem = cookingitem;
            this.productionamount = productionamount;
            player.playanimation(heatsource.getanimation());
            player.getattributes().put("cooking", null);
            player.getactionsender().sendcloseinterface();
        }
    
        public cookingaction(player player, heatsource heatsource, cookingitem cookingitem) {
            super(player, 600);
            this.player = player;
            this.heatsource = heatsource;
            this.cookingitem = cookingitem;
            this.productionamount = 1;
            player.playanimation(heatsource.getanimation());
            player.getattributes().put("cooking", null);
        }
    
        private boolean issuccessful() {
            double burnbonus = 0.0;
            if(heatsource == heatsource.stove) 
                burnbonus = 3.0;
            double burn_chance = (45.0 - burnbonus);
            double cook_level = (double) player.getskills().getlevel(skills.cooking);
            double lev_needed = (double) cookingitem.getrequiredlevel();
            double burn_stop = (double) cookingitem.getburnstoplevel();
            if(player.getequipment().contains(775))
                burn_stop = (double) cookingitem.getburnstoplevelwith();
            double multi_a = (burn_stop - lev_needed);
            double burn_dec = (burn_chance / multi_a);
            double multi_b = (cook_level - lev_needed);
            burn_chance -= (multi_b * burn_dec);
            random random = new random();
            double randnum = random.nextdouble() * 100.0;
    
            return burn_chance <= randnum; 
        }
    
        @override
        public void execute() {
            if(!player.getinventory().contains(cookingitem.getrawitem()) ||
                    productionamount < 1) {
                this.stop();
                return;
            }
            fourtickdelay++;
            if(fourtickdelay % 4 != 0)
                return;
            if(productionamount > 1)
                player.playanimation(heatsource.getanimation());
            productionamount--;
            player.getinventory().remove(cookingitem.getrawitem());
            if(tutorialisland.getstage(player) == 7 || tutorialisland.getstage(player) != 8 &&
                    issuccessful()) {
                player.getinventory().add(cookingitem.getcookeditem());
                player.getactionsender().sendmessage("you successfully cook the " + 
                        cookingitem.getcookeditem().getdefinition().getname() + ".");
                player.getskills().addexperience(skills.cooking, cookingitem.getexperience());
            } else {
                player.getinventory().add(cookingitem.getburntitem());
                player.getactionsender().sendmessage("you accidently burn the " + 
                        cookingitem.getcookeditem().getdefinition().getname() + ".");
    
            }
            if(tutorialisland.getstage(player) == 7 || tutorialisland.getstage(player) == 8) {
                scriptmanager.getscriptmanager().invokewithfailtest("tutendcooking", player);
                this.stop();
            }
    
        }
    
        @override
        public queuepolicy getqueuepolicy() {
            return queuepolicy.never;
        }
    
        @override
        public walkablepolicy getwalkablepolicy() {
            return walkablepolicy.non_walkable;
        }
    
    }
    boom.
     

  8. #506  
    Donator

    Join Date
    May 2010
    Posts
    321
    Thanks given
    25
    Thanks received
    25
    Rep Power
    13
    Any idea when this will be out?
     

  9. #507  
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    Quote Originally Posted by G3t Owned View Post
    Any idea when this will be out?
    It will be out for testing sometime between Mid June and Mid July.
     

  10. #508  
    Banned

    Join Date
    Nov 2009
    Posts
    4,219
    Thanks given
    2,950
    Thanks received
    1,362
    Rep Power
    0
    I am still looking for ONE more Server Developer (must be familiar with Hyperion), ONE Client Developer and ONE Website Developer/Designer (you must be able to re-create forums, hiscores, etc.).
     

  11. #509  
    Web Developer
    Ben2's Avatar
    Join Date
    Oct 2010
    Posts
    663
    Thanks given
    157
    Thanks received
    70
    Rep Power
    118
    do i count?


    Formerly Crimson.
     

  12. #510  
    Banned
    Join Date
    Mar 2010
    Posts
    23
    Thanks given
    0
    Thanks received
    9
    Rep Power
    0
    Quote Originally Posted by 'Jimmy View Post
    Alright, I'll release a little bit of the code just so everyone will shutup about how we're not even doing anything.

    Code:
    package org.hyperion.rs2.action.impl;
    
    import java.util.Random;
    
    import org.hyperion.rs2.ScriptManager;
    import org.hyperion.rs2.action.Action;
    import org.hyperion.rs2.content.quest.impl.TutorialIsland;
    import org.hyperion.rs2.content.skills.news.Cooking.CookingItem;
    import org.hyperion.rs2.content.skills.news.Cooking.HeatSource;
    import org.hyperion.rs2.model.Player;
    import org.hyperion.rs2.model.Skills;
    
    /**
     * 
     * @author Jimmy
     * @author Clifton - Success rate formula
     */
    public class CookingAction extends Action {
    
    	private Player player;
    	private HeatSource heatSource;
    	private CookingItem cookingItem;
    	private int productionAmount;
    	private int fourTickDelay;
    
    	public CookingAction(Player player, HeatSource heatSource, CookingItem cookingItem, int productionAmount) {
    		super(player, 600);
    		this.player = player;
    		this.heatSource = heatSource;
    		this.cookingItem = cookingItem;
    		this.productionAmount = productionAmount;
    		player.playAnimation(heatSource.getAnimation());
    		player.getAttributes().put("cooking", null);
    		player.getActionSender().sendCloseInterface();
    	}
    
    	public CookingAction(Player player, HeatSource heatSource, CookingItem cookingItem) {
    		super(player, 600);
    		this.player = player;
    		this.heatSource = heatSource;
    		this.cookingItem = cookingItem;
    		this.productionAmount = 1;
    		player.playAnimation(heatSource.getAnimation());
    		player.getAttributes().put("cooking", null);
    	}
    
    	private boolean isSuccessful() {
    		double burnBonus = 0.0;
    		if(heatSource == HeatSource.STOVE) 
    			burnBonus = 3.0;
    		double burn_chance = (45.0 - burnBonus);
    		double cook_level = (double) player.getSkills().getLevel(Skills.COOKING);
    		double lev_needed = (double) cookingItem.getRequiredLevel();
    		double burn_stop = (double) cookingItem.getBurnStopLevel();
    		if(player.getEquipment().contains(775))
    			burn_stop = (double) cookingItem.getBurnStopLevelWith();
    		double multi_a = (burn_stop - lev_needed);
    		double burn_dec = (burn_chance / multi_a);
    		double multi_b = (cook_level - lev_needed);
    		burn_chance -= (multi_b * burn_dec);
    		Random random = new Random();
    		double randNum = random.nextDouble() * 100.0;
    
    		return burn_chance <= randNum; 
    	}
    
    	@Override
    	public void execute() {
    		if(!player.getInventory().contains(cookingItem.getRawItem()) ||
    				productionAmount < 1) {
    			this.stop();
    			return;
    		}
    		fourTickDelay++;
    		if(fourTickDelay % 4 != 0)
    			return;
    		if(productionAmount > 1)
    			player.playAnimation(heatSource.getAnimation());
    		productionAmount--;
    		player.getInventory().remove(cookingItem.getRawItem());
    		if(TutorialIsland.getStage(player) == 7 || TutorialIsland.getStage(player) != 8 &&
    				isSuccessful()) {
    			player.getInventory().add(cookingItem.getCookedItem());
    			player.getActionSender().sendMessage("You successfully cook the " + 
    					cookingItem.getCookedItem().getDefinition().getName() + ".");
    			player.getSkills().addExperience(Skills.COOKING, cookingItem.getExperience());
    		} else {
    			player.getInventory().add(cookingItem.getBurntItem());
    			player.getActionSender().sendMessage("You accidently burn the " + 
    					cookingItem.getCookedItem().getDefinition().getName() + ".");
    
    		}
    		if(TutorialIsland.getStage(player) == 7 || TutorialIsland.getStage(player) == 8) {
    			ScriptManager.getScriptManager().invokeWithFailTest("tutEndCooking", player);
    			this.stop();
    		}
    
    	}
    
    	@Override
    	public QueuePolicy getQueuePolicy() {
    		return QueuePolicy.NEVER;
    	}
    
    	@Override
    	public WalkablePolicy getWalkablePolicy() {
    		return WalkablePolicy.NON_WALKABLE;
    	}
    
    }
    Lmfao.

    Ok lets go through that, removing Clifton's work first

    Code:
    package org.hyperion.rs2.action.impl;
    
    import java.util.Random;
    
    import org.hyperion.rs2.ScriptManager;
    import org.hyperion.rs2.action.Action;
    import org.hyperion.rs2.content.quest.impl.TutorialIsland;
    import org.hyperion.rs2.content.skills.news.Cooking.CookingItem;
    import org.hyperion.rs2.content.skills.news.Cooking.HeatSource;
    import org.hyperion.rs2.model.Player;
    import org.hyperion.rs2.model.Skills;
    
    /**
     * 
     * @author Jimmy
     * @author Clifton - Success rate formula
     */
    public class CookingAction extends Action {
    
    	private Player player;
    	private HeatSource heatSource;
    	private CookingItem cookingItem;
    	private int productionAmount;
    	private int fourTickDelay;
    
    	public CookingAction(Player player, HeatSource heatSource, CookingItem cookingItem, int productionAmount) {
    		super(player, 600);
    		this.player = player;
    		this.heatSource = heatSource;
    		this.cookingItem = cookingItem;
    		this.productionAmount = productionAmount;
    		player.playAnimation(heatSource.getAnimation());
    		player.getAttributes().put("cooking", null);
    		player.getActionSender().sendCloseInterface();
    	}
    
    	public CookingAction(Player player, HeatSource heatSource, CookingItem cookingItem) {
    		super(player, 600);
    		this.player = player;
    		this.heatSource = heatSource;
    		this.cookingItem = cookingItem;
    		this.productionAmount = 1;
    		player.playAnimation(heatSource.getAnimation());
    		player.getAttributes().put("cooking", null);
    	}
    
    	@Override
    	public void execute() {
    		if(!player.getInventory().contains(cookingItem.getRawItem()) ||
    				productionAmount < 1) {
    			this.stop();
    			return;
    		}
    		fourTickDelay++;
    		if(fourTickDelay % 4 != 0)
    			return;
    		if(productionAmount > 1)
    			player.playAnimation(heatSource.getAnimation());
    		productionAmount--;
    		player.getInventory().remove(cookingItem.getRawItem());
    		if(TutorialIsland.getStage(player) == 7 || TutorialIsland.getStage(player) != 8 &&
    				isSuccessful()) {
    			player.getInventory().add(cookingItem.getCookedItem());
    			player.getActionSender().sendMessage("You successfully cook the " + 
    					cookingItem.getCookedItem().getDefinition().getName() + ".");
    			player.getSkills().addExperience(Skills.COOKING, cookingItem.getExperience());
    		} else {
    			player.getInventory().add(cookingItem.getBurntItem());
    			player.getActionSender().sendMessage("You accidently burn the " + 
    					cookingItem.getCookedItem().getDefinition().getName() + ".");
    
    		}
    		if(TutorialIsland.getStage(player) == 7 || TutorialIsland.getStage(player) == 8) {
    			ScriptManager.getScriptManager().invokeWithFailTest("tutEndCooking", player);
    			this.stop();
    		}
    
    	}
    
    	@Override
    	public QueuePolicy getQueuePolicy() {
    		return QueuePolicy.NEVER;
    	}
    
    	@Override
    	public WalkablePolicy getWalkablePolicy() {
    		return WalkablePolicy.NON_WALKABLE;
    	}
    
    }
    how is that better than the original PJA code, which you called "shit"

    Code:
    private static class CookingAction extends Action {
    		
    		/**
    		 * The cooking animations.
    		 */
    		private static final Animation RANGE_ANIMATION = Animation.create(896);
    		private static final Animation FIRE_ANIMATION = Animation.create(897);
    		
    		/**
    		 * The cooking event constructor.
    		 * @param player The chef.
    		 * @param index The index from which we get all the needed stuff.
    		 * @param amount The amount of items we want to cook.
    		 */
    		public CookingAction(Player player, int index, int amount) {
    			super(player, 0);
    			this.rawItem = RAW_ITEMS[index];
    			this.noBurnLevel = getStopBurningLevel(index, player.getEquipment().get(Equipment.SLOT_GLOVES));
    			this.levelToCook = LEVEL_REQUIREMENTS[index];
    			this.burntItem = BURNT_ITEMS[index];
    			this.cookedItem = COOKED_ITEMS[index];
    			this.exp = EXPERIENCE_TABLE[index];
    			this.amount = amount;
    		}
    		
    		@Override
    		public void execute() {
    			final Player player = getPlayer();
    			if(amount <= 0) {
    				this.stop();
    				getPlayer().getCookingVariables().setCookingItem(-1);
    				return;
    			}
    			if(!player.getInventory().contains(rawItem)){
    				player.getActionSender().sendMessage("You have run out of "+rawItem.getDefinition().getName().replaceFirst("Raw", "")+" to cook.");
    				this.stop();
    				player.getCookingVariables().setCookingItem(-1);
    				return;
    			}
    			if(player.getSkills().getLevel(Skills.COOKING) < levelToCook) {
    				player.getActionSender().sendMessage("You need a Cooking of level "+ levelToCook +" in order to cook this meal.");
    				this.stop();
    				player.getCookingVariables().setCookingItem(-1);
    				return;
    			}
    			int playerLevel = player.getSkills().getLevel(Skills.COOKING);
    			boolean shouldBurn = (playerLevel >= noBurnLevel) ? false : shouldBurn(playerLevel, noBurnLevel);
    			if(player.getCookingVariables().isCookingOnFire()) {
    				player.playAnimation(FIRE_ANIMATION);
    			} else {
    				player.playAnimation(RANGE_ANIMATION);
    			}
    			player.getInventory().remove(rawItem);
    			if(shouldBurn) {
    				player.getInventory().add(burntItem);
    				player.getActionSender().sendMessage("Oops! You accidently burnt the " + rawItem.getDefinition().getName().toLowerCase() + ".");
    			} else {
    				player.getInventory().add(cookedItem);
    				player.getActionSender().sendMessage("You succesfully cook the " + cookedItem.getDefinition().getName().replaceFirst("Cooked ", "").toLowerCase() + ".");//Removes the string "Cooked" from some food, eg. "Cooked meat" because it looks super idiotic.
    				if(cookedItem.getId() == 2309) {
    					TutorialIsland.finishedBread(player);
    				}
    				player.getSkills().addExperience(Skills.COOKING, exp);
    			}
    			this.setDelay(3000);
    			if(--amount <= 0) {
    				this.stop();
    				player.getCookingVariables().setCookingItem(-1);
    			}
    		}
    		
    		private final Item rawItem;
    		private final Item burntItem;
    		private final Item cookedItem;
    		private final int noBurnLevel;
    		private final int levelToCook;
    		private final double exp; 
    		private int amount;
    
    		@Override
    		public QueuePolicy getQueuePolicy() {
    			return QueuePolicy.NEVER;
    		}
    
    		@Override
    		public WalkablePolicy getWalkablePolicy() {
    			return WalkablePolicy.NON_WALKABLE;
    		}
    	}
    I can't see any improvement bro

    Code:
    if(productionAmount > 1)
    			player.playAnimation(heatSource.getAnimation());
    you already had a precondition check

    Code:
    if(!player.getInventory().contains(cookingItem.getRawItem()) ||
    				productionAmount < 1) {
    			this.stop();
    			return;
    		}
    why evaluate productionAmount again, like it could suddenly change in the middle of execution

    in both of your constructors, you have
    Code:
    player.playAnimation(heatSource.getAnimation());
    ok so every time the action is instantiated, we play the animation, ok

    then why do you have another

    Code:
    if(productionAmount > 1)
    			player.playAnimation(heatSource.getAnimation());
    in the execute method. repetitive much?

    your whole four tick delay is a hassle, why have the ENTIRE FUCKING execute method loop four fucking times each cycle when you can easily let it as originally done,
    Code:
    this.setDelay(3000);
    600 * 4 = 3000 derp

    Btw, your tick delay shit wouldn't even work based on the code you provided,

    Code:
    private int fourTickDelay;
    ok and then you do

    Code:
    fourTickDelay++;
    		if(fourTickDelay % 4 != 0)
    did you even test this shit? That would give you an immediate nullpointer, you don't even set a value to fourTickDelay in your constructor or anywhere in that class, how can you increase null by one
     

  13. Thankful user:


Page 51 of 446 FirstFirst ... 41495051525361101151 ... LastLast

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. RS2006 - Bringing back the good ol' days
    By Vault in forum Projects
    Replies: 112
    Last Post: 12-29-2011, 09:01 PM
  2. RS2006 - Bringing back the good ol days
    By RSVault in forum Advertise
    Replies: 5
    Last Post: 10-05-2011, 04:22 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •