Sonic Wave Healing Undead & Dark Element

dreinor

New member
Messages
54
Points
0
Github
dreinor
hi... can someone help me? i'm trying to customize sonic wave skill.. i want it to heal undead & dark element monsters/players but damage monsters of every other element.. i tried using this code.. the skill hits every other element but when it is targeted on dark/undead element monsters & players, it doesn't heal the target.. it misses.. can someone help me? here is the code that i used..

case RK_SONICWAVE:
     //Will heal dark and undead element monsters/players.
     if (tstatus->def_ele==ELE_UNDEAD || tstatus->def_ele==ELE_DARK) {
       int heal;
       heal = skill->calc_heal(ss,bl,sg->skill_id,sg->skill_lv,true);
       status->heal(bl,heal,0,1);
         break;
       if (status->isimmune(bl))
         heal = 0;
       clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1);
       status->heal(bl, heal, 0, 0);      
     } else {

    //Damage enemies
       if(battle->check_target(&src->bl,bl,BCT_ENEMY)>0)
       skill->attack(BF_MISC, ss, &src->bl, bl, sg->skill_id, sg->skill_lv, tick, 0);
     }
     break;

 
I'm not a coder but perhaps the " clif->skill_nodamage(&src->bl, bl, AL_HEAL, heal, 1); " might be the reason why it is missing?

just my guess. perhaps changing it to something else might work?

 
The part where the skill hits targets that are not dark element & undead is working.. The healing part is not working..
default_sad.png
i tried to create the code from the NPC skill evilland.. I don't know why the healing part is not working..
default_sad.png
anyone willing to help? Btw, thanks aznguy212 for the reply.. But i think the part where skillnodamage is correct because if the target is immune to magic, it will miss..

 
First you need to declare the healing formula for this skill, with your current code it would heal for zero.

 
Last edited by a moderator:
already found the code.. thanks to maluffet for the help..
default_biggrin.png



@skill.c

case RK_SONICWAVE: { int heal = skill->calc_heal(src, bl, (skill_id == AB_HIGHNESSHEAL)?AL_HEAL:skill_id, (skill_id == AB_HIGHNESSHEAL)?10:skill_lv, true); int heal_get_jobexp;     heal_get_jobexp = status->heal(bl,heal,0,3); if( status->isimmune(bl) || (dstmd && (dstmd->class_ == MOBID_EMPERIUM || mob_is_battleground(dstmd))) ) heal=0; if( sd && dstsd && sd->status.partner_id == dstsd->status.char_id && (sd->class_&MAPID_UPPERMASK) == MAPID_SUPER_NOVICE && sd->status.sex == 0 ) heal = heal*2; if( tsc && tsc->count ) { if( tsc->data[SC_KAITE] && !(sstatus->mode&MD_BOSS) ) { //Bounce back heal if (--tsc->data[SC_KAITE]->val2 <= 0) status_change_end(bl, SC_KAITE, INVALID_TIMER); if (src == bl) heal=0; //When you try to heal yourself under Kaite, the heal is voided. else { bl = src; dstsd = sd; } } else if (tsc->data[SC_BERSERK]) heal = 0; //Needed so that it actually displays 0 when healing. } clif->skill_nodamage (src, bl, skill_id, heal, 1); clif->specialeffect(bl, 172, AREA); clif->specialeffect(bl, 7, AREA); if( tsc && tsc->data[SC_AKAITSUKI] && heal && skill_id != HLIF_HEAL ) heal = ~heal + 1; heal_get_jobexp = status->heal(bl,heal,0,0); if(sd && dstsd && heal > 0 && sd != dstsd && battle_config.heal_exp > 0){ heal_get_jobexp = heal_get_jobexp * battle_config.heal_exp / 100; if (heal_get_jobexp <= 0) heal_get_jobexp = 1; pc->gainexp (sd, bl, 0, heal_get_jobexp, false); } } break; case RK_SONICWAVE: //Apparently only player casted skills can be offensive like this. if (sd && (tstatus->def_ele==ELE_GHOST || tstatus->def_ele==ELE_WATER || tstatus->def_ele==ELE_WIND ||tstatus->def_ele==ELE_EARTH || tstatus->def_ele==ELE_NEUTRAL || tstatus->def_ele==ELE_HOLY || tstatus->def_ele==ELE_POISON || tstatus->def_ele==ELE_FIRE)) { if (battle->check_target(src, bl, BCT_ENEMY) < 1) { //Offensive heal does not works on non-enemies. [Skotlex] clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return 0; } return skill->castend_damage_id(src, bl, skill_id, skill_lv, tick, flag); } break;case RK_SONICWAVE: hp = ( status->get_lv(src) + status_get_int(src) ) / 8 * (4 + ( skill_id == RK_SONICWAVE ? ( sd ? pc->checkskill(sd,RK_SONICWAVE) : 10 ) : skill_lv * 2 ) * 8); case RK_SONICWAVE: ad.damage = skill->calc_heal(src, target, skill_id, skill_lv, false);
@battle.c

case RK_SONICWAVE: ad.damage = skill->calc_heal(src, target, skill_id, skill_lv, false);
@skill_db.txt

Code:
2002,9,6,16,7,0x21,0,10,1,yes,0,0,0,magic,0, RK_SONICWAVE,Sonic Wave
 
Last edited by a moderator:
Back
Top