Thread: [Ethos] Boss scripts

Results 1 to 10 of 10
  1. #1 [Ethos] Boss scripts 
    Registered Member
    Join Date
    Jun 2018
    Posts
    54
    Thanks given
    5
    Thanks received
    2
    Rep Power
    11
    So I'm working on doing boss scripts for practice and I was looking at having a boss spawn some minions.

    I want to either add these minions to an array and pick a random one to be the key that allows you to attack the boss again once it has been killed. What would be the best way to assign this role to a specific npc?

    I'd also want all the minions in the area to die along with the key when it has been defeated how would I go about killing specific npcs in a region?

    I was also looking at the demonic gorilla boulder throws as well as the great olm crystal projectiles falling from the sky, I was wondering how I'd look at implementing projectiles that randomly fall and deal damage

    Thanks.

    Edit:
    So I've been thinking about it and I think the best way to do the minions would be something along these lines

    I wanna say check the area for npcs (not entirely sure how to go about this part yet) and then adding all the minion spawns to an array.

    looping through this array and assigning the key boolean to a random npc in this array.

    hopefully that makes sense lol
    Reply With Quote  
     

  2. #2  
    Registered Member
    Grant_'s Avatar
    Join Date
    Aug 2014
    Posts
    491
    Thanks given
    93
    Thanks received
    104
    Rep Power
    116
    Quote Originally Posted by DivinityGang View Post
    So I'm working on doing boss scripts for practice and I was looking at having a boss spawn some minions.

    I want to either add these minions to an array and pick a random one to be the key that allows you to attack the boss again once it has been killed. What would be the best way to assign this role to a specific npc?

    I'd also want all the minions in the area to die along with the key when it has been defeated how would I go about killing specific npcs in a region?

    I was also looking at the demonic gorilla boulder throws as well as the great olm crystal projectiles falling from the sky, I was wondering how I'd look at implementing projectiles that randomly fall and deal damage

    Thanks.

    Edit:
    So I've been thinking about it and I think the best way to do the minions would be something along these lines

    I wanna say check the area for npcs (not entirely sure how to go about this part yet) and then adding all the minion spawns to an array.

    looping through this array and assigning the key boolean to a random npc in this array.

    hopefully that makes sense lol
    A lot of different approaches can be utilized with what you are trying to accomplish, but let me see if I can outline some helpful bits for you.

    * Assuming your core class is a manager for this boss, why not have a variable called keyNPC that is assigned the NPC instance of one of the minions. When a minion is killed you can check that keyNPC's index is equal to the NPC that has been killed and move forward from there.

    * In terms of killing NPC's from a region you will need to look into how your NPCManager/NPCHandler/EntityHandler, whatever your source has as the core NPC functionality class, and see how it handles killing/destroying NPCs (and their instance).

    * You will need to write a method in order to create generic projectiles that are separated from an entity.

    As I said there are plenty of approaches to accomplishing this. Your class architecture of how you designed the boss script will inevitably determine how you go about this.
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Jun 2018
    Posts
    54
    Thanks given
    5
    Thanks received
    2
    Rep Power
    11
    Quote Originally Posted by Grant_ View Post
    * You will need to write a method in order to create generic projectiles that are separated from an entity.
    There's already this method
    Code:
    private void createProjectile(int x, int y, int offX, int offY, int angle, int speed, int gfxMoving,
    			int startHeight, int endHeight, int lockon, int time) {
    		// synchronized(c) {
    		if (c.getOutStream() != null && c != null) {
    			c.getOutStream().createFrame(85);
    			c.getOutStream().writeByteC((y - (c.getMapRegionY() * 8)) - 2);
    			c.getOutStream().writeByteC((x - (c.getMapRegionX() * 8)) - 3);
    			c.getOutStream().createFrame(117);
    			c.getOutStream().writeByte(angle);
    			c.getOutStream().writeByte(offY);
    			c.getOutStream().writeByte(offX);
    			c.getOutStream().writeWord(lockon);
    			c.getOutStream().writeWord(gfxMoving);
    			c.getOutStream().writeByte(startHeight);
    			c.getOutStream().writeByte(endHeight);
    			c.getOutStream().writeWord(time);
    			c.getOutStream().writeWord(speed);
    			c.getOutStream().writeByte(16);
    			c.getOutStream().writeByte(64);
    			c.flushOutStream();
    
    		}
    	}
    but obviously that's just one projectile and I'm wanting projectiles to continuously come down like 30 of them, and I can't figure out the best way to do this.
    Reply With Quote  
     

  4. #4  
    RuneTimes

    RainDropzZ's Avatar
    Join Date
    Oct 2010
    Posts
    292
    Thanks given
    25
    Thanks received
    80
    Rep Power
    333
    Quote Originally Posted by DivinityGang View Post
    but obviously that's just one projectile and I'm wanting projectiles to continuously come down like 30 of them, and I can't figure out the best way to do this.
    Then you should learn the java basics first. You can do that with simple loops or via a task system.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Jan 2019
    Posts
    26
    Thanks given
    4
    Thanks received
    16
    Rep Power
    29
    Solved this or still need advice? Sort of did something like this before.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Join Date
    Jun 2018
    Posts
    54
    Thanks given
    5
    Thanks received
    2
    Rep Power
    11
    Quote Originally Posted by Jhin 7F View Post
    Solved this or still need advice? Sort of did something like this before.
    Haven't achieved it yet
    Reply With Quote  
     

  7. #7  
    Registered Member
    Join Date
    Jun 2018
    Posts
    54
    Thanks given
    5
    Thanks received
    2
    Rep Power
    11
    bump

    Still haven't figured out how to implement the crystals falling from the sky, any advice?
    Reply With Quote  
     

  8. #8  
    Registered Member
    Join Date
    Jan 2019
    Posts
    26
    Thanks given
    4
    Thanks received
    16
    Rep Power
    29
    Quote Originally Posted by DivinityGang View Post
    bump

    Still haven't figured out how to implement the crystals falling from the sky, any advice?
    You could put the coords in an array and loop through them while calling the createProjectile() method for each coord being looped through in the array.
    Reply With Quote  
     

  9. #9  
    Registered Member
    Join Date
    Jun 2018
    Posts
    54
    Thanks given
    5
    Thanks received
    2
    Rep Power
    11
    Quote Originally Posted by Jhin 7F View Post
    You could put the coords in an array and loop through them while calling the createProjectile() method for each coord being looped through in the array.
    Can you elaborate?
    Reply With Quote  
     

  10. #10  
    Registered Member
    Join Date
    Jan 2019
    Posts
    26
    Thanks given
    4
    Thanks received
    16
    Rep Power
    29
    Quote Originally Posted by DivinityGang View Post
    Can you elaborate?
    Code:
    // The tiles & method would be in boss class
    
    /*We store the values of the designated tiles you want to launch the projectiles on here. 
    They do not have to be hard coded like I did. You could create a method that loads tiles based on players present etc.*/
    
    private Tile[] tiles = new Tile[] { new Tile(3333, 3333, 0), new Tile(3330, 3333, 0), new Tile(3332, 3333, 0) };
     
    /*This is your method in boss class that launches the projectiles. It uses the values in the tiles array to determine
    the location for the projectiles. You will have to input the values though. I just used 0's and 1's for example.*/
    
    public void launchProjectiles() {
        for(Tile tile : tiles) {
            createProjectile(tile.getX(), tile.getY(), 0, 0, 1, 1, 1, 1, 1, 1, 1);
        }
    }
    
    // We have your createProjectile method here which is most likely in another class. I just have this here for visual.
    
    private void createProjectile(int x, int y, int offX, int offY, int angle, int speed, int gfxMoving,
                int startHeight, int endHeight, int lockon, int time) {
            // synchronized(c) {
            if (c.getOutStream() != null && c != null) {
                c.getOutStream().createFrame(85);
                c.getOutStream().writeByteC((y - (c.getMapRegionY() * 8)) - 2);
                c.getOutStream().writeByteC((x - (c.getMapRegionX() * 8)) - 3);
                c.getOutStream().createFrame(117);
                c.getOutStream().writeByte(angle);
                c.getOutStream().writeByte(offY);
                c.getOutStream().writeByte(offX);
                c.getOutStream().writeWord(lockon);
                c.getOutStream().writeWord(gfxMoving);
                c.getOutStream().writeByte(startHeight);
                c.getOutStream().writeByte(endHeight);
                c.getOutStream().writeWord(time);
                c.getOutStream().writeWord(speed);
                c.getOutStream().writeByte(16);
                c.getOutStream().writeByte(64);
                c.flushOutStream();
    
            }
        }
    }
    For example
    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. Replies: 2
    Last Post: 10-26-2017, 02:21 AM
  2. RS3 Boss script
    By Allah Akbar in forum Buying
    Replies: 0
    Last Post: 08-29-2017, 11:47 PM
  3. Boss Scripts
    By kyoto in forum Buying
    Replies: 0
    Last Post: 03-05-2016, 10:11 PM
  4. [Buying-PP] 718 Full Vorago (model/anims/boss script)
    By OodlesOfNoodles in forum Buying
    Replies: 1
    Last Post: 08-21-2015, 10:08 PM
  5. Replies: 1
    Last Post: 09-09-2013, 04:09 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
  •