Fixed soul linking (#6697)

Fixes #6696

Thanks to @mazvi and @aleos89
This commit is contained in:
Lemongrass3110 2022-03-16 16:46:48 +01:00 committed by GitHub
parent 414023a14a
commit a62859fdb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 13 deletions

View File

@ -1862,7 +1862,7 @@ Body:
NoClearance: true
NoSave: true
NoBanishingBuster: true
End:
Fail:
Soulgolem: true
Soulshadow: true
Soulfalcon: true

View File

@ -9968,24 +9968,21 @@ int skill_castend_nodamage_id (struct block_list *src, struct block_list *bl, ui
case SL_STAR:
case SL_SUPERNOVICE:
case SL_WIZARD:
if (sd && tsc && (tsc->data[SC_SOULGOLEM] || tsc->data[SC_SOULSHADOW] || tsc->data[SC_SOULFALCON] || tsc->data[SC_SOULFAIRY])) { // Soul links from Soul Linker and Soul Reaper skills don't stack.
clif_skill_fail(sd, skill_id, USESKILL_FAIL,0);
break;
}
//NOTE: here, 'type' has the value of the associated MAPID, not of the SC_SPIRIT constant.
if (sd && dstsd && !((dstsd->class_&MAPID_UPPERMASK) == type)) {
clif_skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0);
break;
}
if (skill_id == SL_SUPERNOVICE && dstsd && dstsd->die_counter && !(rnd()%100))
{ //Erase death count 1% of the casts
pc_setparam(dstsd, SP_PCDIECOUNTER, 0);
clif_specialeffect(bl, EF_ANGEL2, AREA);
//SC_SPIRIT invokes status_calc_pc for us.
}
clif_skill_nodamage(src,bl,skill_id,skill_lv,
sc_start4(src,bl,SC_SPIRIT,100,skill_lv,skill_id,0,0,skill_get_time(skill_id,skill_lv)));
if( sc_start2( src, bl, type, 100, skill_lv, skill_id, skill_get_time( skill_id, skill_lv ) ) ){
clif_skill_nodamage( src, bl, skill_id, skill_lv, 1 );
sc_start( src, src, SC_SMA, 100, skill_lv, skill_get_time( SL_SMA, skill_lv ) );
}else{
if( sd ){
clif_skill_fail( sd, skill_id, USESKILL_FAIL_LEVEL, 0 );
}
}
break;
case SL_HIGH:
if (sd && tsc && (tsc->data[SC_SOULGOLEM] || tsc->data[SC_SOULSHADOW] || tsc->data[SC_SOULFALCON] || tsc->data[SC_SOULFAIRY])) { // Soul links from Soul Linker and Soul Reaper skills don't stack.

View File

@ -9457,6 +9457,69 @@ int status_change_start(struct block_list* src, struct block_list* bl,enum sc_ty
status_change_end(bl, static_cast<sc_type>(i), INVALID_TIMER); // End the bonus part on the caster
}
break;
case SC_SPIRIT:
if( sd ){
uint64 target_class = 0;
switch( val2 ){
case SL_ALCHEMIST:
target_class = MAPID_ALCHEMIST;
break;
case SL_ASSASIN:
target_class = MAPID_ASSASSIN;
break;
case SL_BARDDANCER:
target_class = MAPID_BARDDANCER;
break;
case SL_BLACKSMITH:
target_class = MAPID_BLACKSMITH;
break;
case SL_CRUSADER:
target_class = MAPID_CRUSADER;
break;
case SL_HUNTER:
target_class = MAPID_HUNTER;
break;
case SL_KNIGHT:
target_class = MAPID_KNIGHT;
break;
case SL_MONK:
target_class = MAPID_MONK;
break;
case SL_PRIEST:
target_class = MAPID_PRIEST;
break;
case SL_ROGUE:
target_class = MAPID_ROGUE;
break;
case SL_SAGE:
target_class = MAPID_SAGE;
break;
case SL_SOULLINKER:
target_class = MAPID_SOUL_LINKER;
break;
case SL_STAR:
target_class = MAPID_STAR_GLADIATOR;
break;
case SL_SUPERNOVICE:
target_class = MAPID_SUPER_NOVICE;
break;
case SL_WIZARD:
target_class = MAPID_WIZARD;
break;
default:
ShowError( "Unknown skill id %d for SC_SPIRIT.\n", val2 );
return 0;
}
if( !( ( sd->class_ & MAPID_UPPERMASK ) == target_class ) ){
return 0;
}
}else{
// Status change is only applicable for players
return 0;
}
break;
}
// Before overlapping fail, one must check for status cured.