diff options
author | Jesusaves <cpntb1@ymail.com> | 2019-08-31 15:41:18 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2019-08-31 15:41:18 -0300 |
commit | 955ac518aa3892f846b59bf3cd89138f8a962bd4 (patch) | |
tree | 5ceadf141a5483c91601975338c4ceff1d9c896b /npc/functions | |
parent | a75647e56b078b585db7eb7ff95bc848d3abac0d (diff) | |
download | serverdata-955ac518aa3892f846b59bf3cd89138f8a962bd4.tar.gz serverdata-955ac518aa3892f846b59bf3cd89138f8a962bd4.tar.bz2 serverdata-955ac518aa3892f846b59bf3cd89138f8a962bd4.tar.xz serverdata-955ac518aa3892f846b59bf3cd89138f8a962bd4.zip |
Make it an util function. Three copies requires c/p to be removed.
Diffstat (limited to 'npc/functions')
-rw-r--r-- | npc/functions/util.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/npc/functions/util.txt b/npc/functions/util.txt index c32a831e1..3b05c799b 100644 --- a/npc/functions/util.txt +++ b/npc/functions/util.txt @@ -841,3 +841,17 @@ function script MapToLoc { return .@locs$[.@lx]; } +// Grants newcomers exp boost. Returns bonus % +// NewcomerEXPDROPUP( - ) +function script NewcomerEXPDROPUP { + .@AVG_LEVEL=($@hoblvl_value[0]+$@hoblvl_value[1]+$@hoblvl_value[2])/3; + .@BONUS=min(50, .@AVG_LEVEL/2); + .@BONUS-=BaseLevel; + .@BONUS=max(1, .@BONUS); + sc_end SC_CASH_PLUSEXP; + sc_end SC_CASH_RECEIVEITEM; + sc_start SC_CASH_PLUSEXP, 7200000, .@BONUS; + sc_start SC_CASH_RECEIVEITEM, 7200000, .@BONUS; + return .@BONUS; +} + |