-
Posts
618 -
Joined
-
Last visited
-
Days Won
11
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Z3R0
-
Trying again... // Trades tokens // getarg(0) - number of tokens to be traded function script thqs_trade_token { // getarg(0) == Token Option .@index = getarg(0); // Number of Tokens .@token_count[0], 1, 10, 100; .@zeny_amt[0],5000000,50000000,500000000; // If Nevermind was selected if (.@index == 3) { close; } if (#Treasure_Token < .@token_count[.@index]) { mes "You don't have enough tokens!"; close; } if ( ( Zeny == MAX_ZENY ) || ( ( Zeny + .@zeny_amt[.@index] ) > MAX_ZENY) { mes "You are already at max Zeny or this trade will go over max zeny"; close; } Zeny += .@zeny_amt[.@index]; #Treasure_Token -= .@token_amount[.@index]; close; } // Main script prt_in,164,174,1 script Treasure Hunter's Shop 1_M_YOUNGKNIGHT,{ mes "[Ash]"; mes "Ahh, "+strcharinfo(PC_NAME)+"! Welcome to the Offical Treasure Hunter's Guild Shop."; mes "You currently have ^FF0000"+#Treasure_Token+"^000000 treasure tokens!!!"; next; switch( select("How does this place work?","What do you have in stock?","Nevermind") ) { case 1: mes "[Ash]"; mes "Well you see here you can exchange your treasure hunter tokens for zeny or rare weapons forged by our blacksmiths."; mes " "; mes "Everything has its own price value and the only way you can get the tokens is by completing quests assigned to you,the system normally works like this."; mes " "; mes "The harder the mission the more Tokens you will earn. All red quests are worth 4-8 Tokens, and the rest are worth 1-5."; mes " "; mes "Hope that solves your problem and questions."; close; case 2: break; case 3: close; } mes "[Ash]"; mes "Ok here is our Big list of goods."; mes " "; mes "(Note T stands for a Treasure Token.)"; next; mes "[Ash]"; mes "This is what we have to offer."; next; switch( select("Trade for zeny", "Trade for Weapons", "Trade for Cards", "Nevermind") ) { case 1: // Subtract 1 from the choice (Select Options are 1 to X) but arrays are 0 - X so we subtract 1... start at 0... and send to function .@choice = select("5,000,000z - 1T","50,000,000z - 10T","500,00,000z - 100T","Nevermind") - 1; thqs_trade_token(.@choice); case 2: mes "[Ash]"; mes "This is what we have to offer."; next; .@choice = select("Axe's","1 Handed Swords","2 Handed Swords","Book's","Bow's","Katar's","Knuckle's","Mace's","Whips","Wands","Nevermind"); ths_menu_weapons(.@choice); case 3: mes "[Ash]"; mes "This is what we have to offer."; next; thqs_menu_buy("$THQS_menu_cards","$THQS_menu_price"); case 4: close; } end; }
-
Here you go // Trades tokens // getarg(0) - number of tokens to be traded function script thqs_trade_token { // getarg(0) == Token Option .@index = getarg(0); // Number of Tokens .@token_count[0], 1, 10, 100; .@zeny_amt[0],5000000,50000000,500000000; // If Nevermind was selected if (.@index == 3) { close; } if (#Treasure_Token < .@token_count[.@index]) { mes "You don't have enough tokens!"; close; } if ( ( Zeny == MAX_ZENY ) || ( ( Zeny + .@zeny_amt[.@index] ) > MAX_ZENY) { mes "You are already at max Zeny or this trade will go over max zeny"; close; } Zeny += .@zeny_amt[.@index]; #Treasure_Token -= .@token_amount[.@index]; close; } // Main script prt_in,164,174,1 script Treasure Hunter's Shop 1_M_YOUNGKNIGHT,{ mes "[Ash]"; mes "Ahh, "+strcharinfo(PC_NAME)+"! Welcome to the Offical Treasure Hunter's Guild Shop."; mes "You currently have ^FF0000"+#Treasure_Token+"^000000 treasure tokens!!!"; next; switch( select("How does this place work?","What do you have in stock?","Nevermind") ) { case 1: mes "[Ash]"; mes "Well you see here you can exchange your treasure hunter tokens for zeny or rare weapons forged by our blacksmiths."; mes " "; mes "Everything has its own price value and the only way you can get the tokens is by completing quests assigned to you,the system normally works like this."; mes " "; mes "The harder the mission the more Tokens you will earn. All red quests are worth 4-8 Tokens, and the rest are worth 1-5."; mes " "; mes "Hope that solves your problem and questions."; close; case 2: break; case 3: close; } mes "[Ash]"; mes "Ok here is our Big list of goods."; mes " "; mes "(Note T stands for a Treasure Token.)"; next; mes "[Ash]"; mes "This is what we have to offer."; next; switch( select("Trade for zeny", "Trade for Weapons", "Trade for Cards", "Nevermind") ) { case 1: // Subtract 1 from the choice (Select Options are 1 to X) but arrays are 0 - X so we subtract 1... start at 0... and send to function .@choice = select("5,000,000z - 1T","50,000,000z - 10T","500,00,000z - 100T","Nevermind") - 1; thqs_trade_token(.@choice); case 2: mes "[Ash]"; mes "This is what we have to offer."; next; .@choice = select("Axe's","1 Handed Swords","2 Handed Swords","Book's","Bow's","Katar's","Knuckle's","Mace's","Whips","Wands","Nevermind"); ths_menu_weapons(.@choice); case 3: mes "[Ash]"; mes "This is what we have to offer."; next; thqs_menu_buy("$THQS_menu_cards","$THQS_menu_price"); case 4: close; } end; }
-
What's wrong with the script that you have there?
-
I don't have my scripting command reference on me via mobile... But... OnPCLogoutEvent: Get value of timer... And play it in a perm char var... Then OnPCLoginEvent: first check for the existence of the perm char var... And if it exists... Addtimer... For .s_time - permcl char var... Else not exist... .s_time Also you will need to make sure to clear that perm char var on hourly pickup, or whenever else in the script the timer is reset or added... But it should work just fine
- 1 reply
-
- 1
-
-
Not an expert in waiting rooms... but it could have something to do with the quotes around the npc names... ".test$" it ".test$" not "value of .test$" ... Just a thought ? There are SEVERAL instances of that everywhere...
-
Sample is already given in the script look for other OnTimers there is probably one for event completed... If there is u can probably change it to OnTimer15000
-
You will need to setup an OnTimer15000: with that, check if the Event is active, if it hasn't already been guessed, end the event and restart it later OnClock####: etc
-
if ( countitem(#) || countitem(#) ) { // DO STUFF }
-
What?
-
npc that gives item to npc owner when players buys
Z3R0 replied to IvanD's question in Script Requests
Please be a little more specific, I do not understand what you are exactly asking for. Thanks, Z3R0 -
Literally change 5 to 10? What's the problem?
-
absolutely! If using an SQL Server which I think is common now-a-days you can do a simple query for the character login information for last_ip (don't know exactly what the column is...) From that extraction you should be able to do whatever you want to do from there...
-
About Usable Freebies box call func || box disappear when cancel
Z3R0 replied to AinsLord's question in Scripting Support
Instead of using select... use prompt Catch the 255 response as "cancel / closed" and give the box back to the player Regarding the menu they have there, that seems to be a custom client menu (no idea) -
You would simply have 1 npc with multiple functions... - script StatTracker -1,{ OnPCLoginEvent: // Gather Information from SQL, store in @vars OnPCLogoutEvent: // Push @vars back to SQL OnPCKillEvent: // Increase @pvp vars + 1 OnNPCKillEvent: // Increase @mobs killed + 1 OnPCDieEvent: // Decrease Death Vars + 1 } Something similar to that
-
According to https://github.com/rathena/rathena/blob/master/doc/script_commands.txt *unitskilluseid I think you need to either set a target or coordinates for that particular skill, because that skill is a clickable targetable skill on the ground? ... I could be wrong, but worth a shot? maybe just for testing purposes try to target ```unitskilluseid .wBossId, WZ_STORMGUST, 5, 125, 155;``` can't hurt?
-
Just have to say, full agree. Most NPC's can easily call an OnInit: function, that serves as the "basis" to pull information from SQL... This is a on time call, but grants you the ability to manipulate the server on the "fly" without having to deal with remembering what variables are what... You can make a change to the DB, call a refresh method and BAM, settings updated... (almost too magical...) Any time you are going to be doing cross game-browser, chances are you are going to need a SQL Table to handle the data... but like Skorm said, making sure it's not hammering it is definitely something to note... For instance, you don't want a click handler calling the DB every time someone clicks the NPC... (ew, no)... Now, say for instance it runs after a PVP Event... ok, well that's 1 time per event... not horrible... So yes, while you may need local and npc and temporary variables to manage the workings of the script, by all means, push them to sql when complete so you can query that data from your web browser or retrieve it later with a refresh function
-
... atoi(string) == integer value Not will return 0 even if not a valid number
-
Anything is possible. On quest acceptance instead of getitem... store a variable array on the char... Starry qShopStuff[0], .@iemid, 20170901,daytimetick; This integer is the following format... Year month day hour minute You specify it backwards that way you can compare it... If getarraysize(qShopStuff) then they have an open quest... claim it... Once claim attempt compare to current year month day ... if > 0 then it's been a day or more ok to claim, if 0 then compare time tick to 120000... if >= then it's ok to claim, else wait... Getitem qShopStuff[0] Deletearray qShopStuff[0], getarraysize(qShopStuff); Goodluck and happy hunting!
- 1 reply
-
- 1
-
-
Script that prevents players to enter an area until x mobs are killed
Z3R0 replied to TemplarOfTheMist's question in Scripting Support
*setcell "<map name>",<x1>,<y1>,<x2>,<y2>,<type>,<flag>; Example: setcell "schg_cas05",114,51,125,51,cell_walkable,0; use 1 or 0 to remove cell_walkable 0 is cannot walk, 1 is can- 1 reply
-
- 1
-
-
Yes, the array is registered with the following information char_id | name of variable | index of array | value so for instance, if you create array on character: setarray charArray[0], 1, 2, 3; you will have 3 values for 1 character... 150001 | charArray | 0 | 1 150001 | charArray | 1 | 2 150001 | charArray | 2 | 3
-
Well.. 1. I personally wouldn't give players the power to host events anymore... too much favortism... 2. Abusing it is probably going to happen.. unless your gm's are really awesome... but even then... 3. They are GM's, what items could they possibly want that they couldn't make? (Unless they are strictly Event GM's) ... 4. I personally instead of granting points per event, I would record in a SQL Log when they gave out rewards and to who, and monitor it and then you can just give them whatever item... or what not... - Not something I think should really exist anymore...
-
I'm actually working on this now, taking a small break from my other project. I believe I can get this done in about 1-2 days... PM me, and I will send you a link to my repo, so you can follow progress
-
Might be interested in attempting it, however I am working on some other projects right now, so if no one else offers to help, I can look at it when I have the time, doesn't appear to be too complicated.
-
How do the GM's host the events? They start it via an NPC?
-
Stolao, after looking the code in that function there are missing brackets... in F_ApplyOption.txt Line 56: setrandomoption(getarg(0,9),0,rand(RDMOPT_BODY_ATTR_NOTHING,RDMOPT_BODY_ATTR_UNDEAD),1,1; Missing an ending ) Same with the setrandomoption() below it haven't really looked deeper