summaryrefslogtreecommitdiff
path: root/src/map/skill.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/skill.c')
-rw-r--r--src/map/skill.c67
1 files changed, 41 insertions, 26 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index 8c21b7eba..8718c3b58 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -988,7 +988,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
break;
case AM_ACIDTERROR:
- sc_start(bl,SC_BLEEDING,(skill_lv*3),skill_lv,skill_get_time2(skill_id,skill_lv));
+ sc_start2(bl,SC_BLEEDING,(skill_lv*3),skill_lv,src->id,skill_get_time2(skill_id,skill_lv));
if (skill_break_equip(bl, EQP_ARMOR, 100*skill_get_time(skill_id,skill_lv), BCT_ENEMY))
clif_emotion(bl,E_OMG);
break;
@@ -1060,7 +1060,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
sc_start(bl,status_skill2sc(skill_id),70,skill_lv,skill_get_time2(skill_id,skill_lv));
break;
case NPC_BLEEDING:
- sc_start(bl,SC_BLEEDING,(20*skill_lv),skill_lv,skill_get_time2(skill_id,skill_lv));
+ sc_start2(bl,SC_BLEEDING,(20*skill_lv),skill_lv,src->id,skill_get_time2(skill_id,skill_lv));
break;
case NPC_MENTALBREAKER:
{ //Based on observations by Tharis, Mental Breaker should do SP damage
@@ -1106,13 +1106,13 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
case LK_HEADCRUSH: //Headcrush has chance of causing Bleeding status, except on demon and undead element
if (!(battle_check_undead(tstatus->race, tstatus->def_ele) || tstatus->race == RC_DEMON))
- sc_start(bl, SC_BLEEDING,50, skill_lv, skill_get_time2(skill_id,skill_lv));
+ sc_start2(bl, SC_BLEEDING,50, skill_lv, src->id, skill_get_time2(skill_id,skill_lv));
break;
case LK_JOINTBEAT:
status = status_skill2sc(skill_id);
if (tsc->jb_flag) {
- sc_start2(bl,status,(5*skill_lv+5),skill_lv,tsc->jb_flag&BREAK_FLAGS,skill_get_time2(skill_id,skill_lv));
+ sc_start4(bl,status,(5*skill_lv+5),skill_lv,tsc->jb_flag&BREAK_FLAGS,src->id,0,skill_get_time2(skill_id,skill_lv));
tsc->jb_flag = 0;
}
break;
@@ -1126,7 +1126,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
sc_start(bl,SC_STUN,(5+skill_lv*5),skill_lv,skill_get_time2(skill_id,2));
break;
default:
- sc_start(bl,SC_BLEEDING,(5+skill_lv*5),skill_lv,skill_get_time2(skill_id,3));
+ sc_start2(bl,SC_BLEEDING,(5+skill_lv*5),skill_lv,src->id,skill_get_time2(skill_id,3));
}
break;
@@ -1167,7 +1167,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
status_change_start(bl,SC_COMA,10,skill_lv,0,src->id,0,0,0);
break;
case GS_PIERCINGSHOT:
- sc_start(bl,SC_BLEEDING,(skill_lv*3),skill_lv,skill_get_time2(skill_id,skill_lv));
+ sc_start2(bl,SC_BLEEDING,(skill_lv*3),skill_lv,src->id,skill_get_time2(skill_id,skill_lv));
break;
case NJ_HYOUSYOURAKU:
sc_start(bl,SC_FREEZE,(10+10*skill_lv),skill_lv,skill_get_time2(skill_id,skill_lv));
@@ -1271,7 +1271,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
rate = 30 + (((5 * (sd?pc_checkskill(sd,LG_PINPOINTATTACK):skill_lv)) + (sstatus->agi + status_get_lv(src))) / 10);
switch( skill_lv ) {
case 1:
- sc_start(bl,SC_BLEEDING,rate,skill_lv,skill_get_time(skill_id,skill_lv));
+ sc_start2(bl,SC_BLEEDING,rate,skill_lv,src->id,skill_get_time(skill_id,skill_lv));
break;
case 2:
if( dstsd && dstsd->spiritball && rnd()%100 < rate )
@@ -1351,7 +1351,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
}
break;
case SO_EARTHGRAVE:
- sc_start(bl, SC_BLEEDING, 5 * skill_lv, skill_lv, skill_get_time2(skill_id, skill_lv)); // Need official rate. [LimitLine]
+ sc_start2(bl, SC_BLEEDING, 5 * skill_lv, skill_lv, src->id, skill_get_time2(skill_id, skill_lv)); // Need official rate. [LimitLine]
break;
case SO_DIAMONDDUST:
rate = 5 + 5 * skill_lv;
@@ -1367,7 +1367,7 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
switch( sd->itemid ) { // Starting SCs here instead of do it in skill_additional_effect to simplify the code.
case 13261:
sc_start(bl, SC_STUN, 100, skill_lv, skill_get_time2(GN_SLINGITEM, skill_lv));
- sc_start(bl, SC_BLEEDING, 100, skill_lv, skill_get_time2(GN_SLINGITEM, skill_lv));
+ sc_start2(bl, SC_BLEEDING, 100, skill_lv, src->id, skill_get_time2(GN_SLINGITEM, skill_lv));
break;
case 13262:
sc_start(bl, SC_MELON_BOMB, 100, skill_lv, skill_get_time(GN_SLINGITEM, skill_lv)); // Reduces ASPD and moviment speed
@@ -1382,10 +1382,10 @@ int skill_additional_effect (struct block_list* src, struct block_list *bl, uint
break;
case GN_HELLS_PLANT_ATK:
sc_start(bl, SC_STUN, 5 + 5 * skill_lv, skill_lv, skill_get_time2(skill_id, skill_lv));
- sc_start(bl, SC_BLEEDING, 20 + 10 * skill_lv, skill_lv, skill_get_time2(skill_id, skill_lv));
+ sc_start2(bl, SC_BLEEDING, 20 + 10 * skill_lv, skill_lv, src->id,skill_get_time2(skill_id, skill_lv));
break;
case EL_WIND_SLASH: // Non confirmed rate.
- sc_start(bl, SC_BLEEDING, 25, skill_lv, skill_get_time(skill_id,skill_lv));
+ sc_start2(bl, SC_BLEEDING, 25, skill_lv, src->id, skill_get_time(skill_id,skill_lv));
break;
case EL_STONE_HAMMER:
rate = 10 * skill_lv;
@@ -3239,7 +3239,7 @@ static int skill_timerskill(int tid, unsigned int tick, int id, intptr_t data)
{
i = applyeffects[rnd()%j];
status_change_start(target, i, 10000, skl->skill_lv,
- (i == SC_BURNING ? 1000 : 0),
+ (i == SC_BURNING ? 1000 : (i == SC_BLEEDING ? src->id : 0)),
(i == SC_BURNING ? src->id : 0),
0, skill_get_time(WL_TETRAVORTEX,skl->skill_lv), 0);
}
@@ -4496,11 +4496,6 @@ int skill_castend_damage_id (struct block_list* src, struct block_list *bl, uint
}
break;
- case WM_LULLABY_DEEPSLEEP:
- if( bl != src && rnd()%100 < 88 + 2 * skill_lv )
- sc_start(bl,status_skill2sc(skill_id),100,skill_lv,skill_get_time(skill_id,skill_lv));
- break;
-
case SO_POISON_BUSTER: {
struct status_change *tsc = status_get_sc(bl);
if( tsc && tsc->data[SC_POISON] ) {
@@ -7393,7 +7388,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
const enum sc_type sc[] = { SC_STUN, SC_SILENCE, SC_CONFUSION, SC_BLEEDING };
int j;
j = i = rnd()%ARRAYLENGTH(sc);
- while ( !sc_start(bl,sc[i],100,skill_lv,skill_get_time2(skill_id,i+1)) ) {
+ while ( !sc_start2(bl,sc[i],100,skill_lv,src->id,skill_get_time2(skill_id,i+1)) ) {
i++;
if ( i == ARRAYLENGTH(sc) )
i = 0;
@@ -7413,7 +7408,7 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case NPC_SLOWCAST:
case NPC_WIDEHELLDIGNITY:
if (flag&1)
- sc_start(bl,type,100,skill_lv,skill_get_time2(skill_id,skill_lv));
+ sc_start2(bl,type,100,skill_lv,src->id,skill_get_time2(skill_id,skill_lv));
else {
skill_area_temp[2] = 0; //For SD_PREAMBLE
clif_skill_nodamage(src,bl,skill_id,skill_lv,1);
@@ -8592,12 +8587,25 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
break;
case SO_ARRULLO:
- if( flag&1 )
- sc_start2(bl, type, 88 + 2 * skill_lv, skill_lv, 1, skill_get_time(skill_id, skill_lv));
- else {
- clif_skill_nodamage(src, bl, skill_id, 0, 1);
+ {
+ // [(15 + 5 * Skill Level) + ( Caster’s INT / 5 ) + ( Caster’s Job Level / 5 ) - ( Target’s INT / 6 ) - ( Target’s LUK / 10 )] %
+ int rate = (15 + 5 * skill_lv) + status_get_int(src)/5 + (sd)?sd->status.job_level:0;
+ rate -= status_get_int(bl)/6 - status_get_luk(bl)/10;
+ clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
+ sc_start2(bl, type, rate, skill_lv, 1, skill_get_time(skill_id, skill_lv));
+ }
+ break;
+
+ case WM_LULLABY_DEEPSLEEP:
+ if( flag&1 ){
+ //[(Skill Level x 4) + (Voice Lessons Skill Level x 2) + (Caster’s Base Level / 15) + (Caster’s Job Level / 5)] %
+ int rate = (4 * skill_lv) + ( (sd) ? pc_checkskill(sd,WM_LESSON)*2 + sd->status.job_level/5 : 0 ) + status_get_lv(src) / 15;
+ if( bl != src )
+ sc_start(bl,type,rate,skill_lv,skill_get_time(skill_id,skill_lv));
+ }else {
+ clif_skill_nodamage(src, bl, skill_id, skill_lv, 1);
map_foreachinrange(skill_area_sub, bl, skill_get_splash(skill_id, skill_lv), BL_CHAR,
- src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill_castend_nodamage_id);
+ src, skill_id, skill_lv, tick, flag|BCT_ALL|1, skill_castend_nodamage_id);
}
break;
@@ -9821,6 +9829,8 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
(skill_lv >= 4) ? sd->status.memo_point[2].map : 0
);
}
+ if( sc && sc->data[SC_CURSEDCIRCLE_ATKER] ) //Should only remove after the skill has been casted.
+ status_change_end(src,SC_CURSEDCIRCLE_ATKER,INVALID_TIMER);
return 0; // not to consume item.
case MO_BODYRELOCATION:
@@ -10008,10 +10018,15 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui
case NC_COLDSLOWER:
case NC_ARMSCANNON:
case RK_DRAGONBREATH:
- case WM_LULLABY_DEEPSLEEP:
i = skill_get_splash(skill_id,skill_lv);
map_foreachinarea(skill_area_sub,src->m,x-i,y-i,x+i,y+i,splash_target(src),
- src,skill_id,skill_lv,tick,flag|(skill_id==WM_LULLABY_DEEPSLEEP?BCT_ALL:BCT_ENEMY)|1,skill_castend_damage_id);
+ src,skill_id,skill_lv,tick,flag|BCT_ENEMY|1,skill_castend_damage_id);
+ break;
+
+ case SO_ARRULLO:
+ i = skill_get_splash(skill_id,skill_lv);
+ map_foreachinarea(skill_area_sub,src->m,x-i,y-i,x+i,y+i,splash_target(src),
+ src, skill_id, skill_lv, tick, flag|BCT_ENEMY|1, skill_castend_nodamage_id);
break;
/**
* Guilotine Cross