summaryrefslogtreecommitdiff
path: root/world/map/npc
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2013-09-16 11:18:13 -0700
committerBen Longbons <b.r.longbons@gmail.com>2013-09-16 11:28:50 -0700
commit2388bd96403ad43c43080f8a7bf8f2bf8050cc73 (patch)
tree0e6753addf1f2544056e60c7130616f2bf626468 /world/map/npc
parentc8f2dea0bd0068aac6f59a5053d4f0576f21bb23 (diff)
downloadserverdata-2388bd96403ad43c43080f8a7bf8f2bf8050cc73.tar.gz
serverdata-2388bd96403ad43c43080f8a7bf8f2bf8050cc73.tar.bz2
serverdata-2388bd96403ad43c43080f8a7bf8f2bf8050cc73.tar.xz
serverdata-2388bd96403ad43c43080f8a7bf8f2bf8050cc73.zip
Make RequireStat script less silly
Diffstat (limited to 'world/map/npc')
-rw-r--r--world/map/npc/items/require_stat.txt29
1 files changed, 8 insertions, 21 deletions
diff --git a/world/map/npc/items/require_stat.txt b/world/map/npc/items/require_stat.txt
index 01ca1600..ad975e24 100644
--- a/world/map/npc/items/require_stat.txt
+++ b/world/map/npc/items/require_stat.txt
@@ -1,31 +1,18 @@
// ------------------------------------------------------------
// Variables passed to this script:
-// @slotId The slot in which the item would have been equipped in. This is passed automagically when called in an equip script.
-// @bStat$ The stat to check against. Can be Str, Agi, Vit, Int, Dex, Luk.
+// @slotId The slot in which the item would have been equipped in.
+// This is passed automagically when called in an equip script.
+// @bStat The stat to check against.
+// Usually one of: bStr, bAgi, bVit, bInt, bDex, bLuk;
+// but can be anything that works with readparam().
// @minbStatVal The minimum stat value to accept this item.
// ------------------------------------------------------------
function|script|RequireStat|,
{
- if (@bStat$ == "" || @minbStatVal < 0) goto L_Return;
- set @bStatVal, 0;
- if (@bStat$ == "Str")
- set @bStatVal, readparam(bStr);
- if (@bStat$ == "Agi")
- set @bStatVal, readparam(bAgi);
- if (@bStat$ == "Vit")
- set @bStatVal, readparam(bVit);
- if (@bStat$ == "Dex")
- set @bStatVal, readparam(bDex);
- if (@bStat$ == "Int")
- set @bStatVal, readparam(bInt);
- if (@bStat$ == "Luk")
- set @bStatVal, readparam(bLuk);
- if (@bStatVal >= @minbStatVal) goto L_Return;
+ set @bStatVal, readparam(@bStat);
// If the requirement isn't met, then we end the script.
// Hence, subsequent item modifiers won't be applied.
- end;
-
-L_Return:
- return;
+ if (@bStatVal < @minbStatVal)
+ end;
}