Jump to content

Mumbles

Retired Staff
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    15

Posts posted by Mumbles


  1. Ops, sorry, my mistake. It would be possible to use a warp afterwards, having to replace every warp that goes to a map would be a pain, and also every warp npc would have to mimic that invisible line that all warps have that triggers them.

     

    Yeah, but OnPCLoadMapEvent runs through all maps that have a loadevent mapflag, which can cause high stress on the server when several players load those maps continuously. Understandably, there are some scenarios where a map isn't accessed by warp portal and OnPCLoadMapEvent would be appropriate; however, in this case the topic starter simply wanted a portal for quest-like purposes (and likely seamless integration). Sure, you'd have to disable existing warps that you would replace this "quest warp" with, but it would make sense that this tedium would be found in sensible applications, such as blocking off all warp-portal entrances into Morroc or something - and even so, this can be done by using duplicate to copy your script over without actually having to add another file/script.


  2. It's better to use the mapflag loadevent.

     

    Why would it be? OnPCLoadMapEvent doesn't run until the player is already on the map. Your example would leave the player on the map itself after simply prompting them that they needed to have something to be there; then with that close, they'd walk happily off, confused as to why they were even told such a thing.

     

    Mhalicot's approach was on the right track, but I believe the topic starter would something more seamless. Here's my method:

     

    prontera,150,150,0	script	testwarp	WARPNPC,1,1,{	/*-----------------------------------------------------	Configuration	-----------------------------------------------------*/	OnInit:		.item_id = Jellopy;		.item_amount = 1;		.warp_map$ = "prontera";		.warp_x = 155;		.warp_y = 179;		end;			/*-----------------------------------------------------	Script	-----------------------------------------------------*/	OnTouch:		if (countitem(.item_id) < .item_amount) {			message strcharinfo(0), "You need "+ .item_amount +" "+ getitemname(.item_id) +" to access this warp.";		} else {			delitem .item_id, .item_amount;			warp .warp_map$, .warp_x, .warp_y;		}				end;}

  3. Here's a version that pulls a "rare" item from the array .rare_id and determines whether or not you have received it, defined by the chance allocated after it (format: <item constant/ID>, <chance>):

     

    prontera,147,174,5	script	Odd Fellow::randomstuff	1_M_WIZARD,{	/*-----------------------------------------------------	Script	-----------------------------------------------------*/	mes .npc_name$;	mes "Hello there! For "+ .coin_amount +" "+ getitemname(.coin_id) +", I'll give you a random item!";	next;		mes .npc_name$;	if (countitem(.coin_id) < .coin_amount) {		mes "Come back when you have "+ .coin_amount +" "+ getitemname(.coin_id) +"!";		close;	}	mes "Would you like to give it a try?";	next;		if (select("Sure, why not!:No, thanks") == 2) {		mes .npc_name$;		mes "Okay, come back if you change your mind!";		close;	}		// Generate random prize ID	do {		.@prize_id = rand(.prize_min_id, .prize_max_id);	} while (getitemname(.@prize_id) == "null");		// Determine index location of rare item to randomly pick from	do {		.@rare_index = rand(getarraysize(.rare_id));	} while (.@rare_id % 2);		// Determine whether or not to change prize to rare item	if (!rand(.rare_id[.@rare_index + 1])) {		.@prize_id = .@rare_id;	}		mes .npc_name$;	mes "Here you go! You got "+ .prize_amount +" "+ getitemname(.@prize_id) +"!";		getitem .@prize_id, .prize_amount;	close;			/*-----------------------------------------------------	Configuration	-----------------------------------------------------*/	OnInit:		.npc_name$ = "[Odd Fellow]";		.coin_id = Poring_Coin;	// Coin constant/ID		.coin_amount = 1;		// Count amount required		.prize_min_id = 501;	// Prize minimum ID		.prize_max_id = 30000;	// Prize maximum ID		.prize_amount = 1;		// Prize amount rewarded				// Rare item constants/IDs and chance in x to obtain rare item (default: 5 [20%])		setarray .rare_id[0], Apple, 10, Red_Potion, 20, Jellopy, 30, Fluff, 4, Clover, 5;		end;}

  4. The delitem command is triggered when the item is not null otherwise it does nothing. though i can say a do while loop is a better approach :P

     

     

    Ah, I didn't see that (I just skimmed tbh). But yeah, a do...while seemed more efficient, to me.

     


     

    @@Yugosh:

    After reviewing what I posted earlier, I realised I forgot to add a 'delitem' in there for the Poring Coin. Please refer to my previous post for an updated version.

     

    Regarding a chance to get a rare item, you would need to create an array containing a set of rare items and add a randomizer for it.


  5. Here, give this a try:

     

    prontera,147,174,5	script	Odd Fellow::randomstuff	1_M_WIZARD,{	/*-----------------------------------------------------	Script	-----------------------------------------------------*/	mes .npc_name$;	mes "Hello there! For "+ .coin_amount +" "+ getitemname(.coin_id) +", I'll give you a random item!";	next;		mes .npc_name$;	if (countitem(.coin_id) < .coin_amount) {		mes "Come back when you have "+ .coin_amount +" "+ getitemname(.coin_id) +"!";		close;	}	mes "Would you like to give it a try?";	next;		if (select("Sure, why not!:No, thanks") == 2) {		mes .npc_name$;		mes "Okay, come back if you change your mind!";		close;	}		do {		.@prize_id = rand(.prize_min_id, .prize_max_id);	} while (getitemname(.@prize_id) == "null");		mes .npc_name$;	mes "Here you go! You got "+ .prize_amount +" "+ getitemname(.@prize_id) +"!";			delitem .coin_id, .coin_amount;	getitem .@prize_id, .prize_amount;	close;			/*-----------------------------------------------------	Configuration	-----------------------------------------------------*/	OnInit:		.npc_name$ = "[Odd Fellow]";		.coin_id = Poring_Coin;	// Coin ID		.coin_amount = 1;		// Count amount required		.prize_min_id = 501;	// Prize minimum ID		.prize_max_id = 30000;	// Prize maximum ID		.prize_amount = 1;		// Prize amount rewarded		end;}

  6.  

    prontera,150,150,0	script	Sample	100,{	if ( !countitem( 7539 ) ) {		mes "You need 1 " +getitemname( 7539 )+ " in order to talk to me";		close;	}	if ( select( "Here have my " +getitemname( 7539 )+ ":Nevermind" ) - 1 ) close;	.@r = rand(501, 700);	if ( getitemname( .@r ) != "null" ) {		delitem 7539, 1;		getitem .@r, 1;	}	close;}

     

    Might be a good idea to enclose that set for .@r in a do..while loop; if the item name does end up being "null", the user's item is taken and doesn't get anything lol.

     

     

    do {	.@r = rand(501, 700);} while (getitemname(.@r) != "null");

  7. Thank you Sir.. Is there a script that prevent from user to close or cancel the window? I want to make the selection required to the user.

     

    Change this:

    while (true) {

    To this:

    do {

     

    Then change this:

    menu implode(.job_name$, ":"), -;

    To this:

    prompt implode(.job_name$, ":"), -;

     

    And this:

    		case 3:			close;	}}

    To this:

    		case 3:			close;	}} while (@menu == 255);

     

    Lastly, change this:

    case 2:	break;

    To this:

    case 2:	@menu = 255;	break;

     


     

    I haven't actually tested this information, but if it's incorrect, then just rewrite it using prompt instead of menu, with a do...while loop to counter control it in the same manner I explained.


  8. Sir, How to change this to NPC? that will require 1 TCG before job change.

     

    Add this directly after the OnInit label:

    .tcg_id = TCG_Card;.tcg_amount = 1;

     

    And this directly after the case 1 label:

    if (countitem(.tcg_id) < .tcg_amount) {	message strcharinfo(0), "You need "+ .tcg_amount +" "+ getitemname(.tcg_id) +" to change jobs.";	close;}

  9. Change your char, login, and map IPs to your No-IP address. Test if you can connect to your server by using your No-IP address in your clientinfo.xml; if you can't, it might be because you are connected to the internet behind a firewall, wireless router, or both.

     

    In this case, add login-server.exe, char-server.exe, and map-server.exe  or ports (6900, 6121, and 5121) to your firewall exceptions; for a wireless router, you'll need to forward those ports to your LAN IP (typically 192.168.1.x). You can find your LAN IP address by running a command prompt and typing ipconfig /all and looking for the IPv4 Address. Also take a note of the Default Gateway, as you'll need to be able to access your router's settings by connecting to that IP address.

     

    Alternatively, download, install, and set up a VPN with Hamachi - it's free and intuitive. You'll be provided with a IPv4 address that you can use in place of the No-IP address, and you won't have to worry about firewalls, routers or port forwarding. Note that you'll have to have anyone else you want to play with on your Hamachi network (meaning they have to install it too), or they won't be able to connect. Additionally, you'll only be able to play with up to four other people on your free network (unless you join everyone else's), but if you're just playing with your girlfriend then this would be the easiest solution for you.


  10. As of today, there are only two active Script Developers (that I'm aware of). I don't keep tabs on everyone, but this a quick glance of what I've gathered in the last couple of weeks:

    • @kisuka - working on a range of official features, including Criatura Academy
    • - collects, verifies, and develops information from official server(s)

    Former Script Developers aren't listed due to the fact that they are currently unavailable to work directly on Hercules.

     

     

    Disclaimer:

    This information is based purely on observation and in no way confirms whether or not someone is actually performing these particular tasks right now.


  11. Making modifications to cache and index maps is easy. Use Shin's WeeMapCache to add new GATs to your cache in db/pre-re/map_cache.dat or db/re/map_cache.dat. You'll also need to add the map name in db/map_index.txt and conf/maps.conf, but that's about as much "source" modification you'd need to make. If you're concerned with the need to recompile, it really isn't a hassle if you only compile the map cache; similarly, you would have to do a similar process and compile your plugin anyway for it to work, which would likely end up being more time-consuming than necessary.

     

    To compile only the map cache (on Linux), run these commands from your server's root folder:

    ./configuremake tools

     

    ...and that's it! For MSVC builds, you'll need to recompile the mapcache project, which is just a matter of right-clicking and choosing Compile.

     


     

    Bottom line is, having a plugin-based method to update the map cache and index would be less efficient than simply adding them manually.


  12. How to limit Admin's *allstats, *item to another player etc without limiting other admin commands 

     

    I just want to limit commands to help other players with giving items,lvlup,baselvlup and stats

     

    You can adjust specific commands for administrators by adding false as a second parameter in conf/groups.conf, which disables the charcommand (#) usage of the command. Honestly, though, if you don't trust your administrator(s) that much, then you should simply just move them to a different group with less commands in general.

     

    Example:

    {	id: 99	name: "Admin"	level: 99	inherit: ( "Support", "Law Enforcement" )	commands: {		/* not necessary due to all_commands: true */		allskill: [true, false]		allstats: [true, false]		skpoint: [true, false]		stpoint: [true, false]		str: [true, false]		agi: [true, false]		vit: [true, false]		int: [true, false]		dex: [true, false]		luk: [true, false]		item: [true, false]		blvl: [true, false]		jlvl: [true, false]		glvl: [true, false]		zeny: [true, false]	}	log_commands: true	permissions: {		can_trade: true		can_trade_bound: false		can_party: true		all_skill: false		all_equipment: false		skill_unconditional: false		use_check: true		use_changemaptype: true		all_commands: true		hchsys_admin: true	}}

  13. Sure thing; you can adjust the rate by editing the value for the .rate variable in the configuration.

     

    	/*-----------------------------------------------------	Configuration	-----------------------------------------------------*/	OnInit:		.npc_name$ = "[^0000FFDonation Manager^000000]";		.rate = 20;		// Exchange rate (1 Cash Point * rate = total PoDs)		.pod_id = 7179;	// Proof of Donation item ID		.pod_name$ = getitemname(.pod_id) +"(s)";	// Proof of Donation item name		.points_name$ = "Cash Point(s)";			// Points name		.points_var$ = "#CASHPOINTS";				// Points variable

  14. I wouldn't count on your host to get you the latest version of Hercules. Here's a download link straight from our repository: https://github.com/HerculesWS/Hercules/archive/master.zip

     

    If your server is running on Linux, download the ZIP using wget. Here's an example if you're using a terminal in a desktop environment:

    cd ~/Desktopwget https://github.com/HerculesWS/Hercules/archive/master.zipunzip master.zip
×
×
  • Create New...

Important Information

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