Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Help HeavenMS MobSkill Dispel How to ignore specific skills

Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
Hello! :eek:tt1:

I'm having some trouble figuring what to add in specific into the code to make the Dispel of Bosses ignore a specific skill or skills in this case..

All i have figure out is that i have to add an array (so i think) into MobSkill.java :

PHP:
case 127:                if (lt != null && rb != null && skill) {                    for (MapleCharacter character : getPlayersInRange(monster)) {                        character.dispel();                    }                } else {                    player.dispel();                }                break;

I need help on how to add, for example Magic Guard of explorers whose code is 2001002 into the code to make the Dispel ignore it..
Maybe i'm totally wrong and there exists a simple and easy way to do it instead so please any help would be greatly appreciated :dancemental:
 
Last edited:
Newbie Spellweaver
Joined
Jul 31, 2013
Messages
30
Reaction score
21
If you look inside the MapleCharacter.dispel method, it looks like there's an Aran Combo Ability check which prevents the buff from being cancelled.

This is just my guess but you can probably add a check for Magic Guard:

Code:
if (mbsvh.effect.getBuffSourceId() != Aran.COMBO_ABILITY  // check discovered thanks to Croosade dev team
        && mbsvh.effect.getBuffSourceId() != Magician.MAGIC_GUARD
        && mbsvh.effect.getBuffSourceId() != BlazeWizard.MAGIC_GUARD) {

or inside MapleCharacter.getAllStatups change the inner loop to check if the key is MapleBuffStat.MAGIC_GUARD
For example:

Code:
for (Map<MapleBuffStat, MapleBuffStatValueHolder> bel : buffEffects.values()) {
    for (Entry<MapleBuffStat, MapleBuffStatValueHolder> entry : bel.entrySet()) {
        if (entry.getKey() == MapleBuffStat.MAGIC_GUARD) continue;
        ret.add(entry.getValue());
    }
}
 
Upvote 0
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
If you look inside the MapleCharacter.dispel method, it looks like there's an Aran Combo Ability check which prevents the buff from being cancelled.

This is just my guess but you can probably add a check for Magic Guard:

Code:
if (mbsvh.effect.getBuffSourceId() != Aran.COMBO_ABILITY  // check discovered thanks to Croosade dev team
        && mbsvh.effect.getBuffSourceId() != Magician.MAGIC_GUARD
        && mbsvh.effect.getBuffSourceId() != BlazeWizard.MAGIC_GUARD) {

The first one worked like a charm..!! All i did is adding another line similar as you recomended and it ended like this:

Code:
       public void dispel() {       
             if(!(YamlConfig.config.server.USE_UNDISPEL_HOLY_SHIELD && this.hasActiveBuff(Bishop.HOLY_SHIELD))) {   
                List<MapleBuffStatValueHolder> mbsvhList = getAllStatups();            
                  for (MapleBuffStatValueHolder mbsvh : mbsvhList) { 
                      if (mbsvh.effect.isSkill()) {
                        if (mbsvh.effect.getBuffSourceId() != Aran.COMBO_ABILITY)
                        if (mbsvh.effect.getBuffSourceId() != Magician.MAGIC_GUARD)
                        if (mbsvh.effect.getBuffSourceId() != BlazeWizard.MAGIC_GUARD)
                        if (mbsvh.effect.getBuffSourceId() != Legend.ECHO_OF_HERO)
                        if (mbsvh.effect.getBuffSourceId() != Noblesse.ECHO_OF_HERO)
                        if (mbsvh.effect.getBuffSourceId() != Beginner.ECHO_OF_HERO){ // check discovered thanks to Croosade dev team

I really thank you alot for the help and please accept a virtual hug :D..
 
Last edited:
Upvote 0
Mythic Archon
Joined
Jul 2, 2013
Messages
723
Reaction score
70
The first one worked like a charm..!! All i did is adding another line similar as you recomended and it ended like this:

I really thank you alot for the help and please accept a virtual hug :D..

This is not really answering your question, but I would recommend using a switch statement in this case as it is more manageable and is generally faster in these cases.


Code:
[COLOR=#cc7832]for [/COLOR](MapleBuffStatValueHolder [COLOR=#9876aa]mbsvh [/COLOR]: getAllStatups()) [COLOR=#000000]{[/COLOR][COLOR=#cc7832]    
    switch [/COLOR](mbsvh.effect.getBuffSourceId()) {
        [COLOR=#cc7832]case [/COLOR]Aran.COMBO_ABILITY:
        [COLOR=#cc7832]case [/COLOR]Magician.MAGIC_GUARD:
        [COLOR=#cc7832]case [/COLOR]BlazeWizard.MAGIC_GUARD:
        [COLOR=#cc7832]case [/COLOR]Legend.ECHO_OF_HERO:
        [COLOR=#cc7832]case [/COLOR]Noblesse.ECHO_OF_HERO:
        [COLOR=#cc7832]case [/COLOR]Beginner.ECHO_OF_HERO:
            [COLOR=#cc7832]continue;
[/COLOR][COLOR=#cc7832]        default[/COLOR]:
            cancelEffect(mbsvh.effect[COLOR=#cc7832], false, [/COLOR]mbsvh.startTime)[COLOR=#cc7832];
[/COLOR]    }
}
 
Upvote 0
Junior Spellweaver
Joined
Sep 20, 2019
Messages
108
Reaction score
8
Code:
[COLOR=#cc7832]for [/COLOR](MapleBuffStatValueHolder [COLOR=#9876aa]mbsvh [/COLOR]: getAllStatups()) [COLOR=#000000]{[/COLOR][COLOR=#cc7832]    
    switch [/COLOR](mbsvh.effect.getBuffSourceId()) {
        [COLOR=#cc7832]case [/COLOR]Aran.COMBO_ABILITY:
        [COLOR=#cc7832]case [/COLOR]Magician.MAGIC_GUARD:
        [COLOR=#cc7832]case [/COLOR]BlazeWizard.MAGIC_GUARD:
        [COLOR=#cc7832]case [/COLOR]Legend.ECHO_OF_HERO:
        [COLOR=#cc7832]case [/COLOR]Noblesse.ECHO_OF_HERO:
        [COLOR=#cc7832]case [/COLOR]Beginner.ECHO_OF_HERO:
            [COLOR=#cc7832]continue;
[/COLOR][COLOR=#cc7832]       default[/COLOR]:
            cancelEffect(mbsvh.effect[COLOR=#cc7832], false, [/COLOR]mbsvh.startTime)[COLOR=#cc7832];
[/COLOR]   }
}

Works pretty fine too! I just tried it and didn't know about it either, thank you as well.
 
Last edited:
Upvote 0
Back
Top