Jump to content
  • 0
dreinor

Spell Breaker new Effect

Question

I want to have a new effect in the skill spell breaker.. I want it to work that whenever the caster breaks a target's spell, the specific spell that was casted will be on forced cooldown for 5 secs, the target can still cast other spells but not the disrupted one.. this is the part of the skill that disrupts the casting,

case SA_SPELLBREAKER:

{

int sp;

if(tsc && tsc->data[sC_MAGICROD]) {

sp = skill_get_sp(skill_id,skill_lv);

sp = sp * tsc->data[sC_MAGICROD]->val2 / 100;

if(sp < 1) sp = 1;

status_heal(bl,0,sp,2);

status_percent_damage(bl, src, 0, -20, false); //20% max SP damage.

} else {

struct unit_data *ud = unit_bl2ud(bl);

int bl_skill_id=0,bl_skill_lv=0,hp = 0;

if (!ud || ud->skilltimer == INVALID_TIMER)

break; //Nothing to cancel.

bl_skill_id = ud->skill_id;

bl_skill_lv = ud->skill_lv;

if (tstatus->mode & MD_BOSS)

{ //Only 10% success chance against bosses. [skotlex]

if (rnd()%100 < 90)

{ if (sd) clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);

break;

}

is this the code for the effect that i want?

 

if (sd) skill_blockpc_start (sd, ud->skill_id, 5000) ? if it is the code, where should i put it? sorry i'm not that good at this..

Edited by dreinor

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

you can check 'skill_cast_db.txt' if you just want a cooldown for a skill

 

SkillID,CastingTime,AfterCastActDelay,AfterCastWalkDelay,Duration1,Duration2,Cool Down,Fixed Casting Time

 

:meow:

Share this post


Link to post
Share on other sites
  • 0

@malufett

Hi, thanks for the reply..:) the effect that i want to have in spell break is that for example.. I successfully casted spell break on the enemy wizard while he is casting storm gust, the next thing will happen is he can't cast storm gust for the next 5 secs because the skill will be on forced cooldown.. But he can still cast other skills, that is the effect i want to add in spell breaker..:) can you help me on this sir?:) sry, the 1st post was not detailed, edited it now..

Edited by dreinor

Share this post


Link to post
Share on other sites
  • 0

ok add this after 'unit->skillcastcancel(bl,0);'

if (dstsd) skill->blockpc_start(dstsd, ud->skill_id, 5000);

:meow:

Share this post


Link to post
Share on other sites
  • 0
} else if (!dstsd || map_flag_vs(bl->m)) //HP damage only on pvp-maps when against players.
hp = tstatus->max_hp/50; //Recover 2% HP [skotlex]
 
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
unit->skillcastcancel(bl,0); 
    if (dstsd) skill_blockpc_start (dstsd, ud->skill_id, 5000);
sp = skill->get_sp(bl_skill_id,bl_skill_lv);
status_zap(bl, hp, sp);
 
if (hp && skill_lv >= 5)
hp>>=1; //Recover half damaged HP at level 5 [skotlex]
else
hp = 0;
 
if (sp) //Recover some of the SP used
sp = sp*(25*(skill_lv-1))/100;
 
if(hp || sp)
status->heal(src, hp, sp, 2);
}
}

you mean like this? sorry i'm not very good at scripting.. but i tried this and it failed in rebuilding.. :( also "skill_blockpc_start" says that it is undefined..:(
Edited by dreinor

Share this post


Link to post
Share on other sites
  • 0

Please double check..

 

} else if (!dstsd || map_flag_vs(bl->m)) //HP damage only on pvp-maps when against players.
hp = tstatus->max_hp/50; //Recover 2% HP [skotlex]
 
clif->skill_nodamage(src,bl,skill_id,skill_lv,1);
unit->skillcastcancel(bl,0); 
 if (dstsd) skill_blockpc_start (dstsd, ud->skill_id, 5000);
sp = skill->get_sp(bl_skill_id,bl_skill_lv);
status_zap(bl, hp, sp);
 
if (hp && skill_lv >= 5)
hp>>=1; //Recover half damaged HP at level 5 [skotlex]
else
hp = 0;
 
if (sp) //Recover some of the SP used
sp = sp*(25*(skill_lv-1))/100;
 
if(hp || sp)
status->heal(src, hp, sp, 2);
}
}

you mean like this? sorry i'm not very good at scripting.. but i tried this and it failed in rebuilding.. :( also "skill_blockpc_start" says that it is undefined.. :(

 

It must be 

 

ok add this after 'unit->skillcastcancel(bl,0);'

if (dstsd) skill->blockpc_start(dstsd, ud->skill_id, 5000);

:meow:

Share this post


Link to post
Share on other sites
  • 0

i see.. sry sry..T_T btw, thanks a lot malufett.. Recompiled and there's no error.. I'll try it later..:) thanks again..:)

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...

×
×
  • Create New...

Important Information

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