Thread: 718 / 667 Adding Glacors to your Server!

Results 1 to 9 of 9
  1. #1 718 / 667 Adding Glacors to your Server! 
    Banned

    Join Date
    Jan 2012
    Age
    25
    Posts
    2,703
    Thanks given
    906
    Thanks received
    630
    Rep Power
    0
    Credits: 99% Erica
    1% Me
    Also Credit to SyntaxFTW For the Npcspawning.java

    Start Off By Going To Server/Src/Com/Rs/Game/Npc/Combat/Impl
    And Make a new file called GlacorCombat.Java

    Add This Text To The File...

    Spoiler for Glacors.java:
    package com.rs.game.npc.combat.impl;

    import java.util.ArrayList;
    import java.util.HashMap;

    import com.rs.game.Animation;
    import com.rs.game.Entity;
    import com.rs.game.ForceTalk;
    import com.rs.game.Graphics;
    import com.rs.game.Hit;
    import com.rs.game.Hit.HitLook;
    import com.rs.game.World;
    import com.rs.game.WorldTile;
    import com.rs.game.npc.NPC;
    import com.rs.game.npc.combat.CombatScript;
    import com.rs.game.npc.combat.NPCCombatDefinitions;
    import com.rs.game.player.Player;
    import com.rs.game.tasks.WorldTask;
    import com.rs.game.tasks.WorldTasksManager;
    import com.rs.utils.Utils;

    public class GlacorCombat extends CombatScript {

    @Override
    public Object[] getKeys() {
    return new Object[] { 14301 };
    }

    @Override
    public int attack(final NPC npc, final Entity target) {
    final NPCCombatDefinitions defs = npc.getCombatDefinitions();
    int attackStyle = Utils.getRandom(5);

    if (Utils.getRandom(10) == 0) {
    ArrayList<Entity> possibleTargets = npc.getPossibleTargets();
    final HashMap<String, int[]> tiles = new HashMap<String, int[]>();
    for (Entity t : possibleTargets) {
    if (t instanceof Player) {
    Player p = (Player) t;
    if (!p.getMusicsManager().hasMusic(1008)) {
    p.getPackets()
    .sendGameMessage(
    "Hope your enjoying our new Glacor's!");
    }
    }
    String key = t.getX() + "_" + t.getY();
    if (!tiles.containsKey(t.getX() + "_" + t.getY())) {
    tiles.put(key, new int[] { t.getX(), t.getY() });
    }
    }
    WorldTasksManager.schedule(new WorldTask() {
    @Override
    public void run() {
    ArrayList<Entity> possibleTargets = npc
    .getPossibleTargets();
    for (int[] tile : tiles.values()) {

    World.sendGraphics(null, new Graphics(1),
    new WorldTile(tile[0], tile[1], 0));
    for (Entity t : possibleTargets)
    if (t.getX() == tile[0] && t.getY() == tile[1])
    t.applyHit(new Hit(npc,
    Utils.getRandom(150) + 200,
    HitLook.RANGE_DAMAGE));
    }
    stop();
    }

    }, 5);
    } else if (Utils.getRandom(10) == 0) {
    npc.heal(1000);
    npc.setNextForceTalk(new ForceTalk("Thanks for healing me "));
    }
    if (attackStyle == 0) { // normal mage move
    npc.setNextAnimation(new Animation(9967));
    npc.setNextGraphics(new Graphics(902));
    delayHit(
    npc,
    2,
    target,
    getMagicHit(
    npc,
    getRandomMaxHit(npc, 611,
    NPCCombatDefinitions.MAGE, target)));
    World.sendProjectile(npc, target, 2963, 34, 16, 40, 35, 16, 0);
    } else if (attackStyle == 1) { // normal mage move
    npc.setNextAnimation(new Animation(9968));
    npc.setNextGraphics(new Graphics(905));
    delayHit(
    npc,
    2,
    target,
    getRangeHit(
    npc,
    getRandomMaxHit(npc, 291,
    NPCCombatDefinitions.RANGE, target)));
    World.sendProjectile(npc, target, 1904, 34, 16, 30, 35, 16, 0);

    WorldTasksManager.schedule(new WorldTask() {

    @Override
    public void run() {
    target.setNextGraphics(new Graphics(1910));
    }

    }, 2);

    } else if (attackStyle == 2) {
    npc.setNextAnimation(new Animation(9967));
    npc.setNextGraphics(new Graphics(902));
    World.sendProjectile(npc, target, 1899, 34, 16, 30, 95, 16, 0);
    delayHit(
    npc,
    4,
    target,
    getMagicHit(
    npc,
    getRandomMaxHit(npc, 517,
    NPCCombatDefinitions.MAGE, target)));
    } else if (attackStyle == 3) {
    npc.setNextAnimation(new Animation(9967));
    npc.setNextGraphics(new Graphics(902));
    target.setNextGraphics(new Graphics(2954));

    delayHit(
    npc,
    2,
    target,
    getMagicHit(npc, target.getMaxHitpoints() - 1 > 200 ? 200
    : target.getMaxHitpoints() - 1));
    } else if (attackStyle == 4) {
    /*
    * 11364 - even better k0 move. fire balls from sky into everyone
    * 80% max hp or gfx 2600 everyone near dies
    */
    npc.setNextAnimation(new Animation(9967));
    npc.setCantInteract(true);
    npc.getCombat().removeTarget();
    WorldTasksManager.schedule(new WorldTask() {

    @Override
    public void run() {
    for (Entity t : npc.getPossibleTargets()) {
    t.applyHit(new Hit(npc, (int) (t.getHitpoints() * Math
    .random()), HitLook.MAGIC_DAMAGE, 0));
    }
    npc.getCombat().addCombatDelay(3);
    npc.setCantInteract(false);
    npc.setTarget(target);
    }

    }, 4);
    return 0;
    } else if (attackStyle == 5) {
    npc.setCantInteract(true);
    npc.setNextAnimation(new Animation(9967));
    npc.setNextGraphics(new Graphics(902));
    npc.getCombat().removeTarget();
    WorldTasksManager.schedule(new WorldTask() {
    @Override
    public void run() {
    npc.setCantInteract(false);
    npc.setTarget(target);
    int size = npc.getSize();
    int[][] dirs = Utils.getCoordOffsetsNear(size);
    for (int dir = 0; dir < dirs[0].length; dir++) {
    final WorldTile tile = new WorldTile(new WorldTile(
    target.getX() + dirs[0][dir], target.getY()
    + dirs[1][dir], target.getPlane()));
    if (World.canMoveNPC(tile.getPlane(), tile.getX(),
    tile.getY(), size)) { // if found done
    npc.setNextWorldTile(tile);
    }
    }
    }
    }, 3);
    return defs.getAttackDelay();
    }

    return defs.getAttackDelay();
    }
    }


    Next You Should Teleport To The Glacor's Cave In your Server With the following Coordinates.... 4188 5720 0

    Now You Either Want to use an optional way but I use this method with npcspawning.java use the following link for this method click here

    Thankyou for reading my tutorial I hope you found it useful A like would benice
     

  2. #2  
    Registered Member
    Sirloin's Avatar
    Join Date
    Feb 2012
    Age
    27
    Posts
    782
    Thanks given
    186
    Thanks received
    175
    Rep Power
    105
    You just reposted what erica had already posted, what was the 1% given to yourself?
    The spoiler is Glacors.java, but the class is GlacorCombat...
    ???
     

  3. #3  
    The Emperor of the Sands

    Azir's Avatar
    Join Date
    Nov 2008
    Posts
    2,466
    Thanks given
    8
    Thanks received
    487
    Rep Power
    117
    there is not point to this.. being here..


     

  4. #4  
    Banned

    Join Date
    Jan 2012
    Age
    25
    Posts
    2,703
    Thanks given
    906
    Thanks received
    630
    Rep Power
    0
    Makes it Easier for some people to understand...
     

  5. #5  
    Registered Member Taylor Moon's Avatar
    Join Date
    Aug 2012
    Posts
    2,565
    Thanks given
    625
    Thanks received
    1,303
    Rep Power
    66
    Quote Originally Posted by Rentedo999 View Post
    Makes it Easier for some people to understand...
    What are you talking about
     

  6. #6  
    Registered Member
    Sirloin's Avatar
    Join Date
    Feb 2012
    Age
    27
    Posts
    782
    Thanks given
    186
    Thanks received
    175
    Rep Power
    105
    Quote Originally Posted by Rentedo999 View Post
    Makes it Easier for some people to understand...
    If you wanted to make it easier for people to understand, atleast use code tags.
     

  7. #7  
    Banned

    Join Date
    Mar 2010
    Posts
    1,092
    Thanks given
    214
    Thanks received
    117
    Rep Power
    0
    Stop stealing my work and making your own post for Postcount, and for thanks/reps. You aren't getting any, cause you did nothing. DO NOT EVER USE MY WORK IN YOUR POSTS!
     


  8. #8 Lmfao 
    Registered Member
    efosomnus's Avatar
    Join Date
    Jul 2011
    Age
    31
    Posts
    69
    Thanks given
    22
    Thanks received
    2
    Rep Power
    118
    Quote Originally Posted by erica View Post
    Stop stealing my work and making your own post for Postcount, and for thanks/reps. You aren't getting any, cause you did nothing. DO NOT EVER USE MY WORK IN YOUR POSTS!
    LMAO rep+ erica that made my day.. >:[] STAND UP FOR WHATS YOURS! WAY 2 GO! i recommended a /close request already to a mod...
    Working on a server using VichY's source.
    Thanks bro.
    50% Done


    Xenon4Pres
     

  9. #9  
    Xenon
    Guest
     

  10. Thankful user:



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: 87
    Last Post: 09-14-2015, 04:04 PM
  2. [667] or [718] Custom Glacors xD
    By erica in forum Snippets
    Replies: 21
    Last Post: 06-24-2013, 01:50 AM
  3. [667/***] Glacors fire weekness
    By erica in forum Snippets
    Replies: 9
    Last Post: 08-20-2012, 12:15 PM
  4. [667/?]Glacors
    By EpicMeme in forum Snippets
    Replies: 10
    Last Post: 08-10-2012, 07:16 PM
  5. [667] Glacors
    By erica in forum Snippets
    Replies: 23
    Last Post: 06-08-2012, 02:49 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
  •