Jump to content

Mumbles

Retired Staff
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Mumbles

  1. I typically wouldn't place OnInit overhead, but due to the behaviour of the WARPNPC sprite, its script won't be run when clicked upon. Add this line above the OnInit label and see for yourself: message strcharinfo(0), "You touched me!"; However, I do concede that it would be good habit to throw an end up there in any similar situation.
  2. I suppose I couldn't have expected that to be a permanent substitute. Moving this to Source Requests.
  3. You could try something like: MaxWeight += 1000 ...which increases max weight by 100.
  4. 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.
  5. 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;}
  6. 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;}
  7. I apologise if this is naive of me to say, but couldn't you just open GRF Editor's properties and have it run in Compatibility Mode for Windows 7? I haven't tried this myself but it would make sense.
  8. 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.
  9. 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;}
  10. It's basically a CAPTCHA system lol. I just wanted something to call my own, like Neo's Exe Modification Organizer. d:
  11. 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");
  12. Function: mumble() Description: Requests input of randomized string from user. Returns true on success and false on failure. Four difficulty levels are available; each level inherits the previous one(s). Example Usage: https://github.com/datmumbles/Scripts/raw/master/sample/mumbletest.txt Download: https://github.com/datmumbles/Scripts/raw/master/func/mumble.txt
  13. 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.
  14. 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;}
  15. 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.
  16. 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.
  17. 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.
  18. 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 }}
  19. Update (for Patskie, really): As of 82b583b, array sizes are virtually limitless.
  20. Updates: 2.0 - Optimised for Hercules emulators. 2.1 - Updated algorithms. 2.2 - Added randomised disappearing and respawning. Please see first post for download link.
  21. 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
  22. Give this a try: http://herc.ws/board/topic/4055-utility-points-to-item-exchanger/ In the future, please codebox your scripts within [code][/code] ...or by clicking the < > icon in the toolbar.
  23. Utility: Points to Item Exchanger As per @koji42's request: http://herc.ws/board/topic/4048-pods-cashpoints-convertion/ Description: Exchanges items for points and vice-versa at a fixed rate. Preview: Download: https://github.com/datmumbles/Scripts/raw/master/util/points2item.txt
  24. It's not rocket science to reconfigure most aspects, but typically yeah. You could copy the contents of your conf files into their corresponding txt files in the import folder and retain your settings that way, but you should go over the changes again to ensure nothing has been missed.
×
×
  • Create New...

Important Information

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