Jump to content

Mumbles

Retired Staff
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by Mumbles


  1. 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;}

  2. 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");

  3. 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;}

  4. 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%.


  5.  

    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.).

     

    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:

    MQZb2Pl.png

     

    The live server is hosted in Los Angeles, roughly 380 miles away from me:

    Vbo5u4y.png

     

    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

  6. 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.).


  7. 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.

     

     

    Here's a debug script and some screenshots:

     

    -	script	str_test	-1,{	OnInit:		bindatcmd "test", strnpcinfo(3) +"::OnCommand", 99, 99;		OnCommand:		// Collect string data		for (.@i = 0; .@i < .@atcmd_numparameters; .@i++) {			.@str_data$[.@j++] = .@atcmd_parameters$[.@i];		}				.@string$ = implode(.@str_data$, " ");	// Updated method		.@string2$ = .@atcmd_parameters$[0];	// Current method				message strcharinfo(0), "Updated : "+ .@string$;	// Updated output		message strcharinfo(0), "Current : "+ .@string2$;	// Current output		end;}

     

     

    ReSRFNp.jpg

    b37eykN.jpg

     


  8. Yup. Mumbles doesn't know how to setup his servers properly! #facepalm

     

    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':


  9. 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

  10. If I set that @go costs 3k zeny, I wish it were only for users from group_id 0. Users with higher group_id are not needed to pay, are the exception.

     

    Is this bypass only for the Zeny cost? If so, edit line 70:

    		} else if (.charge && Zeny < getarg(5)) {
    		} else if (.charge && Zeny < getarg(5) && getgroupid() < .bypass_id) {

     

    Then, add this to line 46:

    		.bypass_id = 1;		// Minimum group ID to bypass zeny cost		
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.