summaryrefslogtreecommitdiff
path: root/npc/items
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2019-07-26 21:35:34 -0300
committerJesusaves <cpntb1@ymail.com>2019-07-26 21:35:34 -0300
commit8aa49725f5d65f97e6a9a51032a49232000f72d6 (patch)
treeae822fbc17b143fc0904e0096d164f7984ce062b /npc/items
parent8165203ea8862777b439f07763d2f74e9eb637e5 (diff)
downloadserverdata-8aa49725f5d65f97e6a9a51032a49232000f72d6.tar.gz
serverdata-8aa49725f5d65f97e6a9a51032a49232000f72d6.tar.bz2
serverdata-8aa49725f5d65f97e6a9a51032a49232000f72d6.tar.xz
serverdata-8aa49725f5d65f97e6a9a51032a49232000f72d6.zip
Alcohol - Now the first glass skips vitality check.
Diffstat (limited to 'npc/items')
-rw-r--r--npc/items/alcohol.txt31
1 files changed, 18 insertions, 13 deletions
diff --git a/npc/items/alcohol.txt b/npc/items/alcohol.txt
index 81c6a6bd0..f1e9d4afb 100644
--- a/npc/items/alcohol.txt
+++ b/npc/items/alcohol.txt
@@ -36,15 +36,21 @@
}
OnUse:
- if (@Alcohol <= 0) close;
- // Do you have enough vitality to hold your beer?
- .@vit=readparam(bVit);
- if (@Alcohol+ALC_THRESHOLD > .@vit) {
- dispbottom l("You vomit, you are too drunk for this to have effect anymore.");
- dispbottom l("Raise vitality to be able to drink even more.");
- sc_start SC_CONFUSION, 5000, 0, 10000, SCFLAG_NOAVOID; // Warning, forces user to use @resync!
+ if (@Alcohol <= 0 || @taste <= 0) {
+ Exception("Invalid alcoholic item, deleting without any effect.");
end;
}
+ // Do you have enough vitality to hold your beer?
+ // Skip this check on the first drink
+ if (ALC_THRESHOLD) {
+ .@vit=readparam(bVit);
+ if (@Alcohol+ALC_THRESHOLD > .@vit) {
+ dispbottom l("You vomit, you are too drunk for this to have effect anymore.");
+ dispbottom l("Raise vitality to be able to drink even more.");
+ sc_start SC_CONFUSION, 5000, 0, 10000, SCFLAG_NOAVOID; // Warning, forces user to use @resync!
+ end;
+ }
+ }
.@deltatime=60*1000; // How long (in ms) each Alcohol point works? (max. 100 points)
// Default value is 1 minute per alcohol point - you'll be somber after at most two hours.
@@ -52,7 +58,7 @@ OnUse:
// Each user raises exp bonus in 1%, capped to the beverage taste
// If you are with many people, drink a better beverage! ;-)
getmapxy(.@m$, .@x, .@y, 0);
- .@bonus=getareausers(.@m$, .@x-10, .@y-10, .@x+10, .@y+10)-1;
+ .@bonus=getareausers(.@m$, .@x-12, .@y-12, .@x+12, .@y+12)-1;
@taste+=min(@taste, .@bonus);
// Alcohol EXP Bonus - ponderate average, so having more VIT doesn't means
@@ -81,11 +87,10 @@ OnUse:
//debugmes "%d %d | %d %d | f t ", remaining_bonus(SC_OVERLAPEXPUP, false), remaining_bonus(SC_OVERLAPEXPUP, true), remaining_bonus(SC_ATTHASTE_INFINITY, false), remaining_bonus(SC_ATTHASTE_INFINITY, true);
// For debuff I'll use inc_sc_bonus utilities (exp gain = atk speed loss)
- @min=-(remaining_bonus(SC_OVERLAPEXPUP, true)*2);
- @max=-(remaining_bonus(SC_OVERLAPEXPUP, true)*2);
- @type=SC_ATTHASTE_INFINITY;
- @delay=@Alcohol*(.@deltatime/1000);
- doevent "inc_sc_bonus::OnUse";
+ .@delay=@Alcohol*(.@deltatime/1000);
+ .@min=-(remaining_bonus(SC_OVERLAPEXPUP, true)*2);
+ .@max=-(remaining_bonus(SC_OVERLAPEXPUP, true)*2);
+ SC_Bonus(.@delay, SC_ATTHASTE_INFINITY, .@min, .@max);
close;
}