diff options
Diffstat (limited to 'npc/other/CashShop_Functions.txt')
-rw-r--r-- | npc/other/CashShop_Functions.txt | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/npc/other/CashShop_Functions.txt b/npc/other/CashShop_Functions.txt index 92fe841e1..5b957f9f2 100644 --- a/npc/other/CashShop_Functions.txt +++ b/npc/other/CashShop_Functions.txt @@ -310,3 +310,30 @@ function script F_Snowball { } end; } + +// Status reduction potion +//============================================================ +// - Permanently reduces base stat <type> by <val>. +// - Returns status points equals to points needed to raise +// that stat to original value. +// - Doesn't work if base status <type> would become lower than 1 after reduction. +// * callfunc("F_CashReduceStat", <type>{, <val>, <itemid>}); +function script F_CashReduceStat { + .@type = getarg(0); + .@amount = getarg(1, -1); + .@itemid = getarg(2, 0); + + if ((readparam(.@type) + .@amount) < 1) return; + + if (.@itemid) { + if (countitem(.@itemid)) + delitem .@itemid, 1; + else + return; + } + + StatusPoint += needed_status_point(.@type, .@amount); + statusup2 .@type, .@amount; + + return; +}
\ No newline at end of file |