summaryrefslogtreecommitdiff
path: root/npc/custom/events/valentinesdayexp.txt
diff options
context:
space:
mode:
authorEmistry Haoyan <equinox1991@gmail.com>2019-06-16 18:44:45 +0800
committerHaru <haru@dotalux.com>2019-07-28 18:17:09 +0200
commit371d056df80b6f83484534f64883c3d020c4112d (patch)
tree20d38a8581f3a6159157bfa6644027d4007485bc /npc/custom/events/valentinesdayexp.txt
parentef8bc3a8375d4fe9a5f75faf951b3deecb891d57 (diff)
downloadhercules-371d056df80b6f83484534f64883c3d020c4112d.tar.gz
hercules-371d056df80b6f83484534f64883c3d020c4112d.tar.bz2
hercules-371d056df80b6f83484534f64883c3d020c4112d.tar.xz
hercules-371d056df80b6f83484534f64883c3d020c4112d.zip
Sanitize handling of the input() values.
- avoid potential hacks for old scripts that use `input()` script commands. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'npc/custom/events/valentinesdayexp.txt')
-rw-r--r--npc/custom/events/valentinesdayexp.txt33
1 files changed, 20 insertions, 13 deletions
diff --git a/npc/custom/events/valentinesdayexp.txt b/npc/custom/events/valentinesdayexp.txt
index 33339dcd9..195f20275 100644
--- a/npc/custom/events/valentinesdayexp.txt
+++ b/npc/custom/events/valentinesdayexp.txt
@@ -95,12 +95,15 @@ alberta,26,243,4 script Stephen#val1 1_M_MERCHANT,{
mes "you can come back again.";
mes "So how many do you want?";
next;
- set @needmon,0;
- input @flag_num;
- if (@flag_num <= 0) goto L_NONE;
- if (@flag_num > 5) goto L_ERR;
- set @needmon,@flag_num*5000;
- if (Zeny < @needmon) goto L_NOTENO;
+ @needmon = 0;
+ input(@flag_num);
+ if (@flag_num <= 0)
+ goto L_NONE;
+ if (@flag_num > 5)
+ goto L_ERR;
+ @needmon = @flag_num * 5000;
+ if (Zeny < @needmon)
+ goto L_NOTENO;
Zeny -= @needmon;
getitem 558,@flag_num;
mes "[Stephen]";
@@ -154,13 +157,17 @@ alberta,29,243,4 script Jainie#val1 1_M_INNKEEPER,{
mes "you can come back again.";
mes "So how many do you want? 1 portion is 4500z + 1 Milk.";
next;
- set @needmon,0;
- input @flag_num;
- if (@flag_num == 0) goto L_NONE;
- if (@flag_num > 5) goto L_ERR;
- set @needmon,@flag_num*4500;
- if (Zeny < @needmon) goto L_NOTENO;
- if (countitem(Milk) < @flag_num) goto L_NOMILK;
+ @needmon = 0;
+ input(@flag_num);
+ if (@flag_num == 0)
+ goto L_NONE;
+ if (@flag_num > 5)
+ goto L_ERR;
+ @needmon = @flag_num * 4500;
+ if (Zeny < @needmon)
+ goto L_NOTENO;
+ if (countitem(Milk) < @flag_num)
+ goto L_NOMILK;
Zeny -= @needmon;
delitem 519,@flag_num;
getitem 561,@flag_num;