Thread: [Elvarg] Beacon Ring: Perhaps the most obnoxious, ill-concieved, innacurate item ever

Results 1 to 1 of 1
  1. #1 [Elvarg] Beacon Ring: Perhaps the most obnoxious, ill-concieved, innacurate item ever 
    Donator

    Join Date
    Feb 2017
    Posts
    100
    Thanks given
    0
    Thanks received
    10
    Rep Power
    36
    Well I set out to recreate the beacon ring which is used in the what lies below quest. You probably don't know or remember this but you used to be able to spam summon Zaff in the GE which was harmless but a ton of fun because people always freaked out. I wanted to recreate that... But failed miserably...

    Problems:
    - I can't remember the dialogues. D:
    - I don't even remember what exactly happened when you used the ring.
    - It has since changed.
    - Not tested with scripting auto clickers.

    To install: Place file in correct package, Open up item option handler or whatever the file that does that is called and add...

    Code:
    if(BeaconRing.handleRing(player, whatevertheitemidvariableis))
    return;
    ... To the third item option.

    Spoiler for Code:

    Code:
    package com.elvarg.game.model;
    
    import com.elvarg.game.World;
    import com.elvarg.game.entity.impl.npc.NPC;
    import com.elvarg.game.entity.impl.player.Player;
    import com.elvarg.game.task.Task;
    import com.elvarg.game.task.TaskManager;
    import com.elvarg.util.Misc;
    
    public class BeaconRing {
    
        private static final int BEACON_RING = 11014;
        private static final int GFX_ID = 110;
        private static final int NPC_ID = 532;
    
        private static final boolean zaffSpeaks = true;
        private static final boolean euroMode = false; //Because why not XD
    
        private static final String[] inLibraryDialogues = new String[2];
        private static final String[] outLibraryDialogues = new String[2];
    
        private static int zaffs = 0;
        private static final int MAX_ZAFFS = 10;
    
        static {
            inLibraryDialogues[0] = "Nice Library.";
            inLibraryDialogues[1] = "Bye Now.";
            outLibraryDialogues[0] = euroMode ? "Oi this ain't the bloody Varrock library mate why have ye summoned me?" : "This isn't the Varrock library why have you summoned me here?";
            outLibraryDialogues[1] = "Geologically challenged eh? I'll be on my way then...";
        }
    
        public static boolean handleRing(Player player, int itemId) {
            if(itemId == BEACON_RING) {
                summonZaff(player);
                return true;
            }
            return false;
        }
    
        private static void summonZaff(Player player) {
    
            if(zaffs >= MAX_ZAFFS)
                return;
    
            Position center = player.getPosition();
    
            int xMod = Misc.getRandom(5);
            int yMod = Misc.getRandom(5);
            boolean xModNegative = Misc.getRandom(2) == 1;
            boolean yModNegative = Misc.getRandom(2) == 1;
    
            Position target = new Position(center.getX() + (xModNegative ? -xMod : xMod), center.getY() + (yModNegative ? -yMod : yMod), center.getZ());
    
            NPC zaff = new NPC(NPC_ID, target);
            zaff.setPositionToFace(center);
            player.setPositionToFace(target);
    
            player.getPacketSender().sendGlobalGraphic(new Graphic(GFX_ID), target);
    
            TaskManager.submit(new Task(1, false) {
                @Override
                protected void execute() {
                    World.getAddNPCQueue().add(zaff);
                    zaffs++;
                    if(zaffSpeaks)
                        sendDialogues(zaff, inLibrary(center) ? inLibraryDialogues : outLibraryDialogues);
                    stop();
                }
            });
    
            TaskManager.submit(new Task(10, false) {
                @Override
                protected void execute() {
                    World.getRemoveNPCQueue().add(zaff);
                    zaffs--;
                    stop();
                }
            });
    
        }
    
        private static boolean inLibrary(Position center) {
            return center.getX() > 3206 && center.getY() < 3498 && center.getY() > 3489 && center.getX() < 3218;
        }
    
        private static void sendDialogues(NPC zaff, String[] dialogues) {
            zaff.forceChat(dialogues[0]);
            TaskManager.submit(new Task(5, false) {
                @Override
                protected void execute() {
                    zaff.forceChat(dialogues[1]);
                    stop();
                }
            });
        }
    
    }
    Last edited by XScapeRsps; 02-13-2019 at 01:58 AM.
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

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

Similar Threads

  1. the most basic, basic npc combat system ever.
    By ritz929 in forum Tutorials
    Replies: 19
    Last Post: 09-15-2008, 11:08 PM
  2. whats the most stable server?
    By Toonscape in forum Downloads
    Replies: 17
    Last Post: 04-21-2008, 02:36 PM
  3. What do you hate the most of owning a server?
    By drunkwapiti in forum Voting
    Replies: 7
    Last Post: 03-03-2008, 10:43 AM
  4. Replies: 20
    Last Post: 01-17-2008, 03:33 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
  •