AntiKS System

Page 1 of 6 123456 LastLast
Results 1 to 15 of 80
  1. #1
    Account Inactive Emilyx3 is offline
    InactiveRank
    Apr 2009 Join Date
    393Posts

    AntiKS System


    RaGEZONE Recommends

    RaGEZONE Recommends

    Implementation:
    If a person has @antiks active and they hit a monster, they will have 30 seconds to kill the monster before anyone else can damage it. After this period, the monster cannot be controlled again, and is available for everyone to hit.

    If the person leaves the map, he loses antiks on all monsters on the map.

    You can only gain control of 3 monsters per attack.

    You can only control a maximum of 10 monsters.

    Command:
    PHP Code:
    else if (splitted[0].equals("@antiks")) {
        
    MapleCharacter player c.getPlayer();
        if (
    player.getAntiKS()) {
            
    player.dropMessage("AntiKS deactivated.");
        } else {
            
    player.dropMessage("AntiKS activated.");
        }
        
    player.setAntiKS(!player.getAntiKS());

    Add to MapleCharacter.java
    PHP Code:
      private boolean antiKS false;
      public 
    boolean getAntiKS() {
          return 
    antiKS;
      }
      public 
    void setAntiKS(boolean b) {
          
    antiKS b;
      }
      private 
    byte numAntiKSMonsters 0;
      public 
    byte getNumAntiKSMonsters() {
          return 
    numAntiKSMonsters;
      }
      public 
    void incAntiKSNum() {
          
    numAntiKSMonsters++;
      }
      public 
    void decAntiKSNum() {
          if (
    numAntiKSMonsters 0)
              
    numAntiKSMonsters--;
          }
      } 
    In AbstractDealDamageHandler.java:
    Before:
    Code:
    for (Pair<Integer, List<Integer>> oned : attack.allDamage) {
    Add:
    PHP Code:
    int antiKS 0
    After:
    Code:
    MapleMonster monster = map.getMonsterByOid(oned.getLeft().intValue());
    
                if (monster != null) {
    Add:
    PHP Code:
    if (monster.getBelongsToSomeone() && monster.getBelongsTo() != player.getId() && !player.isGM()) {
        
    player.dropMessage("You cannot hit this monster because it belongs to someone else.");
        continue;
    }
    if (
    player.getAntiKS() && antiKS && monster.getCanBelong() && player.getNumAntiKSMonsters() < 10) {
        
    monster.setBelongsTo(player);
        
    antiKS++;
        
    player.incAntiKSNum();

    In MapleCharacter.java, in changeMapInternal() in the Runnable:
    After
    Code:
    map.removePlayer(MapleCharacter.this);
    Add:
    PHP Code:
    try {
                        List<
    MapleMapObjectmonsters map.getAllMonster();
                        for (
    MapleMapObject mmo monsters) {
                            
    MapleMonster m = (MapleMonstermmo;
                            if (
    m.getBelongsTo() == getId()) {
                                
    decAntiKSNum();
                                
    m.expireAntiKS();
                            }
                        }
                    } catch (
    Exception e) {
                    } 
    In MapleMap.java:
    Add:
    PHP Code:
    public final List<MapleMapObjectgetAllMonster() {
            return 
    getMapObjectsInRange(new Point(00), Double.POSITIVE_INFINITYArrays.asList(MapleMapObjectType.MONSTER));
        } 
    In MapleMonster.java:
    Add:
    PHP Code:
        private int belongsTo = -1;
        private 
    long endBelong;

        public 
    boolean getBelongsToSomeone() {
            return 
    belongsTo != -&& endBelong System.currentTimeMillis();
        }

        public 
    int getBelongsTo() {
            return 
    belongsTo;
        }

        public 
    long getBelongTimeLeft() {
            if (
    getBelongsToSomeone()) {
                return 
    endBelong System.currentTimeMillis();
            } else {
                return 
    0;
            }
        }

        public 
    boolean getCanBelong() {
            return 
    belongsTo == -1;
        }

        public 
    void expireAntiKS() {
            
    belongsTo = -2;
            
    //endBelong = System.currentTimeMillis();
        
    }

        public 
    void setBelongsTo(MapleCharacter chr) { //Only let it be controlled once.
            
    if (belongsTo != -1) {
                return;
            }
            
    belongsTo chr.getId();
            
    endBelong System.currentTimeMillis() + 30000//30 seconds for the person to kill it.
        

    Needs to be tested though. Enjoy~

    Edit: Fixed one error. You may want to disable this in events =P
    Edit2: Implementation Details.

    Edit3: Include Parties: AntiKS System
    Edits for Bosses: AntiKS System
    Edit4: Bug Fix.
    Last edited by Emilyx3; 28-08-10 at 02:33 PM. Reason: BugFix


  2. #2
    Account Inactive iFayte is offline
    InactiveRank
    Aug 2009 Join Date
    164Posts

    Re: AntiKS System

    I like this system emily :) Il be using this thank you :)

  3. #3
    I'm overrated. Fraysa is offline
    GammaRank
    Apr 2008 Join Date
    4,763Posts

    Re: AntiKS System

    I didn't know girls can code, sexy.
    Uhm so yeah! On topic - Nice, good work.

  4. #4
    Account Inactive Reinier324 is offline
    InactiveRank
    Mar 2009 Join Date
    AmsterdamLocation
    202Posts

    Re: AntiKS System

    Really nice!

  5. #5
    Account Inactive Soul is offline
    InactiveRank
    Aug 2009 Join Date
    646Posts

    Re: AntiKS System

    This is really cool.

  6. #6
    Custom title enabled Carrino is offline
    Mar 2010 Join Date
    1,126Posts

    Re: AntiKS System

    Quote Originally Posted by Google View Post
    I didn't know girls can code, sexy.
    Uhm so yeah! On topic - Nice, good work.
    Some are better than us

  7. #7
    Account Inactive owl is offline
    InactiveRank
    Aug 2010 Join Date
    181Posts

    Re: AntiKS System

    Emily codes better than 90% of the rz community, including me ):

    You strike once again, Emily!

  8. #8
    Custom title enabled Carrino is offline
    Mar 2010 Join Date
    1,126Posts

    Re: AntiKS System

    Quote Originally Posted by owl View Post
    Emily codes better than 90% of the rz community, including me ):

    You strike once again, Emily!
    Fuck you.

  9. #9
    bleh.... Shawn is offline
    The OmegaRank
    Oct 2008 Join Date
    Mississauga, CaLocation
    6,123Posts

    Re: AntiKS System

    Quote Originally Posted by Carrino View Post
    Fuck you.
    Why? Because what he said is true? Emily is a great coder. He/She actually knows his/her shit and is one of the few "good coders" that help people in this community.

    OnTopic: Great release Emily. I've always wondered why something like this was never introduced considering one of the biggest problems with private servers (and the real MS) is Kill Stealing.
    Last edited by Shawn; 23-08-10 at 06:39 PM.

    Quote Originally Posted by Russell Peters
    I have a theory. I believe that the size of your penis is in indirect correlation with how much sex you will have in your life. The smaller your dick, the more you will fuck. You dont believe me, look at the two largest populations in the world

    RIP Akaruz, The Godfather

    Spoiler:

    mental is hot
    Spoiler:

    This is a true story
    Spoiler:

    This message is endorsed by Shawn and not added by MentaL.



  10. #10
    Custom title enabled Carrino is offline
    Mar 2010 Join Date
    1,126Posts

    Re: AntiKS System

    Quote Originally Posted by Shawn View Post
    Why? Because what he said is true? Emily is a great coder. He/She actually knows his/her shit and is one of the few "good coders" that help people in this community.

    OnTopic: Great release Emily. I've always wondered why something like this was never introduced considering one of the biggest problems with private servers (and the real MS) is Kill Stealing.
    Emily.. I know that he/she is a great coder, but I can't believe he said, "including me".

    Shawn aka Devons, learn to read properly in future.

  11. #11
    is back. Xerixe is offline
    GammaRank
    Apr 2008 Join Date
    MalaysiaLocation
    3,618Posts

    Re: AntiKS System

    Aw, what if I wanted to kill a super high hp boss and it's a no rebirth server :(. i r get ksed :(
    “To live is the rarest thing in the world. Most people exist, that is all.”

  12. #12
    Custom title enabled Carrino is offline
    Mar 2010 Join Date
    1,126Posts

    Re: AntiKS System

    Quote Originally Posted by Xerixe View Post
    Aw, what if I wanted to kill a super high hp boss and it's a no rebirth server :(. i r get ksed :(
    Zakum, horntail.

    Emily, make a boss-check.

  13. #13
    Account Inactive Control is offline
    InactiveRank
    Aug 2010 Join Date
    /b/Location
    324Posts

    Re: AntiKS System

    Great release indeed. I'll be using this one =D

  14. #14
    Account Inactive owl is offline
    InactiveRank
    Aug 2010 Join Date
    181Posts

    Re: AntiKS System

    Quote Originally Posted by Carrino View Post
    Emily.. I know that he/she is a great coder, but I can't believe he said, "including me".

    Shawn aka Devons, learn to read properly in future.
    "Including me", I meant myself.. What's your problem?

  15. #15
    Account Inactive Emilyx3 is offline
    InactiveRank
    Apr 2009 Join Date
    393Posts

    Re: AntiKS System

    Quote Originally Posted by Carrino View Post
    Zakum, horntail.

    Emily, make a boss-check.
    Easy edit,
    Increase time for bosses:
    MapleMonster.java, setBelongsTo():
    PHP Code:
            endBelong System.currentTimeMillis() + (isBoss() ? 300000 30000); //30 seconds for the person to kill it. 5 Minutes to kill boss. Edit at your leisure. 
    Disable on Bosses:
    MapleMonster.java, setBelongsTo():
    PHP Code:
    public void setBelongsTo(MapleCharacter chr) { //Only let it be controlled once.
            
    if (belongsTo != -1) {
                return;
            }
            if (
    isBoss()) {
                
    belongsTo = -2;
                return;
            }
            
    belongsTo chr.getId();
            
    endBelong System.currentTimeMillis() + 30000//30 seconds for the person to kill it.
        

    Last edited by Emilyx3; 23-08-10 at 09:41 PM.




Page 1 of 6 123456 LastLast

Advertisement