summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2020-02-11 13:55:09 -0300
committerJesusaves <cpntb1@ymail.com>2020-02-11 13:55:09 -0300
commit9630c2ceaa0186258ea52d40b3316da344eea61a (patch)
treef0db9f82112cb3d01b412b5bec2bb1a8182615de /npc/items
parent710a8219eff73649b368e58e0885d60cba21bf9e (diff)
downloadserverdata-9630c2ceaa0186258ea52d40b3316da344eea61a.tar.gz
serverdata-9630c2ceaa0186258ea52d40b3316da344eea61a.tar.bz2
serverdata-9630c2ceaa0186258ea52d40b3316da344eea61a.tar.xz
serverdata-9630c2ceaa0186258ea52d40b3316da344eea61a.zip
[skip ci] ALCReset: Cast it when having a new drink.
So newer drinks are not affected by old drinks if timer expired.
Diffstat (limited to 'npc/items')
-rw-r--r--npc/items/alcohol.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/npc/items/alcohol.txt b/npc/items/alcohol.txt
index 6188f8102..25f93c744 100644
--- a/npc/items/alcohol.txt
+++ b/npc/items/alcohol.txt
@@ -17,6 +17,12 @@
// Max HP Reductor: SC_INCMHPRATE
// EXP Increaser: SC_CASH_PLUSEXP (not reset upon death), SC_OVERLAPEXPUP (reset upon death)
+function script ALCReset {
+ if (ALC_DELAYTIME < gettimetick(2))
+ ALC_THRESHOLD=0;
+ return;
+}
+
- script alcohol_sc -1,{
// Stack remaning bonuses if the last one hasn't finished
@@ -40,6 +46,9 @@ OnUse:
Exception("Invalid alcoholic item, deleting without any effect.");
end;
}
+ // Just to be sure
+ ALCReset();
+
// Do you have enough vitality to hold your beer?
// Skip this check on the first drink
if (ALC_THRESHOLD) {
@@ -104,9 +113,3 @@ OnUse:
close;
}
-function script ALCReset {
- if (ALC_DELAYTIME < gettimetick(2))
- ALC_THRESHOLD=0;
- return;
-}
-