Jump to content

Search the Community

Showing results for tags 'stars'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 4 results

  1. [img]http://i.imgur.com/2Hk3xtW.png[/img] [SIZE=1]Gary Allan[/SIZE]
  2. Wrote this a long time ago for 718's, but just converted it to 637 for use in Dementhium. It's only missing a few minimal things, you can figure them out. :) [B]ShootingStars.java[/B] [code] package org.dementhium.content.skills.mining; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.TimerTask; import org.dementhium.Configurations; import org.dementhium.content.DialogueManager; import org.dementhium.model.Location; import org.dementhium.model.World; import org.dementhium.model.map.ObjectManager; import org.dementhium.model.map.Region; import org.dementhium.model.mask.Animation; import org.dementhium.model.npc.NPC; import org.dementhium.model.player.Player; import org.dementhium.model.player.Skills; import org.dementhium.net.ActionSender; import org.dementhium.util.InterfaceSettings; import org.dementhium.util.Timers; import org.dementhium.util.Utils; /** * * [MENTION=52317]auth[/MENTION]or Clayton Williams (Hope) <[email protected]> * Date: Mar 14, 2014 * */ public class ShootingStars { public static int SPRITE_CHILD = 8091, STAR_INTERFACE = 782; public final static int[] STARS = {38660, 38661, 38662, 38663, 38664, 38665, 38666, 38667, 38668}; private static ShootingStar star = null; private static long lastLandTime; private static final int INITIAL_STARDUST = 180; public enum LocationInfo { STAR1(Location.locate(2672, 3363, 0), "Near a place where food is grown in Ardougne."), STAR2(Location.locate(3566, 3321, 0), "Near the entrance of the 6 deadly brothers"), STAR3(Location.locate(2591, 3389, 0), "Let's go fishin'."), STAR4(Location.locate(3193, 3235, 0), "Behind one of the oldest castles in runescape!"), STAR5(Location.locate(2548, 3569, 0), "This one might require some 'running'."), STAR6(Location.locate(2342, 3635, 0), "Somewhere in the hunting lands of the north."); private Location possibleLocation; private String hint; private LocationInfo(Location possibleLocation, String hint) { this.possibleLocation = possibleLocation; this.hint = hint; } public static LocationInfo getRandomStar() { return Collections.unmodifiableList(Arrays.asList(values())).get(Utils.random(LocationInfo.values().length)); } public Location getLocation() { return possibleLocation; } public String getHint() { return hint; } } private static void crashStar() { lastLandTime = Utils.currentTimeMillis(); LocationInfo newSpawn = LocationInfo.getRandomStar(); star = new ShootingStar(0, newSpawn); ObjectManager.addCustomObject(STARS[0], star.getLocationInfo().getLocation().getX(), star.getLocationInfo().getLocation().getY(), star.getLocationInfo().getLocation().getZ(), 10, 0, true); World.getWorld().sendWorldMessage("<col=33CC00>[ShootingStars] A new star has crashed on " + Configurations.SERVER_NAME + "!"); } public static void init() { System.out.println("Initializing Shooting Stars..."); lastLandTime = Utils.currentTimeMillis() - 3600000; Timers.fastExecutor.schedule(new TimerTask() { public void run() { if (Utils.currentTimeMillis() - lastLandTime > 3600000) { if (star == null) { crashStar(); } } } }, 60000, 10000); } public static int getStarLevel() { int starId = star.currentId; for (int i = 0; i < STARS.length; i++) { if (STARS[i] == starId) { return Math.abs(i - STARS.length); } } return 0; } public static void handleDust(Player player) { star.setStarDust(star.getStarDust() - 1); player.getSkills().addExperience(Skills.MINING, 50); //TODO correct exp per star size player.sendMessage("You get some star dust."); for (int i = 0; i < STARS.length; i++) { if (STARS[i] == star.currentId) { if (star.getStarDust() <= (getStarLevel() * (INITIAL_STARDUST / STARS.length))) { List<Player> miners = Region.getLocalPlayers(star.getLocationInfo().getLocation()); if (i != STARS.length) { star.currentId = STARS[i + 1]; ObjectManager.addCustomObject(STARS[i + 1], star.getLocationInfo().getLocation().getX(), star.getLocationInfo().getLocation().getY(), star.getLocationInfo().getLocation().getZ(), 10, 0, true); for (Player p : miners) { p.getActionManager().stopAction(); p.sendMessage("<col=33CC00>[ShootingStars] You manage to crack the rock some... Only "+star.starDust+" star dust remaining"); } } else { ObjectManager.removeCustomObject(star.getLocationInfo().getLocation(), 10); World.getWorld().register(SPRITE_CHILD, star.getLocationInfo().getLocation()).setDoesWalk(false).setUnrespawnable(true); for (Player p : miners) { p.getActionManager().stopAction(); } World.getWorld().sendWorldMessage("<col=33CC00>[ShootingStars] The Star Child will only be visible for the next 10 minutes."); Timers.fastExecutor.schedule(new TimerTask() { [MENTION=15855]Over[/MENTION]ride public void run() { try { for (NPC n : World.getWorld().getNpcs()) { if (n == null || n.getId() != SPRITE_CHILD) continue; n.sendDead(); star = null; } } catch (Throwable t) { t.printStackTrace(); } } }, 600000); // 10 Minutes for sprite child } } } } } public static void handleTelescope(final Player player) { //TODO don't have stuff for dialogue over window pane. ActionSender.sendWindowsPane(player, STAR_INTERFACE, 0); Timers.fastExecutor.schedule(new TimerTask() { [MENTION=15855]Over[/MENTION]ride public void run() { player.animate(Animation.RESET); player.setAttribute("resetCanvasAndRegionalData", true); InterfaceSettings.switchWindow(player, player.getConnection().getDisplayMode()); if (star == null) { DialogueManager.sendDialogue(player, DialogueManager.CALM_TALK, -1, -1, "Hmm, looks like the star hasn't landed yet.", "Maybe it'll land within the next hour..."); } else { DialogueManager.sendDialogue(player, DialogueManager.CALM_TALK, -1, -1, "Wow, the star landed not too long ago!", "Hint: " + star.getLocationInfo().getHint()); } } }, 3000); } public static class ShootingStar { private int currentId; private int starDust; private LocationInfo locationInfo; private ShootingStar(int randomStarIndex, LocationInfo locationInfo) { this.currentId = STARS[randomStarIndex]; this.setLocationInfo(locationInfo); setStarDust((randomStarIndex + 1) * (INITIAL_STARDUST / STARS.length)); } public int getStarDust() { return starDust; } public void setStarDust(int starDust) { this.starDust = starDust; } public LocationInfo getLocationInfo() { return locationInfo; } public void setLocationInfo(LocationInfo locationInfo) { this.locationInfo = locationInfo; } } public static ShootingStar getStar() { return star; } } [/code] [B]HarvestAction.java[/B] [code] if (level < ShootingStars.getStarLevel() * 10) { player.sendMessage("You need a mining level of " + ShootingStars.getStarLevel() * 10 + " to mine this level " + ShootingStars.getStarLevel() + " star."); stopHarvesting(); return; } [/code] [code] for (int i : ShootingStars.STARS){ if (i == gameObject.getId()) { ShootingStars.handleDust(player); return; } } [/code] [B]Mining.java[/B] [code] STAR(13727, 1, 1, -1, ShootingStars.STARS); [/code]
  3. Title pretty much says it all. Here's a class I wrote awhile back for shooting stars. Matrix has a problem with spawning objects on top of each other (don't know if anyone has fixed it yet, and never tried to look since I last wrote it). Anyway, everything works perfectly, except the rock won't *visually* show it being degraded. All players near it will be informed of a degrade in the rock though. Keep in mind that this is a snippet, and I'm not going to give you a tutorial on how to implement it. [CODE] package com.rs.game.player.actions.mining; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.TimerTask; import com.rs.cores.CoresManager; import com.rs.game.World; import com.rs.game.WorldObject; import com.rs.game.WorldTile; import com.rs.game.npc.NPC; import com.rs.game.player.Player; import com.rs.game.player.Skills; import com.rs.game.tasks.WorldTask; import com.rs.game.tasks.WorldTasksManager; import com.rs.utils.Logger; import com.rs.utils.Utils; /* * @Author Clayton Williams (Hope) */ public class ShootingStars { public static ShootingStar star; private static long lastLandTime; public static int SPRITE_CHILD = 8091; private final static int[] STARS = {38660, 38661, 38662, 38663, 38664, 38665, 38666, 38667, 38668}; public static class ShootingStar { private int currentId; private int starDust; private LocationInfo locationInfo; private ShootingStar(int currentId, LocationInfo locationInfo) { this.currentId = currentId; this.setLocationInfo(locationInfo); setStarDust(180); } public int getStarDust() { return starDust; } public void setStarDust(int starDust) { this.starDust = starDust; } public LocationInfo getLocationInfo() { return locationInfo; } public void setLocationInfo(LocationInfo locationInfo) { this.locationInfo = locationInfo; } } public enum LocationInfo { STAR1(new WorldTile(2672, 3363, 0), "South of Ardougne Farming", "Near a place where food is grown."), STAR2(new WorldTile(3809, 3570, 0), "North Side of the Skilling Island", "On a far away Island with lots of trees and fishing spots."), STAR3(new WorldTile(3566, 3321, 0), "Near the entrance of barrows", "Near the entrance of the 6 deadly brothers"), STAR4(new WorldTile(2680, 3717, 0), "Near rock crabs", "Near a place where a new player might train."), STAR5(new WorldTile(3193, 3235, 0), "Behind Lumbridge Castle", "Behind one of the oldest castles in runescape!"), STAR6(new WorldTile(2548, 3569, 0), "North of Barbarian Agility", "This one might require some 'running'."), STAR7(new WorldTile(2342, 3635, 0), "Far north of the Hunting spawn", "Somewhere in the hunting lands."); private WorldTile possibleLocation; private String location; private String hint; private LocationInfo(WorldTile possibleLocation, String location, String hint) { this.possibleLocation = possibleLocation; this.setLocation(location); this.setHint(hint); } private final static List<LocationInfo> values = Collections.unmodifiableList(Arrays.asList(values())); public static LocationInfo getRandomStar() { return values.get(Utils.random(LocationInfo.values().length)); } public String getLocation() { return location; } public void setLocation(String location) { this.location = location; } public String getHint() { return hint; } public void setHint(String hint) { this.hint = hint; } } public static void crashStar() { lastLandTime = Utils.currentTimeMillis(); LocationInfo newSpawn = LocationInfo.getRandomStar(); star = new ShootingStar(38660, newSpawn); World.spawnObject(new WorldObject(STARS[4], 10, 0, newSpawn.possibleLocation.getX(), newSpawn.possibleLocation.getY(), newSpawn.possibleLocation.getPlane()), false); World.sendWorldMessage("<col=33CC00>[ShootingStars] A new star has crashed on QuantumX!", false); } public static void init() { crashStar(); WorldTasksManager.schedule(new WorldTask() { public void run() { if (Utils.currentTimeMillis() - lastLandTime > 3600000) { if (star == null) { crashStar(); } } } }, 0, 1); } public static int getStarLevel() { int starId = star.currentId; for (int i = 0; i < STARS.length; i++) { if (STARS[i] == starId) { return Math.abs(i - 9) * 10; } } return 0; } public static void handleDust(Player player) { star.setStarDust(star.getStarDust() - 1); player.getInventory().addItem(13727, 1); player.getInventory().addItem(995, 10000); player.getSkills().addXp(Skills.MINING, 30); player.sm("You get some star dust and some money."); for (int i = 0; i < STARS.length; i++) { if (STARS[i] == star.currentId) { if (star.getStarDust() <= Math.abs(i - 8) * 20 ) { if (i != 8) { star.currentId = STARS[i + 1]; //Would be i + 1 World.spawnObject(new WorldObject(STARS[4] /*Would be STARS[i + 1], but objects on top of object spawning are fucked*/, 10, 0, star.getLocationInfo().possibleLocation.getX(), star.getLocationInfo().possibleLocation.getY(), star.getLocationInfo().possibleLocation.getPlane()), false); List<Integer> miners = World.getRegion(player.getRegionId()).getPlayerIndexes(); for (int i1 = 0; i1 < miners.size(); i1++) { Player m = World.getPlayers().get(miners.get(i1)); m.getActionManager().forceStop(); m.sm("<col=33CC00>[ShootingStars] You manage to crack the rock some... Only "+star.starDust+" star dust remaining"); } //Would also be i + 1 } else { World.spawnObject(new WorldObject(-1, 10, 2, star.getLocationInfo().possibleLocation.getX(), star.getLocationInfo().possibleLocation.getY(), star.getLocationInfo().possibleLocation.getPlane()), false); World.spawnNPC(SPRITE_CHILD, star.getLocationInfo().possibleLocation, -1, true); List<Integer> miners = World.getRegion(player.getRegionId()).getPlayerIndexes(); for (int i1 = 0; i1 < miners.size(); i1++) { Player m = World.getPlayers().get(miners.get(i1)); m.getActionManager().forceStop(); } World.sendWorldMessage("<col=33CC00>[ShootingStars] The Star Child will only be visible for the next 10 minutes.", false); CoresManager.fastExecutor.schedule(new TimerTask() { @Override public void run() { try { for (NPC n : World.getNPCs()) { if (n == null || n.getId() != SPRITE_CHILD) continue; n.sendDeath(n); star = null; } } catch (Throwable t) { Logger.handle(t); } } }, 600000); } } } } } public static void handleOption2(Player player) { player.sm("Only "+star.starDust+" star dust remaining."); } } [/CODE]
  4. [video=youtube;peAQ1a2LReI]http://www.youtube.com/watch?v=peAQ1a2LReI[/video] I love spongebob now shut up =)
×