Thread: Thieving on stalls

Results 1 to 4 of 4
  1. #1 Thieving on stalls 
    Donator

    Sir Lethal's Avatar
    Join Date
    Mar 2008
    Posts
    2,286
    Thanks given
    9
    Thanks received
    74
    Rep Power
    426
    Can anyone make like a base thieving code and explain it to me for a RS2HD 525 base?

    Can also anyone show me a fishing base code?
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Registered Member hybrent's Avatar
    Join Date
    Nov 2007
    Posts
    566
    Thanks given
    73
    Thanks received
    90
    Rep Power
    28
    Fishing base code:
    Code:
    package com.rs2hd.content;
    
    import com.rs2hd.event.Event;
    import com.rs2hd.model.Item;
    import com.rs2hd.model.Location;
    import com.rs2hd.model.Player;
    import com.rs2hd.model.Skills;
    import com.rs2hd.model.World;
    
    public class Fishing {
    
        private static enum FISHING_TYPE {
            CAGE_LOBSTER,
        }
        
        private Event event = null;
        private Player player;
    
        public Fishing(Player player) {
            setPlayer(player);
        }
    
        private void setPlayer(Player player) {
            this.player = player;
        }
    
        public void startFishing(int npcId, int tick, final Location nextTo) {
            FISHING_TYPE fishingType = null;
            if (npcId == 6267) {
                fishingType = FISHING_TYPE.CAGE_LOBSTER;
            }
            if (fishingType == null) {
                player.getActionSender().sendMessage(
                        "No data for this NPC - Fishing.");
                return;
            }
            if (player.getInventory().getFreeSlots() == 0) {
            	player.getActionSender().sendMessage("Not enough space in inventory");
            	if (event != null) event.stop();
            	return;
            	
            }
            Event event = null;
            int animation = -1;
            int fishItem = -1;
            int lvlReq = -1;
            int exp = 0;
            boolean canFish = false;
            switch (fishingType) {
            case CAGE_LOBSTER:
                animation = 10009;
                fishItem = 377;
                lvlReq = 1;
                exp = 20;
                canFish = true;
                tick = 5000;
                break;
            }
            final int fish = fishItem;
            final int finalAnimation = animation;
            final int finalTick = tick;
            final int xp = exp;
            final Item item = new Item(fishItem, 1);
            if (canFish) {
                player.setFishingAction(true);
                if (player.getSkills().getLevel(Skills.FISHING) < lvlReq) {
                    player.getActionSender().sendMessage(
                            "You need a fishing level of " + lvlReq + " to fish "
                                    + item.getDefinition().getName());
                    player.setFishingAction(false);
                    return;
                }
                player.animate(animation);
                event = new Event(tick) {
                    @Override
                    public void execute() {
                        if (player.isFishing()) {
                        	System.out.print(player.getLocation().withinDistance(nextTo, 10));
                        	System.out.print(player.isFishing());
                          //  if (player.getLocation().withinDistance(nextTo, 1)) {
    
                                if (player.getInventory().getFreeSlots() <= 0) {
                                    this.stop();
                                    player.animate(-1);
                                    player.getActionSender().sendMessage(
                                            "Not enough inventory space.");
                                    return;
                                }
    
                                if (getTick() == 100) {
                                    player.animate(finalAnimation);
                                    setTick(finalTick);
                                } else {
                                    int random = (int) (java.lang.Math.random() * (player
                                            .getSkills().getLevel(Skills.FISHING) + 1));
                                    if (random > player.getSkills().getLevel(
                                            Skills.FISHING) >> 3 + 5) {
                                        player.getInventory().addItem(fish, 1);
                                        player.getActionSender().sendMessage(
                                                "You just caught a "
                                                        + item.getDefinition()
                                                                .getName() + ".");
                                        setTick(finalTick);
                                        player.getSkills()
                                                .addXp(Skills.FISHING, xp);
                                    }
                                }
                                player.animate(finalAnimation);
                                if (getTick() == 0) {
                                    setTick(finalTick);
                                }
                             else {
                                //player.setFishingAction(false);
                                //player.animate(-1);
                                //stop();
                            }
                    } else {
                            player.setFishingAction(false);
                            stop();
                        }
                    }
                };
            }
            if (event != null) {
                World.getInstance().registerEvent(event);
            }
        }
    }
    Note: this is from rs2hd forums final play base. I didn't make it. It's for a 508, but is easily convertable if it doesn't work right away.

    There's a theiving base in the tut sections for 508 (stalls) which you could use to see how it's done.
    Amused as I am not, I must continue to try. -Keith Charles
    Quote Originally Posted by Ayton View Post
    I'm sorry, but I have to agree with Hybrent.
    Reply With Quote  
     

  3. #3  
    Donator

    Sir Lethal's Avatar
    Join Date
    Mar 2008
    Posts
    2,286
    Thanks given
    9
    Thanks received
    74
    Rep Power
    426
    I said 525's not 508
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  4. #4  
    Registered Member hybrent's Avatar
    Join Date
    Nov 2007
    Posts
    566
    Thanks given
    73
    Thanks received
    90
    Rep Power
    28
    Are you an idiot? It's for rs2hd...

    It WILL WORK with a 525 if your using rs2hd. If your not that proves my first statement tbh.

    It works on my 474 rs2hd, it will work on 508 rs2hd, it will work on 525 rs2hd. If you need it for pali 525 you need to SPECIFY.

    You should be glad people are willing to help you.

    EDIT: It even says rs2hd in your post, so why doesn't this work?
    And sorry for somewhat flaming, but it makes me mad when I help and people don't think it did.

    EDIT2: [Only registered and activated users can see links. ] <--- thief stalls

    That's just to HELP you, it's not for 525, but you can easily look at it to see what they did. It's just in the objectpackethandler, so you should be able to add that tutorial, just change the methods.
    Amused as I am not, I must continue to try. -Keith Charles
    Quote Originally Posted by Ayton View Post
    I'm sorry, but I have to agree with Hybrent.
    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

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •