[667 Snippet] Spotlight concept

Discussion in 'RuneScape Programming' started by Decimate, Aug 26, 2016.

[667 Snippet] Spotlight concept
  1. Unread #1 - Aug 26, 2016 at 8:02 PM
  2. Decimate
    Joined:
    Jan 6, 2016
    Posts:
    3,662
    Referrals:
    1
    Sythe Gold:
    840
    Discord Unique ID:
    677937710572503108
    Discord Username:
    decimate
    I saw Matthew Nitro Booster

    Decimate Grand Master
    Decimate Donor You Shall Not Pass

    [667 Snippet] Spotlight concept

    Insert in your player.java

    Code:
    //spotlights
        public boolean atkSpot = false;
        public boolean defSpot = false;
        public boolean strSpot = false;
        public boolean hpSpot = false;
        public boolean rangeSpot = false;
        public boolean praySpot = false;
        public boolean mageSpot = false;
        public boolean cookSpot = false;
        public boolean wcSpot = false;
        public boolean fletchSpot = false;
        public boolean fishSpot = false;
        public boolean fmSpot = false;
        public boolean craftSpot = false;
        public boolean smithSpot = false;
        public boolean mineSpot = false;
        public boolean herbSpot = false;
        public boolean agilSpot = false;
        public boolean thiefSpot = false;
        public boolean slaySpot = false;
        public boolean farmSpot = false;
        public boolean rcSpot = false;
        public boolean huntSpot = false;
        public boolean constructionSpot = false;
        public boolean summSpot = false;
        public boolean dungSpot = false;
    
    Again in player.java

    Code:
    public void resetSpotlight() {
            for (Player player : World.getPlayers()) {
            player.atkSpot = false;
           player.defSpot = false;
           player.strSpot = false;
           player.hpSpot = false;
            player.rangeSpot = false;
           player.praySpot = false;
           player.mageSpot = false;
           player.cookSpot = false;
           player.wcSpot = false;
           player.fletchSpot = false;
           player.fishSpot = false;
           player.fmSpot = false;
           player.craftSpot = false;
           player.smithSpot = false;
           player.mineSpot = false;
           player.herbSpot = false;
            player.agilSpot = false;
           player.thiefSpot = false;
           player.slaySpot = false;
           player.farmSpot = false;
           player.rcSpot = false;
           player.huntSpot = false;
           player.constructionSpot = false;
           player.summSpot = false;
           player.dungSpot = false;
            }
        }
    
    Make a new class @ com.rs.game called "Spotlight.java"

    Code:
    package com.rs.game;
    
    import java.util.Collections;
    import java.util.HashMap;
    import java.util.List;
    import java.util.Map;
    import java.util.TimerTask;
    import java.util.concurrent.TimeUnit;
    import java.util.ArrayList;
    
    import com.rs.Launcher;
    import com.rs.Settings;
    import com.rs.cores.CoresManager;
    import com.rs.game.item.FloorItem;
    import com.rs.game.item.Item;
    import com.rs.game.minigames.GodWarsBosses;
    import com.rs.game.minigames.ZarosGodwars;
    import com.rs.game.npc.NPC;
    import com.rs.game.npc.corp.CorporealBeast;
    import com.rs.game.npc.dragons.KingBlackDragon;
    import com.rs.game.npc.KingBlackDrago;
    import com.rs.game.npc.ChaosEle;
    import com.rs.game.npc.godwars.GodWarMinion;
    import com.rs.game.npc.godwars.armadyl.KreeArra;
    import com.rs.game.npc.godwars.bandos.GeneralGraardor;
    import com.rs.game.npc.godwars.saradomin.CommanderZilyana;
    import com.rs.game.npc.godwars.saradomin.GodwarsSaradominFaction;
    import com.rs.game.npc.godwars.zammorak.GodwarsZammorakFaction;
    import com.rs.game.npc.godwars.zammorak.KrilTstsaroth;
    import com.rs.game.npc.godwars.zaros.Nex;
    import com.rs.game.npc.godwars.zaros.NexMinion;
    import com.rs.game.npc.kalph.KalphiteQueen;
    import com.rs.game.npc.others.HuntNPC;
    import com.rs.game.npc.others.Lucien;
    import com.rs.game.npc.others.PestMonsters;
    import com.rs.game.npc.others.TormentedDemon;
    import com.rs.game.npc.others.AbyssalDemon;
    import com.rs.game.npc.slayer.Strykewyrm;
    import com.rs.game.npc.ArmouredZombie;
    import com.rs.game.npc.Man;
    import com.rs.game.player.OwnedObjectManager;
    import com.rs.game.player.Player;
    import com.rs.game.player.Skills;
    import com.rs.game.player.actions.Hunter.HunterNPC;
    import com.rs.game.player.content.ItemConstants;
    import com.rs.game.player.controlers.ClanReqControler;
    import com.rs.game.minigames.duel.DuelControler;
    import com.rs.game.player.controlers.Wilderness;
    import com.rs.io.AntiFlood;
    import com.rs.utils.IPBanL;
    import com.rs.utils.Logger;
    import com.rs.utils.PkRank;
    import com.rs.utils.Hiscores;
    import com.rs.utils.ZombieRanks;
    import com.rs.utils.KillStreakRank;
    import com.rs.utils.SlayerRank;
    import com.rs.utils.ShopsHandler;
    import com.rs.utils.Utils;
    import com.rs.utils.ServerMessages;
    import com.rs.utils.TriviaSystem;
    import com.rs.game.punish.LoggedException;
    import com.rs.game.punish.Priority;
    import com.rs.game.punish.PunishHandler;
    import com.rs.game.punish.XMLHandler;
    import com.rs.utils.Misc;
    import com.rs.game.LotteryManager;
    import java.net.*;
    import java.io.*;
    import com.rs.cache.loaders.ItemDefinitions;
    import com.rs.game.player.content.DamageHandler;
    import com.rs.game.player.content.Tournaments;
    import com.rs.utils.Highscores;
    import com.rs.game.PlayersOnlineUpdater;
    import com.rs.game.CrossWorldMessages;
    import com.rs.Settings;
    
    import com.rs.database.DatabasePool;
    //import org.Vote.*;
    import com.rs.utils.DonationManager;
    
    public class Spotlight {
    
        public static String[] SPOTLIGHTS = {"Attack", "Defence", "Strength", "Constitution", "Ranged", "Prayer", "Magic", "Cooking", "Woodcutting",
        "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining",
        "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecrafting",
        "Hunter", "Construction", "Summoning", "Dungeoneering" };
      
        //send the method via command or in world.java
      
        public static void sendSpotlight(Player player) {
            String spotlight = "";
            int random = Misc.random(24);
            if(random == 0) {
                spotlight = "Attack";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.atkSpot = true;
            }  
            }
            if(random == 1) {
                spotlight = "Defence";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.defSpot = true;
            }  
            }
            if(random == 2) {
                spotlight = "Strength";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.strSpot = true;
            }  
            }
            if(random == 3) {
                spotlight = "Constitution";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.hpSpot = true;
            }  
            }
            if(random == 4) {
                spotlight = "Ranged";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.rangeSpot = true;
            }  
            }
            if(random == 5) {
                spotlight = "Prayer";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.praySpot = true;
            }  
            }
            if(random == 6) {
                spotlight = "Magic";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.mageSpot = true;
            }  
            }
            if(random == 7) {
                spotlight = "Cooking";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.cookSpot = true;
            }  
            }
            if(random == 8) {
                spotlight = "Woodcutting";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.wcSpot = true;
            }  
            }
            if(random == 9) {
                spotlight = "Fletching";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.fletchSpot = true;
            }  
            }
            if(random == 10) {
                spotlight = "Fishing";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.fishSpot = true;
            }  
            }
            if(random == 11) {
                spotlight = "Firemaking";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.fmSpot = true;
            }  
            }
            if(random == 12) {
                spotlight = "Crafting";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.craftSpot = true;
            }  
            }
            if(random == 13) {
                spotlight = "Smithing";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.smithSpot = true;
            }  
            }
            if(random == 14) {
                spotlight = "Mining";
           for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.mineSpot = true;
            }  
            }
            if(random == 15) {
                spotlight = "Herblore";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.herbSpot = true;
            }  
            }
            if(random == 16) {
                spotlight = "Agility";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.agilSpot = true;
            }  
            }
            if(random == 17) {
                spotlight = "Thieving";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.thiefSpot = true;
            }  
            }
            if(random == 18) {
                spotlight = "Slayer";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.slaySpot = true;
            }  
            }
            if(random == 19) {
                spotlight = "Farming";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.farmSpot = true;
            }  
            }
            if(random == 20) {
                spotlight = "Runecrafting";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.rcSpot = true;
            }  
            }
            if(random == 21) {
                spotlight = "Hunter";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.huntSpot = true;
            }  
            }
            if(random == 22) {
                spotlight = "Construction";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.constructionSpot = true;
            }  
            }
            if(random == 23) {
                spotlight = "Summoning";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.summSpot = true;
            }  
            }
            if(random == 24) {
                spotlight = "Dungeoneering";
            for(Player players : World.getPlayers()) {
                players.resetSpotlight();
                players.dungSpot = true;
            }  
            }
            if(!Settings.isArcadeWorld()) {
                player.yell("<col=ff0000><shad=000000>The Spotlight is now on the "+spotlight+" skill.", true);
                System.out.println("The Spotlight is now on the "+spotlight+" skill.");  
            }
          
        }
      
    
    }
    
    World.java

    add the import -> import com.rs.game.Spotlight;

    Code:
    private static void newSpotlight() {
            CoresManager.slowExecutor.scheduleWithFixedDelay(new Runnable() {
                @Override
                public void run() {
                    try {
                        for(Player player : getPlayers())
                        Spotlight.sendSpotlight(player);
                    } catch (Throwable e) {
                        Logger.handle(e);
                    }
                }
            }, 0, 1, TimeUnit.MINUTES);
        }
    
    In the init method in the world.java class

    Code:
    newSpotlight();
    
    OPTIONAL: commands.java (add the import for your spotlight class)

    Code:
    if (cmd[0].equals("spotlight")) {
                Spotlight.sendSpotlight(player);
            }
    
    Now for what the spotlight does.

    Go to one of your skilling classes, for example your "Fishing.java" class.

    In the method where the xp is added add something like this

    Code:
    if(player.fishSpot == true) 
                player.getSkills().addXp(Skills.FISHING, spot.getFish()[fishId].getXp() * 2);
    
    You can do this for all your skilling classes and what it does is that whichever spotlight is true, it will double the experience gained in said skill.
     
    Last edited: Aug 26, 2016
< Looking for Private NMZ Script | [Snippet] Runecrafting & Abyss Rifts [PI] >

Users viewing this thread
1 guest


 
 
Adblock breaks this site