From 2388bd96403ad43c43080f8a7bf8f2bf8050cc73 Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 16 Sep 2013 11:18:13 -0700 Subject: Make RequireStat script less silly --- world/map/npc/items/require_stat.txt | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) (limited to 'world/map/npc/items') 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; } -- cgit v1.2.3-60-g2f50