Thread: Creative Minigames!

Results 1 to 7 of 7
  1. #1 Creative Minigames! 

    → Cheap Animated Banners ←



    Zexillium's Avatar
    Join Date
    Dec 2011
    Posts
    2,780
    Thanks given
    1,174
    Thanks received
    1,155
    Rep Power
    3284
    Hello everyone!
    So while slowly learning how to code I suddenly felt the urge to code some minigames. What I'm looking for is simple and fun minigames to code that are worth doing for the player. You can also suggest any other minigame on your mind, and I'll write them down and might do them in the future (Eg; More complex/difficult coding wise). Thank you all in advance!

    One Example
    Player starts "Raids"
    Player is teleported into arena
    Wave one begins
    Ten goblins spawn (Each time a goblin is killed, kill count increases)
    Player kills all ten goblins
    Kill count is dropped from 10 to 0
    Wave two begins
    and so on....
    New Discord is 'zexillium'
    ↓ PROUD SUPPORTER OF ↓

    Attached image

    --> See My Animated Banner Shop <--
    Reply With Quote  
     

  2. #2  
    Aldor Manager


    Join Date
    Mar 2014
    Age
    28
    Posts
    1,234
    Thanks given
    200
    Thanks received
    297
    Rep Power
    2459
    Quote Originally Posted by SilverNova View Post
    Hello everyone!
    So while slowly learning how to code I suddenly felt the urge to code some minigames. What I'm looking for is simple and fun minigames to code that are worth doing for the player. You can also suggest any other minigame on your mind, and I'll write them down and might do them in the future (Eg; More complex/difficult coding wise). Thank you all in advance!

    One Example
    Player starts "Raids"
    Player is teleported into arena
    Wave one begins
    Ten goblins spawn (Each time a goblin is killed, kill count increases)
    Player kills all ten goblins
    Kill count is dropped from 10 to 0
    Wave two begins
    and so on....
    that raids is a nice idea maybe im willing to help if needed
    Attached image

    Respect goes to everyone as he deserves.
    Reply With Quote  
     

  3. #3  
    Donator

    i dds you's Avatar
    Join Date
    Jun 2013
    Posts
    831
    Thanks given
    678
    Thanks received
    160
    Rep Power
    92
    I have your raids idea in my server currently, using the current GWD bosses - It's a neat idea, and people do enjoy it
    Reply With Quote  
     

  4. #4  

    → Cheap Animated Banners ←



    Zexillium's Avatar
    Join Date
    Dec 2011
    Posts
    2,780
    Thanks given
    1,174
    Thanks received
    1,155
    Rep Power
    3284
    Quote Originally Posted by _Jamal View Post
    that raids is a nice idea maybe im willing to help if needed
    Sure, add me on skype ("Zexillium")
    New Discord is 'zexillium'
    ↓ PROUD SUPPORTER OF ↓

    Attached image

    --> See My Animated Banner Shop <--
    Reply With Quote  
     

  5. #5  
    Aldor Manager


    Join Date
    Mar 2014
    Age
    28
    Posts
    1,234
    Thanks given
    200
    Thanks received
    297
    Rep Power
    2459
    Concept:

    This is just solo base something like fightcave

    Code:
    package com.runescape.world.minigames.raids;
    
    import java.util.List;
    import java.util.TimerTask;
    import java.util.concurrent.TimeUnit;
    
    import com.runescape.cores.CoresManager;
    import com.runescape.utils.Logger;
    import com.runescape.utils.Utils;
    import com.runescape.world.World;
    import com.runescape.world.WorldObject;
    import com.runescape.world.WorldTile;
    import com.runescape.world.entity.impl.Animation;
    import com.runescape.world.entity.npc.raids.RaidsNPC;
    import com.runescape.world.entity.player.Player;
    import com.runescape.world.entity.player.content.item.Pets.Pets;
    import com.runescape.world.entity.player.content.skills.p2p.Summoning;
    import com.runescape.world.entity.player.controlers.Controler;
    import com.runescape.world.region.RegionBuilder;
    import com.runescape.world.tasks.WorldTask;
    import com.runescape.world.tasks.WorldTasksManager;
    
    public class Raids extends Controler {
    
    	// location 2201, 4276, 1
    	public static final WorldTile OUTSIDE = new WorldTile(3081, 3495, 0);
    
    	private static final int RAIDS_MASTER = 245;
    
    	private final int[][] WAVES = { { 1, 1, 1, 1 }, { 1, 1, 1 } };// addnpc
    																	// npc
    
    	private int[] boundChuncks;
    	private Stages stage;
    	private boolean login;
    	public boolean spawned;
    
    	public static void enterRaids(Player player) {
    		if (player.getFamiliar() != null || player.getPet() != null || Summoning.hasPouch(player)
    				|| Pets.hasPet(player)) {
    			player.getDialogueManager().startDialogue("SimpleNPCMessage", RAIDS_MASTER,
    					"No Pets in the pits! This is a fight only for you!");
    			return;
    		}
    		player.getControlerManager().startControler("RaidsControler", 1);
    	}
    
    	private static enum Stages {
    		LOADING, RUNNING, DESTROYING
    	}
    
    	@Override
    	public void start() {
    		loadCave(false);
    	}
    
    	@Override
    	public boolean processButtonClick(int interfaceId, int componentId, int slotId, int slotId2, int packetId) {
    
    		if (stage != Stages.RUNNING) {
    			return false;
    		}
    		if (interfaceId == 182 && (componentId == 6 || componentId == 13)) {
    			exitCave(1);
    			return false;
    		}
    		return true;
    	}
    
    	/**
    	 * return process normaly
    	 */
    	@Override
    	public boolean processObjectClick1(WorldObject object) {
    		if (object.getId() == 27331) {
    			if (stage != Stages.RUNNING) {
    				return false;
    			}
    			exitCave(1);
    			return false;
    		}
    		return true;
    	}
    
    	public void loadCave(final boolean login) {
    		this.login = login;
    		stage = Stages.LOADING;
    		player.lock();
    		CoresManager.slowExecutor.execute(new Runnable() {
    			@Override
    			public void run() {
    				boundChuncks = RegionBuilder.findEmptyChunkBound(8, 8);
    				RegionBuilder.copyAllPlanesMap(271, 527, boundChuncks[0], boundChuncks[1], 128);
    				player.setNextWorldTile(getWorldTile(60, 35));
    				player.lock();
    				WorldTasksManager.schedule(new WorldTask() {
    					@Override
    					public void run() {
    						player.getDialogueManager().startDialogue("SimpleNPCMessage", RAIDS_MASTER,
    								"You're on your own now, <br>Prepare to fight for your life!");
    						player.setForceMultiArea(true);
    						player.unlock();
    						stage = Stages.RUNNING;
    					}
    
    				}, 1);
    				if (!login) {
    
    					CoresManager.fastExecutor.schedule(new TimerTask() {
    
    						@Override
    						public void run() {
    							if (stage != Stages.RUNNING) {
    								return;
    							}
    							try {
    								startWave();
    							} catch (Throwable t) {
    								Logger.handle(t);
    							}
    						}
    					}, 6000);
    				}
    			}
    		});
    	}
    
    	public WorldTile getSpawnTile() {
    		switch (Utils.random(4)) {
    		case 0:
    			System.out.println("Test 0");
    			return getWorldTile(45, 53);
    		case 1:
    			System.out.println("Test 1");
    			return getWorldTile(39, 48);
    		default:
    			System.out.println("Test default");
    			return getWorldTile(41, 46);
    		}
    	}
    
    	@Override
    	public void moved() {
    		if (stage != Stages.RUNNING || !login) {
    			return;
    		}
    		login = false;
    		setWaveEvent();
    	}
    
    	public void startWave() {
    		int currentWave = getCurrentWave();
    		if (currentWave > WAVES.length) {
    			win();
    			return;
    		}
    		if (stage != Stages.RUNNING) {
    			return;
    		}
    		for (int id : WAVES[currentWave - 1]) {
    			new RaidsNPC(id, getSpawnTile());
    		}
    		spawned = true;
    	}
    
    	public void win() {
    		if (stage != Stages.RUNNING) {
    			return;
    		}
    		exitCave(4);
    	}
    
    	public void nextWave() {
    		setCurrentWave(getCurrentWave() + 1);
    		setWaveEvent();
    	}
    
    	public void setWaveEvent() {
    		CoresManager.fastExecutor.schedule(new TimerTask() {
    
    			@Override
    			public void run() {
    				try {
    					if (stage != Stages.RUNNING) {
    						return;
    					}
    					startWave();
    				} catch (Throwable e) {
    					Logger.handle(e);
    				}
    			}
    		}, 600);
    	}
    
    	@Override
    	public void process() {
    		if (spawned) {
    			List<Integer> npcs = World.getRegion(player.getRegionId()).getNPCsIndexes();
    			if (npcs == null || npcs.isEmpty()) {
    				spawned = false;
    				nextWave();
    			}
    		}
    	}
    
    	@Override
    	public boolean sendDeath() {
    		player.lock(7);
    		player.stopAll();
    		WorldTasksManager.schedule(new WorldTask() {
    			int loop;
    
    			@Override
    			public void run() {
    				if (loop == 0) {
    					player.setNextAnimation(new Animation(836));
    				} else if (loop == 1) {
    					player.getPackets().sendGameMessage("You have been defeated!");
    				} else if (loop == 3) {
    					player.reset();
    					exitCave(1);
    					player.setNextAnimation(new Animation(-1));
    				} else if (loop == 4) {
    					player.getPackets().sendMusicEffect(90);
    					login();
    				}
    				loop++;
    			}
    		}, 0, 1);
    		return false;
    	}
    
    	@Override
    	public void magicTeleported(int type) {
    		exitCave(2);
    	}
    
    	public void exitCave(int type) {
    		stage = Stages.DESTROYING;
    		if (type == 0) {
    			player.useStairs(-1, OUTSIDE, 0, 1);
    		} else {
    			player.setForceMultiArea(false);
    			player.getPackets().closeInterface(player.getInterfaceManager().hasRezizableScreen() ? 10 : 2);
    			if (type == 1 || type == 4) {
    				player.useStairs(-1, OUTSIDE, 0, 1);
    				if (type == 4) {
    					player.reset();
    					player.getDialogueManager().startDialogue("SimpleNPCMessage", RAIDS_MASTER,
    							"You even defeated all monsters, I am most impressed!",
    							" Please accept this gift as a reward.");
    					player.getPackets().sendGameMessage("You were victorious!!");
    					player.getInventory().addItem(995, 1000000);
    				} else if (getCurrentWave() == 1) {
    					player.getDialogueManager().startDialogue("SimpleNPCMessage", RAIDS_MASTER,
    							"Well I suppose you tried... better luck next time.");
    				} else {
    					player.getDialogueManager().startDialogue("SimpleNPCMessage", RAIDS_MASTER,
    							"Well done in the cave, better luck next time.");
    				}
    			}
    			removeControler();
    		}
    		CoresManager.slowExecutor.schedule(new Runnable() {
    			@Override
    			public void run() {
    				RegionBuilder.destroyMap(boundChuncks[0], boundChuncks[1], 8, 8);
    			}
    		}, 1200, TimeUnit.MILLISECONDS);
    	}
    
    	public WorldTile getWorldTile(int mapX, int mapY) {
    		return new WorldTile(boundChuncks[0] * 8 + mapX, boundChuncks[1] * 8 + mapY, 1);
    	}
    
    	@Override
    	public boolean logout() {
    		if (stage != Stages.RUNNING) {
    			return false;
    		}
    		exitCave(1);
    		return false;
    
    	}
    
    	public int getCurrentWave() {
    		if (getArguments() == null || getArguments().length == 0) {
    			return 1;
    		}
    		return (Integer) getArguments()[0];
    	}
    
    	public void setCurrentWave(int wave) {
    		if (getArguments() == null || getArguments().length == 0) {
    			this.setArguments(new Object[1]);
    		}
    		getArguments()[0] = wave;
    	}
    
    	@Override
    	public void forceClose() {
    		if (stage != Stages.RUNNING) {
    			return;
    		}
    		exitCave(2);
    	}
    }

    Code:
    package com.runescape.world.entity.npc.raids;
    
    import java.util.ArrayList;
    import java.util.List;
    
    import com.runescape.world.World;
    import com.runescape.world.WorldTile;
    import com.runescape.world.entity.Entity;
    import com.runescape.world.entity.npc.NPC;
    import com.runescape.world.entity.player.Player;
    
    @SuppressWarnings("serial")
    public class RaidsNPC extends NPC {
    
    	public RaidsNPC(int id, WorldTile tile) {
    		super(id, tile, -1, true, true);
    		setForceMultiArea(true);
    		setForceAgressive(true);
    		setForceAgressiveDistance(128);
    		setNoDistanceCheck(true);
    	}
    
    	@Override
    	public void sendDeath(Entity source) {
    		super.sendDeath(source);
    	}
    
    	@Override
    	public ArrayList<Entity> getPossibleTargets() {
    		ArrayList<Entity> possibleTarget = new ArrayList<Entity>(1);
    		List<Integer> playerIndexes = World.getRegion(getRegionId()).getPlayerIndexes();
    		if (playerIndexes != null) {
    			for (int npcIndex : playerIndexes) {
    				Player player = World.getPlayers().get(npcIndex);
    				if (player == null || player.isDead() || player.hasFinished() || !player.isRunning()) {
    					continue;
    				}
    				possibleTarget.add(player);
    			}
    		}
    		return possibleTarget;
    	}
    
    }
    Attached image

    Respect goes to everyone as he deserves.
    Reply With Quote  
     

  6. #6  
    Donator


    Join Date
    Jul 2013
    Posts
    1,233
    Thanks given
    1
    Thanks received
    493
    Rep Power
    0
    On my server (it was a pk/spawn) i coded a tournament minigame where players would fight 1v1 until the last 2 winners fought and then they would be given a prize. everything was done automatically except initialization of the minigame where you would select the gear to be used.
    Reply With Quote  
     

  7. #7  
    Registered Member Ombra's Avatar
    Join Date
    Feb 2017
    Posts
    83
    Thanks given
    2
    Thanks received
    25
    Rep Power
    35
    How about a slayer minigame:

    You hop between instances to fight toughened up versions of elite slayer mobs to see how long you can last.
    You could also put in handicaps to increase the challenge. Like time limits and restrictions.
    Sorta like dominion tower and rush of blood mix that doesn't involve staying in the same area.

    As popular as duel arena is there isnt really a deal arena for multiple people in a free for all. could look into it and add optional rules similar to duel arena.
    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

Similar Threads

  1. Simple Minigame - Puppet Problems
    By Whitey in forum Tutorials
    Replies: 28
    Last Post: 08-06-2007, 11:55 AM
  2. cool minigame (pics coming soon)
    By s4n3sc4p3 in forum Tutorials
    Replies: 7
    Last Post: 06-11-2007, 02:22 AM
  3. Barrows Minigame
    By n33bscape in forum Tutorials
    Replies: 5
    Last Post: 06-07-2007, 01:31 AM
  4. EasterEgg Hunt [-Anti-Leech-] (MINIGAME)
    By Nwfd1025 in forum Tutorials
    Replies: 2
    Last Post: 05-07-2007, 09:10 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •