|
@@ -17048,10 +17048,10 @@ struct s_skill_condition skill_get_requirement(struct map_session_data* sd, uint
|
|
* Does cast-time reductions based on dex, item bonuses and config setting
|
|
* Does cast-time reductions based on dex, item bonuses and config setting
|
|
*------------------------------------------*/
|
|
*------------------------------------------*/
|
|
int skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
|
|
int skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
|
|
- double time = skill_get_cast(skill_id, skill_lv);
|
|
|
|
-
|
|
|
|
nullpo_ret(bl);
|
|
nullpo_ret(bl);
|
|
|
|
|
|
|
|
+ double time = skill_get_cast(skill_id, skill_lv);
|
|
|
|
+
|
|
#ifndef RENEWAL_CAST
|
|
#ifndef RENEWAL_CAST
|
|
{
|
|
{
|
|
struct map_session_data *sd = BL_CAST(BL_PC, bl);
|
|
struct map_session_data *sd = BL_CAST(BL_PC, bl);
|
|
@@ -17099,11 +17099,13 @@ int skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
|
|
reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
|
|
reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
|
|
// Foresight halves the cast time, it does not stack additively
|
|
// Foresight halves the cast time, it does not stack additively
|
|
if (sc->data[SC_MEMORIZE]) {
|
|
if (sc->data[SC_MEMORIZE]) {
|
|
- if(!(flag&2))
|
|
|
|
- time -= time * 50 / 100;
|
|
|
|
- // Foresight counter gets reduced even if the skill is not affected by it
|
|
|
|
- if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
|
|
|
|
- status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
|
|
|
|
|
|
+ if (!sd || pc_checkskill(sd, skill_id) > 0) { // Foresight only decreases cast times from learned skills, not skills granted by items
|
|
|
|
+ if(!(flag&2))
|
|
|
|
+ time -= time * 50 / 100;
|
|
|
|
+ // Foresight counter gets reduced even if the skill is not affected by it
|
|
|
|
+ if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
|
|
|
|
+ status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -17130,14 +17132,14 @@ int skill_castfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv) {
|
|
*/
|
|
*/
|
|
int skill_castfix_sc(struct block_list *bl, double time, uint8 flag)
|
|
int skill_castfix_sc(struct block_list *bl, double time, uint8 flag)
|
|
{
|
|
{
|
|
- struct status_change *sc = status_get_sc(bl);
|
|
|
|
-
|
|
|
|
if (time < 0)
|
|
if (time < 0)
|
|
return 0;
|
|
return 0;
|
|
|
|
|
|
if (bl->type == BL_MOB || bl->type == BL_NPC)
|
|
if (bl->type == BL_MOB || bl->type == BL_NPC)
|
|
return (int)time;
|
|
return (int)time;
|
|
|
|
|
|
|
|
+ status_change *sc = status_get_sc(bl);
|
|
|
|
+
|
|
if (sc && sc->count) {
|
|
if (sc && sc->count) {
|
|
if (!(flag&2)) {
|
|
if (!(flag&2)) {
|
|
if (sc->data[SC_SLOWCAST])
|
|
if (sc->data[SC_SLOWCAST])
|
|
@@ -17249,9 +17251,11 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
if (sc->data[SC_MEMORIZE]) {
|
|
if (sc->data[SC_MEMORIZE]) {
|
|
- reduce_cast_rate += 50;
|
|
|
|
- if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
|
|
|
|
- status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
|
|
|
|
|
|
+ if (!sd || pc_checkskill(sd, skill_id) > 0) { // Foresight only decreases cast times from learned skills, not skills granted by items
|
|
|
|
+ reduce_cast_rate += 50;
|
|
|
|
+ if ((--sc->data[SC_MEMORIZE]->val2) <= 0)
|
|
|
|
+ status_change_end(bl, SC_MEMORIZE, INVALID_TIMER);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
if (sc->data[SC_POEMBRAGI])
|
|
if (sc->data[SC_POEMBRAGI])
|
|
reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
|
|
reduce_cast_rate += sc->data[SC_POEMBRAGI]->val2;
|
|
@@ -17310,13 +17314,7 @@ int skill_vfcastfix(struct block_list *bl, double time, uint16 skill_id, uint16
|
|
*------------------------------------------*/
|
|
*------------------------------------------*/
|
|
int skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
|
|
int skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
|
|
{
|
|
{
|
|
- int delaynodex = skill_get_delaynodex(skill_id);
|
|
|
|
- int time = skill_get_delay(skill_id, skill_lv);
|
|
|
|
- struct map_session_data *sd;
|
|
|
|
- struct status_change *sc = status_get_sc(bl);
|
|
|
|
-
|
|
|
|
nullpo_ret(bl);
|
|
nullpo_ret(bl);
|
|
- sd = BL_CAST(BL_PC, bl);
|
|
|
|
|
|
|
|
if (skill_id == SA_ABRACADABRA)
|
|
if (skill_id == SA_ABRACADABRA)
|
|
return 0; //Will use picked skill's delay.
|
|
return 0; //Will use picked skill's delay.
|
|
@@ -17324,9 +17322,14 @@ int skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
|
|
if (bl->type&battle_config.no_skill_delay)
|
|
if (bl->type&battle_config.no_skill_delay)
|
|
return battle_config.min_skill_delay_limit;
|
|
return battle_config.min_skill_delay_limit;
|
|
|
|
|
|
|
|
+ int delaynodex = skill_get_delaynodex(skill_id);
|
|
|
|
+ int time = skill_get_delay(skill_id, skill_lv);
|
|
|
|
+
|
|
if (time < 0)
|
|
if (time < 0)
|
|
time = -time + status_get_amotion(bl); // If set to <0, add to attack motion.
|
|
time = -time + status_get_amotion(bl); // If set to <0, add to attack motion.
|
|
|
|
|
|
|
|
+ status_change* sc = status_get_sc(bl);
|
|
|
|
+
|
|
// Delay reductions
|
|
// Delay reductions
|
|
switch (skill_id) { //Monk combo skills have their delay reduced by agi/dex.
|
|
switch (skill_id) { //Monk combo skills have their delay reduced by agi/dex.
|
|
case MO_TRIPLEATTACK:
|
|
case MO_TRIPLEATTACK:
|
|
@@ -17393,11 +17396,13 @@ int skill_delayfix(struct block_list *bl, uint16 skill_id, uint16 skill_lv)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- if (!(delaynodex&4) && sd) {
|
|
|
|
- if (sd->delayrate != 100)
|
|
|
|
- time = time * sd->delayrate / 100;
|
|
|
|
|
|
+ if (!(delaynodex&4) && bl->type == BL_PC) {
|
|
|
|
+ map_session_data* sd = (map_session_data*)bl;
|
|
|
|
+
|
|
|
|
+ if (sd->delayrate != 100) // bonus bDelayRate
|
|
|
|
+ time += time * sd->delayrate / 100;
|
|
|
|
|
|
- for (auto &it : sd->skilldelay) {
|
|
|
|
|
|
+ for (auto &it : sd->skilldelay) { // bonus2 bSkillDelay
|
|
if (it.id == skill_id) {
|
|
if (it.id == skill_id) {
|
|
time += it.val;
|
|
time += it.val;
|
|
break;
|
|
break;
|