-
Content Count
618 -
Joined
-
Last visited
-
Days Won
15
Content Type
Profiles
Forums
Downloads
Staff Applications
Calendar
Everything posted by Mumbles
-
This might be problematic when using menu to manipulate array indexes D: Example: mes .npc_name$; mes "Hello there, mighty warrior!"; mes "Which arena would you like to test your strength in?"; next; // Build list of arena names for (.@i = 0; .@i < getarraysize(.arena_data$); .@i += 4) { .@arena_name$[.@j++] = .arena_data$[.@i]; .@mode$[.@k++] = .arena_data$[.@i] +" ["+ getmapusers(.arena_data$[.@i + 1]) +"]"; } // Select desired arena menu implode(.@mode$, ":"), -; mes .npc_name$; .@key = @menu - 1; // Hercules //.@key = @menu - 2; // rAmod .@index = .@key * 4; // Determine map name .@map_name$ = .arena_data$[.@index + 1]; // Determine Base Level requirement .@base_req = atoi(.arena_data$[.@index + 2]); // Determine room limit .@room_limit = atoi(.arena_data$[.@index + 3]); *I'm also extremely rusty on scripting so maybe there's a better method by now lul
- 40 replies
-
- guides
- scripting support
-
(and 5 more)
Tagged with:
-
Right, in which case just change line 4: query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ getarg(0) +"'", .@party_id; to this: query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ escape_sql(getarg(0)) +"'", .@party_id;
-
Load this in once to delete cards from the .@card_id array from the server. Note that all players to be affected should be offline. Add card constants or IDs to the .@card_id array as needed. Be sure to unload this script once the task is completed. - script del_cards -1,{ OnInit: setarray .@table_name$[0], "inventory", "cart_inventory", "storage", "guild_storage", "mail", "auction"; // Card constants or IDs to delete setarray .@card_id[0], Golden_Bug_Card, Ifrit_Card, Ghostring_Card, Drake_Card; // Loop through all tables to clear for (.@i = 0; .@i < getarraysize(.@table_name$); .@i++) { // Loop through all cards to delete for (.@j = 0; .@j < getarraysize(.@card_id); .@j++) { // Delete card from table query_sql "DELETE FROM `"+ .@table_name$[.@i] +"` WHERE `nameid` = '"+ .@card_id[.@j] +"'"; // Remove compounded cards query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card0` = '0' WHERE `card0` = '"+ .@card_id[.@j] +"'"; query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card1` = '0' WHERE `card1` = '"+ .@card_id[.@j] +"'"; query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card2` = '0' WHERE `card2` = '"+ .@card_id[.@j] +"'"; query_sql "UPDATE `"+ .@table_name$[.@i] +"` SET `card3` = '0' WHERE `card3` = '"+ .@card_id[.@j] +"'"; } } // Confirm completion announce "Restricted cards have been removed from the server.", bc_all; end;}
-
Place this at the top of your script (below the header) and you'll be able to use getpartyid() to determine the party ID of the input party name. Alternatively, you could do something with getcharid(1), but it may require more writing than you'd like. // getpartyid("Party Name")function getpartyid { // Determine party ID query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ getarg(0) +"'", .@party_id; // Return false (0) if party not found if (!.@party_id) { return false; // Return party ID if found } else { return .@party_id; }} Example: // Determine party ID of party "Party Name".@party_id = getpartyid("Party Name");
-
Here's my own version, using temporary global vars for to allow for other uses of these MAC addresses (assuming you know what to do with them). - script dual_check -1,{ /*----------------------------------------------------- Determine MAC address [Harmony] -----------------------------------------------------*/ function getmacaddress { query_sql "SELECT `last_mac` FROM `login` WHERE `account_id` = '"+ getcharid(3) +"'", .@mac_address$; return .@mac_address$; } /*----------------------------------------------------- Log MAC address to array -----------------------------------------------------*/ OnPCLoginEvent: // Log MAC address .@user_mac$ = getmacaddress(); // Loop through all map exceptions (if enabled) for (.@i = 0; .@i < getarraysize(.allow_map$) && .map_exceptions; .@i++) { // Determine if player's map is excepted if (strcharinfo(3) == .allow_map$[.@i]) { // Bypass flag .@bypass = 1; break; } } // Loop through entire MAC address list if no bypass flag for (.@i = 0; .@i < getarraysize($@mac_list$) && !.@bypass; .@i++) { // Determine if user's MAC address is already logged if (.@user_mac$ == $@mac_list$[.@i]) { // Jail user for dual-clienting atcommand "@jailfor "+ .jail_time$ +" "+ strcharinfo(0); // Message delay sleep2 100; // Error message message strcharinfo(0), "Dual-clienting is not allowed."; break; } } // Add user's MAC address to log $@mac_list$[getarraysize($@mac_list$)] = .@user_mac$; end; /*----------------------------------------------------- Remove single MAC address entry -----------------------------------------------------*/ OnPCLogoutEvent: // Log MAC address .@user_mac$ = getmacaddress(); // Loop through entire MAC address list for (.@i = 0; .@i < getarraysize($@mac_list$); .@i++) { // Find matching MAC address if (.@user_mac$ == $@mac_list$[.@i]) { // Delete single entry deletearray $@mac_list$[.@i], 1; } } end; /*----------------------------------------------------- Configuration -----------------------------------------------------*/ OnInit: // Jail for 10 years .jail_time$ = "10y"; // Allow map exceptions? 1: yes, 0: no .map_exceptions = 1; // Map exceptions setarray .allow_map$[0], "poring_w01", "poring_w02"; end;}
-
Take into consideration that cards drop at 0.01%. When adjusting rates, multiply 1/100th of the number you input by the base drop rate (in this case, 0.01%). If your item_rate_card is 500 (5.00), regular monster cards will drop at (0.01 x 5.00)%, or 0.05%. Similarly, if your item_rate_card_boss is 100 (1.00), boss cards will drop at (0.01 x 1.00)%, or 0.01%.
-
Remove some maps from @go & Remove MVP from @whodrops
Mumbles replied to Zirius's question in Source Support
Use this for @go (script-based) http://herc.ws/board/topic/3045-utility-go-command/ -
When storing string variables, you need to append them with the suffix $. .@var = 123;.@var$ = "abc"; If these variables are going under an OnInit label, make sure they're permanent NPC variables instead of temporary ones. .var = 123;.var$ = "abc"; These posts should help you get back into the basics of scripting: Crash Course: Scripting 101-A Crash Course: Scripting 101-B
-
Man From Morroc is in npc/quests/quests_nameless.txt
-
Choosing decent Server for hosting Hercules
Mumbles replied to Zirius's question in General Server Support
The lag happens everytime you talk to an NPC it would take a sec to have the response, like the 1-click heal+buff NPC, it would take 1 sec before the buffs and heal was given. Funny because I only have 400 maps in my server, and no custom script yet. Though what is seems like, I need a host whose ping back to me must be < 230ms, I think? Btw, what is the ping back you have from your host? My development server is hosted on my local machine: The live server is hosted in Los Angeles, roughly 380 miles away from me: If your ping to your current host is 200ms+, you're going to have a slight delay when interacting with NPCs and script-based interfaces. If you'd like to test your latency to a server hosted in Los Angeles, you can ping one of my development servers: play.rhythm.ro -
Choosing decent Server for hosting Hercules
Mumbles replied to Zirius's question in General Server Support
Depends what type of lag you are experiencing. If it's a latency issue where you're consistently "skipping" across the screen, it may be due to your own connection to your server (which would be silly, consider it's locally-hosted?). If you're experiencing a lot of server-side lag, review any custom scripts you've got loaded; some of them may be extremely memory-intensive (i.e. Toasty's WoE Controller, loadevent/OnPCLoadMapevent mapflags/labels, etc.). -
Aesir site appears to be down, and the demo has an error on it (at the time of this posting).
-
As it's currently written, this won't function completely for a couple of reasons. .@p_name$ = .@atcmd_parameters$[1]; This only pulls the second position of the index. If you syntax is @adjgroup2 99 Player B, the script will only read it as @adjgroup2 99 Player. The biggest problem with this is that if there are two players online named Player A and Player B, the script might unintentionally change Player A's group; you won't immediately know for sure, since your variable .@p_name$ will only store "Player". A proper way to determine the player's name would be to store additional values past index 1. When you type @adjgroup2 99 Player B, the following values are stored: .@atcmd_command$ = "@adjgroup2";.@atcmd_parameters$[0] = "99";.@atcmd_parameters$[1] = "Player";.@atcmd_parameters$[2] = "B";.@atcmd_numparameters = 3; Using this information, you can collect the additional player information by copying the array values and imploding them, separated by spaces: for (.@i = 1; .@i < .@atcmd_numparameters; .@i++) { .@name_data$[.@j++] = .@atcmd_parameters$[.@i];}.@p_name$ = implode(.@name_data$, " "); Now .@p_name$ will properly store the name Player B, or whatever name you send that has spaces in it. .@account_id = getcharid(3, .@p_name$); The problem here is that getcharid() will only return a value if the player is online and can be attached to the script (this would have been a problem with .@p_name$ anyway, since it was incorrectly storing player names); if Player B is offline, .@account_id will have a value of 0. Normally, this would be fine, since you added a check to determine whether or not a player exists on the map server; however, it seems you're trying to update the account regardless of whether or not a player is online. A more efficient way of collecting a player's account ID would be to query the database using their (now properly stored) player name. .@account_id = query_sql("SELECT `account_id` FROM `char` WHERE `name` = '"+ .@p_name$ +"'"); Using the function query_sql() will return the value found; if the player truly does not exist at all, the function will return 0. In that case, you can replace this check with a simpler one: .@exist = query_sql("SELECT `group_id` FROM `login` WHERE `account_id`="+.@account_id, .@g_id); if (!.@exist){ message strcharinfo(0), .@p_name$ +" Does not Exist."; end; } if (!.@account_id){ message strcharinfo(0), .@p_name$ +" does not exist."; end; } query_sql "SELECT `group_id` FROM `login` WHERE `account_id` = '"+ .@account_id +"'", .@g_id; With these changes made, the rest of the script and checks will run just fine.
-
About Transcended Jobs on Hercules SVN
Mumbles replied to ThyroDree's question in General Server Support
You only need to uncomment line 24 now: #define DISABLE_RENEWAL -
I would go as far to say that lol. My secondary char-server disconnected from the login-server after I shut it down temporarily and got "DDoSed" by the map-server. c':
-
Read their description.
-
Ubiquity Hosting, $4.95/mo: https://www.ubiquityhosting.com/services/shared
-
For the PayPalIpnUrl, use www.paypal.com to accept donations. Make sure you set your PayPalBusinessEmail to the PayPal email address you use to accept payments. This is typically your login email as well. If my email address to accept payments is [email protected], then I would set that as the value for my PayPalBusinessEmail. Leave the PayPalReceiverEmails array alone. Also, don't forget to add Flux to your PayPal IPN settings. Your IPN URL should look something like this: http://my.ragnarok.ws/?module=donate&action=notify
-
Pedido Blue Ghost setup
Mumbles replied to Kuroko Sempai's question in Soporte y peticiones sobre el Cliente
De nada. Tema cerrado. -
Pedido Blue Ghost setup
Mumbles replied to Kuroko Sempai's question in Soporte y peticiones sobre el Cliente
Here's a ZIP archive containing the file you requested: http://www.mediafire.com/download/9yu5xgex7fqsk8p -
On many clients, the EXP bar won't show from level 99 to 100 - even if your server is configured to have a higher max level. Keep leveling [blindly] until you hit 100!
-
Glad to hear that; you're welcome!
-
Your image is unable to completely load. Could you re-upload it to http://imgur.com and embed that one?
-
Edit this: } else if (.delay && @go_delay > gettimetick(2)) { } else if (.delay && @go_delay > gettimetick(2) && getgroupid() < .bypass_id) {