yuchinin Posted February 11, 2016 Group: Members Topic Count: 12 Topics Per Day: 0.00 Content Count: 120 Reputation: 49 Joined: 07/23/13 Last Seen: August 27, 2021 Share Posted February 11, 2016 (edited) //===== 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 Edited February 14, 2016 by yuchinin 2 Quote Link to comment Share on other sites More sharing options...
rainkaj Posted September 23, 2017 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 3 Reputation: 0 Joined: 09/22/17 Last Seen: February 20, 2019 Share Posted September 23, 2017 (edited) Excuseme! But i'm a newbie. Could you tell me how to use this function? Ex: Where will i locate it? Which files i have to modified to enable this script? Best regards! Edited September 23, 2017 by rainkaj Quote Link to comment Share on other sites More sharing options...
Cyro Posted September 23, 2017 Group: Members Topic Count: 9 Topics Per Day: 0.00 Content Count: 1138 Reputation: 290 Joined: 04/29/13 Last Seen: July 20, 2024 Share Posted September 23, 2017 1 hour ago, rainkaj said: Excuseme! But i'm a newbie. Could you tell me how to use this function? Ex: Where will i locate it? Which files i have to modified to enable this script? Best regards! You just need to add this script as every other NPC script, this functions are used in yuchins other scripts, to use those scripts you must have this function loaded 1 Quote Link to comment Share on other sites More sharing options...
rainkaj Posted September 23, 2017 Group: Members Topic Count: 0 Topics Per Day: 0 Content Count: 3 Reputation: 0 Joined: 09/22/17 Last Seen: February 20, 2019 Share Posted September 23, 2017 thanks you very much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.