AntiKS System

Wow this is amazing O_O I've never seen anything else like it. It still sucks if you have someone in your map and they just kill monsters that you haven't gotten to yet though.
 
Does this works for anyone else? I implemented and It didn't work, activated AntiKS but They can still KS. Might be i added wrong, but Anyone tested yet?

lookie at the first line :) in case you tested it on a gm account
PHP:
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 < 3 && monster.getCanBelong() && player.getNumAntiKSMonsters() < 10) {
    monster.setBelongsTo(player);
    antiKS++;
}
 
lookie at the first line :) in case you tested it on a gm account
PHP:
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 < 3 && monster.getCanBelong() && player.getNumAntiKSMonsters() < 10) {
    monster.setBelongsTo(player);
    antiKS++;
}

Nah, I thought of that earlier. I de-gmed myself, and my other testing char.
 
Sorry guys, I corrected the error.
I had
Code:
public boolean getBelongsToSomeone() {
        return belongsTo != -1 && endBelong < System.currentTimeMillis();
    }
instead of
Code:
public boolean getBelongsToSomeone() {
        return belongsTo != -1 && endBelong > System.currentTimeMillis();
    }

=( Stupid less/greater than signs.

Also, You should readd the AbstractDealDamageHandler addons, I didn't remember to increment the player's antiKS num, so the player would be able to control as many monsters as he/she wanted.

Correct version is in my first post. Let me know if you find any more bugs.
 
lookie at the first line :) in case you tested it on a gm account
PHP:
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 < 3 && monster.getCanBelong() && player.getNumAntiKSMonsters() < 10) {
    monster.setBelongsTo(player);
    antiKS++;
}

Please learn what an Operator is...

!player.isGm() is checking to see if they are NOT a GM. So, that message would only show up if they were not a GM.
 
Please learn what an Operator is...

!player.isGm() is checking to see if they are NOT a GM. So, that message would only show up if they were not a GM.
The way I saw the situation, the system wasn't working (the message would be, one way to check if its working), and he told the other person who didn't have it working to check if they were on a GM. So it would make sense if it didn't work, in case they were GM.

Of course that wasn't the case.
 
The way I saw the situation, the system wasn't working (the message would be, one way to check if its working), and he told the other person who didn't have it working to check if they were on a GM. So it would make sense if it didn't work, in case they were GM.

Of course that wasn't the case.

someone that can actually read what i said correctly.
 
Back