summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-05 00:22:12 +0000
committerInkfish <Inkfish@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-05 00:22:12 +0000
commit2b4f29931162cd748c07588fcae9220b02f672ed (patch)
tree1aac3b94d3e39aa9e52f5887e179b354699c0926 /src/map/pc.c
parent2f526028369f0fb0148ced3d9d6d6b970307421d (diff)
downloadhercules-2b4f29931162cd748c07588fcae9220b02f672ed.tar.gz
hercules-2b4f29931162cd748c07588fcae9220b02f672ed.tar.bz2
hercules-2b4f29931162cd748c07588fcae9220b02f672ed.tar.xz
hercules-2b4f29931162cd748c07588fcae9220b02f672ed.zip
* Fixed turning off a skill needed to meet the requirements. (bugreport:3175)
* Skills used through items not having aftercast delay or cast time now don't overwrite the former canact_tick. (topic:220921) * Multiple autoscripts now can trigger at once. * Applied a temp fix for autoscripts crashing server.(bugreport:3154) * Implemented SC_JEXPBOOST (thanks to GMJobbie for the diff). (bugreport:3177) * Implemented SC_IGNOREDEF. (topic:217330) * SC_DEFRATIOATK won't affect boss monsters. (topic:217330) * Fixed skip_teleport_lv1_menu made lv2 skip menu as well. (bugreport:3183) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13844 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c29
1 files changed, 22 insertions, 7 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 0b658b90b..b1e558bc3 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1435,12 +1435,25 @@ int pc_autoscript_add(struct s_autoscript *scripts, int max, short rate, short f
return 1;
}
-void pc_autoscript_clear(struct s_autoscript *scripts, int max)
+void pc_autoscript_clear(struct map_session_data *sd)
{
int i;
- for (i = 0; i < max && scripts[i].script; i++)
- script_free_code(scripts[i].script);
- memset(scripts, 0, i*sizeof(struct s_autoscript));
+
+ if( sd->state.autocast )
+ return;
+
+ for (i = 0; i < MAX_PC_BONUS && sd->autoscript[i].script; i++)
+ script_free_code(sd->autoscript[i].script);
+
+ for (i = 0; i < MAX_PC_BONUS && sd->autoscript2[i].script; i++)
+ script_free_code(sd->autoscript2[i].script);
+
+ for (i = 0; i < MAX_PC_BONUS && sd->autoscript3[i].script; i++)
+ script_free_code(sd->autoscript3[i].script);
+
+ memset(&sd->autoscript, 0, sizeof(struct s_autoscript));
+ memset(&sd->autoscript2, 0, sizeof(struct s_autoscript));
+ memset(&sd->autoscript3, 0, sizeof(struct s_autoscript));
}
static int pc_bonus_autospell_del(struct s_autospell* spell, int max, short id, short lv, short rate, short card_id)
@@ -3393,6 +3406,7 @@ int pc_isUseitem(struct map_session_data *sd,int n)
case 14532: // Battle_Manual25
case 14533: // Battle_Manual100
case 14545: // Battle_Manual300
+ case 14592: // JOB_Battle_Manual
if( sd->sc.data[SC_EXPBOOST] )
return 0;
break;
@@ -4603,10 +4617,11 @@ static void pc_calcexp(struct map_session_data *sd, unsigned int *base_exp, unsi
if (sd->sc.data[SC_EXPBOOST])
bonus += sd->sc.data[SC_EXPBOOST]->val1;
- if (!bonus)
- return;
-
*base_exp = (unsigned int) cap_value(*base_exp + (double)*base_exp * bonus/100., 1, UINT_MAX);
+
+ if (sd->sc.data[SC_JEXPBOOST])
+ bonus += sd->sc.data[SC_JEXPBOOST]->val1;
+
*job_exp = (unsigned int) cap_value(*job_exp + (double)*job_exp * bonus/100., 1, UINT_MAX);
return;