summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcsnv <ctt@csnv.es>2014-09-10 00:12:17 +0200
committercsnv <ctt@csnv.es>2014-09-10 00:12:17 +0200
commitd19310af9540db177bb35116d19dd1c3a2afff14 (patch)
treee733376112c60f53286eeb4464eb24e7b69d6c4c
parente785879df0519ee69afcac34a1b49db1462d67fc (diff)
downloadhercules-d19310af9540db177bb35116d19dd1c3a2afff14.tar.gz
hercules-d19310af9540db177bb35116d19dd1c3a2afff14.tar.bz2
hercules-d19310af9540db177bb35116d19dd1c3a2afff14.tar.xz
hercules-d19310af9540db177bb35116d19dd1c3a2afff14.zip
Fixes songs refresh bug, updates BA_ASSASSINCROSS
- Fixes bug 7125: http://hercules.ws/board/tracker/issue-7125-song-refresh/ (Rathena fix) - Updated BA_ASSASSINCROSS ASPD Renewal Formula according to latest tests - Added 'Skill failed' message to Devotion
-rw-r--r--src/map/skill.c24
-rw-r--r--src/map/status.c40
-rw-r--r--src/map/unit.c6
3 files changed, 43 insertions, 27 deletions
diff --git a/src/map/skill.c b/src/map/skill.c
index b6a7e91f0..3e3a6507a 100644
--- a/src/map/skill.c
+++ b/src/map/skill.c
@@ -11018,13 +11018,15 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_
}
break;
case BA_ASSASSINCROSS:
- val1 = 10 + skill_lv + (st->agi/10); // ASPD increase
if(sd)
+ val1 = (pc->checkskill(sd,BA_MUSICALLESSON) + 1) / 2;
#ifdef RENEWAL
- val1 += 4 * pc->checkskill(sd,BA_MUSICALLESSON);
+ // This formula was taken from a RE calculator
+ // and the changes published on irowiki
+ // Luckily, official tests show it's the right one
+ val1 += skill_lv + (st->agi/20);
#else
- val1 += (pc->checkskill(sd,BA_MUSICALLESSON) + 1) / 2;
-
+ val1 += 10 + skill_lv + (st->agi/10); // ASPD increase
val1 *= 10; // ASPD works with 1000 as 100%
#endif
break;
@@ -12273,6 +12275,16 @@ int skill_unit_onout(struct skill_unit *src, struct block_list *bl, int64 tick)
}
}
break;
+ case UNT_WHISTLE:
+ case UNT_ASSASSINCROSS:
+ case UNT_POEMBRAGI:
+ case UNT_APPLEIDUN:
+ case UNT_HUMMING:
+ case UNT_DONTFORGETME:
+ case UNT_FORTUNEKISS:
+ case UNT_SERVICEFORYOU:
+ if (sg->src_id==bl->id && !(sc && sc->data[SC_SOULLINK] && sc->data[SC_SOULLINK]->val2 == SL_BARDDANCER))
+ return -1;
}
return sg->skill_id;
}
@@ -12413,8 +12425,8 @@ int skill_unit_effect(struct block_list* bl, va_list ap) {
} else {
if( flag&1 )
skill->unit_onplace(su,bl,tick);
- else
- skill->unit_onout(su,bl,tick);
+ else if (skill->unit_onout(su,bl,tick) == -1)
+ return 0; // Don't let a Bard/Dancer update their own song timer
if( flag&4 )
skill->unit_onleft(skill_id, bl, tick);
diff --git a/src/map/status.c b/src/map/status.c
index 1748b44cb..020f405a6 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -5395,7 +5395,25 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl
skills1 = 5;
}
- if((sc->data[SC_BERSERK]) && skills1 < 15)
+ if( sc->data[SC_ASSNCROS] && skills1 < sc->data[SC_ASSNCROS]->val2){
+ if (bl->type!=BL_PC)
+ skills1 = sc->data[SC_ASSNCROS]->val2;
+ else
+ switch(((TBL_PC*)bl)->status.weapon)
+ {
+ case W_BOW:
+ case W_REVOLVER:
+ case W_RIFLE:
+ case W_GATLING:
+ case W_SHOTGUN:
+ case W_GRENADE:
+ break;
+ default:
+ skills1 = sc->data[SC_ASSNCROS]->val2;
+ }
+ }
+
+ if((sc->data[SC_BERSERK]) && skills1 < 15)
skills1 = 15;
else if(sc->data[SC_GS_MADNESSCANCEL] && skills1 < 20)
skills1 = 20;
@@ -5441,7 +5459,7 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl
if( sc->data[SC_PAIN_KILLER] )
skills2 -= sc->data[SC_PAIN_KILLER]->val2;
- if( sc->data[SC_SWING] )
+ if( sc->data[SC_SWING] ) // TODO: SC_SWING shouldn't stack with skill1 modifiers
skills2 += sc->data[SC_SWING]->val3;
if( sc->data[SC_DANCE_WITH_WUG] )
skills2 += sc->data[SC_DANCE_WITH_WUG]->val3;
@@ -5457,23 +5475,7 @@ short status_calc_aspd(struct block_list *bl, struct status_change *sc, short fl
skills2 += sc->data[SC_GS_GATLINGFEVER]->val1;
if( sc->data[SC_STAR_COMFORT] )
skills2 += 3 * sc->data[SC_STAR_COMFORT]->val1;
- if( sc->data[SC_ASSNCROS] && !skills1){
- if (bl->type!=BL_PC)
- skills2 += sc->data[SC_ASSNCROS]->val2;
- else
- switch(((TBL_PC*)bl)->status.weapon)
- {
- case W_BOW:
- case W_REVOLVER:
- case W_RIFLE:
- case W_GATLING:
- case W_SHOTGUN:
- case W_GRENADE:
- break;
- default:
- skills2 += sc->data[SC_ASSNCROS]->val2;
- }
- }
+
return ( flag&1? (skills1 + pots) : skills2 );
#else
return 0;
diff --git a/src/map/unit.c b/src/map/unit.c
index 519427635..8b74ff80c 100644
--- a/src/map/unit.c
+++ b/src/map/unit.c
@@ -1247,8 +1247,10 @@ int unit_skilluse_id2(struct block_list *src, int target_id, uint16 skill_id, ui
ARR_FIND(0, count, i, sd->devotion[i] == target_id);
if (i == count) {
ARR_FIND(0, count, i, sd->devotion[i] == 0);
- if(i == count)
- return 0; // Can't cast on other characters when limit is reached
+ if(i == count) {
+ clif->skill_fail(sd, skill_id, USESKILL_FAIL_LEVEL, 0);
+ return 0; // Can't cast on other characters when limit is reached
+ }
}
}
break;