//===== rAthena Script =======================================
//= Common Useful Function
//===== By: ==================================================
//= Yuchinin
//===== Current Version: =====================================
//= 1.2
//===== Compatible With: =====================================
//= rAthena Project
//===== Description: =========================================
//= A common useful function I wrote these few years.
//= Hoping with these can help other to write useful script.
//=====******** Note ********=================================
//= This will be the core of my other script.
//= Better let it load first before adding my other script.
//===== Additional Comments: =================================
//= 1.0 Initial script.
//= 1.1 Change function arrdel from using 'value' to 'index'
//= 1.2 Fixed sql query bug
//============================================================
Function List:
//===================================
//= walktonpc({<unitid>,<distance>})
//= walk character in npc <distance>
//===================================
//===================================
//= npcindistance(<distance>)
//= check if distance with npc smaller or equal to <distance>
//= return to the caller
//= else walk in npc <distance>
//===================================
//===================================
//= getVariable(<"npc variable name">,{"<owner>"})
//= return variable value
//= owner will be calling npc if omitted
//===================================
//===================================
//= setVariable(<"npc variable name">,{<"owner">})
//= set variable value
//= owner will be calling npc if omitted
//===================================
//===================================
//= arradd("<arrayname>",<value>,{<"owner">})
//= add value to array
//= owner will be calling npc if omitted
//===================================
//===================================
//= arrdel("<arrayname>",<index>,{<"owner">})
//= delete index from array
//= owner will be calling npc if omitted
//===================================
//===================================
// arrhas("<arrayname>",<value>,{<"owner">})
//= check if value in array
//= return 1 if in else return 0
//===================================
//===================================
// arrfind("<arrayname>",<value>,{<"owner">})
//= return first found value index in array
//= return -1 if not found
//===================================
//===================================
// arrselect("<arrayname>",{<"label">,"<owner>"})
//= return selected array value after selection
//= label add before selection
//= owner will be calling npc if omitted
//===================================
//==============================
//= UpperFirst("<string>")
//= return string with first string capital
//==============================
//=========================================
//= getRemain(<sec>)
//= return remaining time string
//=========================================
//=========================================
//= CStr(<"string to change color">,{<"color name">})
//= return string with selected color
//=========================================
//=========================================
//= CZeny(<zeny>,{<"delimiter">,<"symbol">})
//= return ease look zeny string
//=========================================
//=========================================
//= Itemlink(<itemid>)
//= return item string with itemlink added
//=========================================
// Below is custom inventory system for npc
//===================================
//= invcount("<owner>")
//= return inventory count
//===================================
//===================================
//= invcountitem(<itemid>,"<owner>")
//= return item count in inventory
//===================================
//===================================
//= invselect("<owner>","<blacklistid>","<label>")
//= add label before selection
//= return itemid after selection
//===================================
//===================================
//= invgetitem(<itemid>,"<owner>",{<amount>})
//= return itemid if success
//= return 0 if fail
//===================================
//===================================
//= invhasitem(<itemid>,"<owner>")
//= return itemid if have item
//= return 0 if don't have item
//===================================
//===================================
//= invdelitem(<itemid>,"<owner>",{<amount>})
//= return itemid if success
//= return 0 if fail
//===================================
//===================================
//= invclear("<owner>")
//= clear all inventory
//===================================
download:
https://rathena.org/board/files/file/3432-common-useful-function/
Git:
https://github.com/Yuchinin/rathena-script/blob/master/common.txt