Jump to content
  • 0
Sign in to follow this  
dreinor

Sonic Wave Healing Undead & Dark Element

Question

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;

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

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?

Share this post


Link to post
Share on other sites
  • 0

The part where the skill hits targets that are not dark element & undead is working.. The healing part is not working..:( i tried to create the code from the NPC skill evilland.. I don't know why the healing part is not working..:( 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..

Share this post


Link to post
Share on other sites
  • 0

already found the code.. thanks to maluffet for the help.. :D


@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

2002,9,6,16,7,0x21,0,10,1,yes,0,0,0,magic,0, RK_SONICWAVE,Sonic Wave
Edited by dreinor

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.