-
Posts
245 -
Joined
-
Last visited
-
Days Won
19
Content Type
Profiles
Forums
Downloads
Jobs Available
Server Database
Third-Party Services
Top Guides
Store
Crowdfunding
Everything posted by Winterfox
-
Adding unique id feature w/ reset each day
Winterfox replied to Gidz Cross's question in Source Support
Then i assume there is a function that gives you the unique id of a connected user, that you can use. -
It takes a number from 0 to 2 and depending on which number you give it, it returns one of the described values.
-
- script STREAMER_SUPPLY FAKE_NPC,{ OnInit: bindatcmd("registerStreamer", strnpcinfo(3) + "::OnRegisterStreamer", 99); bindatcmd("unregisterStreamer", strnpcinfo(3) + "::OnUnregisterStreamer", 99); .reward_item_id = 502; .reward_item_amount = 2; end; OnRegisterStreamer: OnUnregisterStreamer: if(.@atcmd_numparameters < 1) dispbottom("Usage: " + .@atcmd_command$ + " <charname>"); .@switch = (.@atcmd_command$ == "@registerStreamer") ? 1 : 0; charcommand("#set " + .@atcmd_parameters$[0] + " #STREAMER " + .@switch); end; // Every night at 00 OnHour00: // Get all streamers query_sql("SELECT account_id FROM acc_reg_num WHERE `key` = \"#STREAMER\" AND value = 1;", .@streamer_acc_ids); for(.@i = 0; .@i < getarraysize(.@streamer_acc_ids); .@i) { // If the streamer is online hand out a reward. if(attachrid(.@streamer_acc_ids[.@i])) { getitem(.reward_item_id, .reward_item_amount); detachrid; } } } prontera,124,201,1 script Streamer Supplies 726,{ mes "[ Streamer Supplies ]"; mes "You are " + ((#STREAMER == 0) ? "no" : "an") + " Streamer!"; close; }
-
Adding unique id feature w/ reset each day
Winterfox replied to Gidz Cross's question in Source Support
You need an additional modification in your client to send some unique identifier based on the players pc to the server, that you can at least identify a unique pc to prevent most of the abuse via the usage of multiple accounts. You will also need the server to be able to handle the send unique id and to have it hand it over to your script so that it can make use of it. But even then it will be possible to abuse the it by the usage of virtual machines for example. There isn't any fool proof method to make sure, a player can't somehow abuse free giveaway items. -
script blacksmith refining item that cannot be refined
Winterfox replied to IsabelaFernandez's question in Scripting Support
You forgot the getequipid in your inarray comparisons. -
Poring Soccer [Does not start the game]
Winterfox replied to Yukaiii's question in Scripting Support
You get those errors on your screenshot because the OnInit label in the PBE#disable NPC gets called before the walls it tries to delete have been created. -
PVP_Reward NPC im getting SQL DB error
Winterfox replied to koneko33's question in Scripting Support
You need to alter the char table and add the pvpreward colum. The sql is even inside the script you posted. ALTER TABLE `char` ADD `pvpreward` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0' AFTER `fame`; -
How to get random 1 item from the list
Winterfox replied to Dolphin86's question in Scripting Support
// Change setarray(.crafting_recipe_p1_t2_products, 40101, 1,40102, 1,40103, 1,40104, 1,40105, 1); // to setarray(.crafting_recipe_p1_t2_products, 40101, 40102, 40103, 40104, 40105); setarray(.crafting_recipe_p1_t2_amounts, 1, 1, 1, 1, 1); // To handout 1 random item you do it like this: .@item_index = rand(getarraysize(.crafting_recipe_p1_t2_products)); getitem(.crafting_recipe_p1_t2_products[.@item_index], .crafting_recipe_p1_t2_amounts[.@item_ind//sex]); // To handout all items you do it like this: for(.@i = 0; .@i < getarraysize(.crafting_recipe_p1_t2_products); .@i++) { getitem(.crafting_recipe_p1_t2_products[.@i], .crafting_recipe_p1_t2_amounts[.@i]); } -
-
error adding custom command for specific group
Winterfox replied to IsabelaFernandez's question in General Support
You should check out the script documentation. There you can see that bindatcmd takes the minimum group level that is allowed to run the atcommand as the third parameter. *bindatcmd "<command>","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; This command will bind a NPC event label to an atcommand. Upon execution of the atcommand, the user will invoke the NPC event label. Each atcommand is only allowed one binding. If you rebind, it will override the original binding. Note: The default level for atcommand is 0 while the default level for charcommand is 100. -
I tested this on an unmodified current rAthena and can't reproduce the bug. Do you have a more detailed explanation of the steps to reproduce it?
-
Is it possible to get item when a specific cell is stepped on?
Winterfox replied to sakura125's question in Script Requests
You can use a function like this: prontera,152,178,0 script FINISH_TELEPORT_1 -1,0,0,{ OnTouch: callfunc("prize_teleport"); } prontera,149,178,0 script FINISH_TELEPORT_2 -1,0,0,{ OnTouch: callfunc("prize_teleport"); } function script prize_teleport { if(!#maze_prize_received) { getitembound(501, 1, Bound_Account); #maze_prize_received = 1; } else { dispbottom("You already got the prize!"); } warp("prontera", 150, 150); return; } Or you can simply duplicate the NPC and move the copy to where you need it. prontera,152,178,0 script FINISH_TELEPORT -1,0,0,{ OnTouch: // Check if the prize was already received. if(!#maze_prize_received) { // If the price wasn't received. Handout the item and set the account variable to 1 to signal that the prize was received. getitembound(501, 1, Bound_Account); #maze_prize_received = 1; } else { // Otherwise show a message to the player. dispbottom("You already got the prize!"); } // Warp the player. warp("prontera", 150, 150); } prontera,149,178,0 duplicate(FINISH_TELEPORT) FINISH_TELEPORT#01 -1,0,0 -
I never used map_drop myself, but I assume that it works for all mobs that are on the specified map regardless of if they have a label or something.
-
Is it possible to get item when a specific cell is stepped on?
Winterfox replied to sakura125's question in Script Requests
I see. Well there are different kinds of variables you can use which are bound to different things, for example to a NPC, a character or an account. In your case, you can simply use an account bound variable, that you can set to 1, when an account got a prize that you can later use to check if a prize was already obtained. For example, you could extend the script above like this: prontera,152,178,5 script FINISH_TELEPORT INVISIBLE,0,0,{ OnTouch: // Check if the prize was already received. if(!#maze_prize_received) { // If the price wasn't received. Handout the item and set the account variable to 1 to signal that the prize was received. getitembound(501, 1, Bound_Account); #maze_prize_received = 1; } else { // Otherwise show a message to the player. dispbottom("You already got the prize!"); } // Warp the player. warp("prontera", 150, 150); } -
Is it possible to get item when a specific cell is stepped on?
Winterfox replied to sakura125's question in Script Requests
Sorry, I don't understand your question. Could you please explain, in a bit more detail, what you want to achieve? -
For your script: The OnNPCKillEvent only gets executed when the killed mob doesn't have an attached label. For your YAML: You can't use tabs for indentation in YAML files, you also forgot to place a space between - and Index and between each parameter and its value. Here is an example of the YAML: Header: Type: MAP_DROP_DB Version: 2 Body: - Map: lhz_dun_n Globaldrops: - Index: 0 Item: Bio_Reseearch_Docu Rate: 2 - Index: 1 Item: Bio_Test_Fragment Rate: 2
-
does anyone help me script Witch Zilant Card
Winterfox replied to MyNoobScriptz's question in Script Requests
It doesn't seem that it is possible to do via scripting currently. There need to be source modifications done to make it possible. -
Is it possible to get item when a specific cell is stepped on?
Winterfox replied to sakura125's question in Script Requests
You can achieve that by creating an invisible NPC with a trigger zone. Here is a small example: // The view id is INVISIBLE to make the NPC not clickable and as the name suggests inivisible. // 0,0 is the x and y span centered around the NPC coordinates. prontera,152,178,5 script FINISH_TELEPORT INVISIBLE,0,0,{ OnTouch: // < This label gets executed when someone enters the trigger zone at the NPC coordinates. getitembound(501, 1, Bound_Account); // Creates a account bound item. warp("prontera", 150, 150); // Warps the player to the configured coordinates. } -
*freeloop({<toggle>}) Toggling this to enabled (1) allows the script instance to bypass the infinite loop protection, allowing your script to loop as much as it may need. Disabling (0) will warn you if an infinite loop is detected. The command will return the state of freeloop for the attached script, even if no argument is provided. Example: freeloop(1); // enable script to loop freely // be careful with what you do here for ( .@i = 0; .@i < .@bigloop; .@i++ ) { dothis; // will sleep the script for 1ms when detect an infinity loop to // let rAthena do what it needs to do (socket, timer, process, etc.) } freeloop(0); // disable freeloop for ( .@i = 0; .@i < .@bigloop; .@i++ ) { dothis; // throw an infinity loop error }
-
Seems to be a problem specific to your emulator. I can't reproduce this error on the current rAthena.
-
- script Freeitem FAKE_NPC,{ OnInit: .min_lvl = 70; .required_map$ = "izlude"; .item_id = 501; .amount = 1; .item_name = getitemname(.item_id); end; OnClock0000: addrid(0); getmapxy(.@current_map$, .@x, .@y); if(BaseLevel < .min_lvl || .@current_map$ != .required_map$) end; getitem(.item_id, .amount); message(strcharinfo(0), "ท่านได้ของรางวัลเป็น " + .@item_name$ + "."); }
-
- script ::TALL_GRASS_MAIN FAKE_NPC,{ mes "=== Select Tools ==="; switch(select("- Stone Blade:- Bone Blade:- Cancel")) { clear; case 1: if (!rentalcountitem(40024)) { mes "Stone Blade is needed."; close; } if(!countitem(40044) && !countitem(40067)) end; if(countitem(40067)) { if(rand(1, 100) <= .drop_chances[0]) getitem(.@stone_items[rand(getarraysize(.@stone_items))], 1); } getitem(40006, 1); getitem(40008, 1); end; case 2: if (!rentalcountitem(40058)) { mes "Stone Blade is needed."; close; } if(!countitem(40044) && !countitem(40067)) end; if(countitem(40067)) { if(rand(1, 100) <= .drop_chances[1]) getitem(.@bone_items[rand(getarraysize(.@bone_items))], 1); } getitem(40008, 1); getitem(40006, 1); end; case 3: mes "Gathering Cancel"; close; } OnInit: setarray(.stone_items[0], 40068, 40069, 40070, 40071, 40072); setarray(.bone_items[0], 40068, 40069, 40070, 40071, 40072); setarray(.drop_chances, 5, 10); } // Duplicates //============================================================ neko_isle,75,122,6 duplicate(TALL_GRASS_MAIN) Tall Grass#new11 666 new_1-3,111,73,6 duplicate(TALL_GRASS_MAIN) Tall Grass#new12 666 new_1-3,115,71,6 duplicate(TALL_GRASS_MAIN) Tall Grass#new13 666 new_1-3,119,71,6 duplicate(TALL_GRASS_MAIN) Tall Grass#new14 666 new_1-3,123,71,6 duplicate(TALL_GRASS_MAIN) Tall Grass#new15 666 new_1-3,127,71,6 duplicate(TALL_GRASS_MAIN) Tall Grass#new16 666 new_1-3,131,72,6 duplicate(TALL_GRASS_MAIN) Tall Grass#new17 666
-
//===== eAthena Script ======================================= //= Breeder //===== By: ================================================== //= Ace //===== Current Version: ===================================== //= 1.2 //===== Compatible With: ===================================== //= rAthena SVN 15400 and up. //= Client that supports new mounts. //===== Description: ========================================= //= Known as "Universal Rental NPC" //= Let's a player rent a pecopeco, falcon, cart, warg //= or ride a dragon, gryphon, and mado. //===== Changelog: =========================================== //= 1.1 Added Peco peco option, forgot to. //= Changed KN_RIDING to RK_DRAGONTRAINING //= for renting dragons. //= 1.2 Added restrictions for renting falcons and wargs. //= Added Warg Mastery skill requirement. //===== Additional Comments: ================================= //= No bugs found so far. //= Please report bugs to me([email protected]) //============================================================ - script gbreeder 726,{ mes "^FF0000Universal Rental NPC^000000"; mes "Greetings " + strcharinfo(0) + "!"; mes "I provide you with the service to "; mes "rent a cart or animal companion."; mes "The price for this service is " + .service_fee + "z."; mes "How may I help you today?"; next; if(select("Rental Services:Cancel") == 2) { mes "^FF0000Universal Rental NPC^000000"; mes "Alright, come again!"; close; } if(.service_fee > Zeny) { mes "^FF0000Universal Rental NPC^000000"; mes "Sadly you don't have enoug money."; mes "Please come back when you have it."; close; } mes "^FF0000Universal Rental NPC^000000"; mes "Please select from the items below:"; switch(select("PecoPeco:Cart:Falcon")) { case 1: // Pecopeco if(checkriding() || getskilllv("KN_RIDING")) { mes "Sorry, please make sure that you have the required job and skill, also not riding one."; close; } setriding(); mes "There you go, enjoy your Peco Peco!"; close; case 2: // Cart if(checkcart() || getskilllv("MC_PUSHCART")) { mes "Sorry, please make sure that you have the required job and skill, also not having a cart."; close; } setcart(); mes "There you go, enjoy your cart!"; close; case 3: // Falcon if(BaseClass != Job_Archer || checkfalcon() && getskilllv("HT_FALCON")) { mes "Sorry, please make sure that you have the required job and skill, also not having a falcon."; close; } if((Class == Job_Ranger || Class == Job_Ranger_T) && checkriding()) { mes "Sorry, You can't rent a falcon while having a warg with you."; close; } setfalcon(); mes "There you go, have fun with your falcon!"; close; } OnTimer0050: showscript("Universal Rental", getnpcid(0)); initnpctimer(); end; OnInit: .service_fee = 500; initnpctimer(); end; } //===== Duplicates: ========================================== //payon,140,222,5 duplicate(gbreeder) Universal Rental NPC#1 726 payon,151,167,5 duplicate(gbreeder) Universal Rental NPC#1 726 //============================================================ eclage,116,37,5 duplicate(gbreeder) Universal Rental NPC#100 726 bg_lobby,60,42,4 duplicate(gbreeder) Universal Rental NPC#1123 726
-
[Error]: script:op_2: invalid data for operator C_EQ
Winterfox replied to eloscar23's question in Scripting Support
I didn't test it, but I would do write the kind of script you want to do like this: prontera,146,161,5 script CheckRank 118,{ mes .npc_name; mes "Hello, this is a MvP Ranker"; mes "Would you like to know the MvP Ranking?"; next; if(select("Top 20:Leave") == 2) { mes.npcranker; mes "Bye"; close; } mes.npc_name; for(.@i = 0; .@i < 20; .@i++) mes "The Top " + (.@i + 1) + " MVP: " + $top_mvp_names$[.@i] + " Killed: " + $top_mvp_kills$[.@i] + "."; close; OnInit: .npc_name = "[MvP Ranker]"; } - script MVP_RANKER FAKE_NPC,{ OnNPCKillEvent: if(killedrid != 1002) end; mvp_rank_points++; dispbottom("You have obtained 1 Rank Point. You now have " + mvp_rank_points + "."); callfunc("updateMVPRank", strcharinfo(0), mvp_rank_points); } function script updateMVPRank { .@curr_name$ = getarg(0); .@curr_kills = getarg(1); for(.@i = 0; .@i < 20; .@i++) { if($top_mvp_kills$[.@i] < .@curr_kills && $top_mvp_names$[.@i] != .@curr_name$) { .@new_name = .@curr_name; .@new_kills = .@curr_kills; .@curr_name = $top_mvp_names$[.@i]; .@curr_kills = $top_mvp_kills$[.@i]; $top_mvp_names$[.@i] = .@new_name; $top_mvp_kills$[.@i] = .@new_kills; continue; } if($top_mvp_kills$[.@i] < .@curr_kills) { $top_mvp_kills$[.@i] = .@curr_kills; break; } } } -
[Error]: script:op_2: invalid data for operator C_EQ
Winterfox replied to eloscar23's question in Scripting Support
.@nombre == strcharinfo(0) You compare a numeric variable with a string.