Jump to content

Mumbles

Retired Staff
  • Content Count

    618
  • Joined

  • Last visited

  • Days Won

    15

Everything posted by Mumbles

  1. Is your VPS set up to accept incoming connections? If you're running on Windows, you may need to add exceptions to some ports in your firewall.
  2. Not sure what I'd use it for but here's a script function version of it lol: /*****************************************************************************************getcharname()******************************************************************************************Description:Return player's name by ID query.******************************************************************************************Usage:mes "The first person on this server was named "+ getcharname(150000) +".";*****************************************************************************************/function script getcharname { query_sql("SELECT `name` FROM `char` WHERE `char_id` = '"+ getarg(0) +"'", .@query_name$); return .@query_name$;}
  3. Would love to see this as a plugin for HPM!
  4. Give this a try: http://herc.ws/board/topic/2439-utility-homunculus-evolution/
  5. Utility: Homunculus Evolution As per themon's request: http://herc.ws/board/topic/2426-humonculus-evolver/ Description: Allows players to evolve their homunculus in exchange for a catalyst and a fee. If the player has a fully evolved homunculus, an option to mutate it into a Homunculus S will be given if the setting is enabled. Please see the configuration settings under the 'OnInit' label to see what you can change. Do NOT modify the homunculus settings unless you have custom IDs/homunculi. This script is optimised solely for Hercules emulators. Download: https://github.com/datmumbles/Scripts/raw/master/util/homevo.txt
  6. @themon I apologise for being blunt, but I'm no scripting god or machine lol. I fulfilled your request for a few reasons: Nobody else did The script didn't exist anywhere else (to my knowledge) I found the idea intriguing I'm glad you enjoyed my script enough to want more (it's flattering, honestly), but I'm unable to fulfill such a large quantity of requests at one time. If you would like your other scripts to be reviewed, please post individual requests in the appropriate forums with as much detail as you are able to provide.
  7. Please do. I'm usually very thorough, but who knows - I may have overlooked something. d:
  8. I'd hope so. I found the idea intriguing and was surprised to find nothing quite like it yet. It took me a bit to debug some of the formulas (particularly the time-related ones), but I'm happy with the final result.
  9. Here's my version of a Pawn Shop based on many of the ideas written in this thread: http://herc.ws/board/topic/2421-utility-pawn-shop/
  10. Utility: Pawn Shop As per themon's request: http://herc.ws/board/topic/2373-new-shop-npc-idea-pawn-shop/ Description: Allows players to exchange items in their inventory for a percentage of its "fair market value (FMV)". By default, the formula to determine the FMV is approximately one-third of the item's "buy" price (as if you were purchasing it from an NPC), multiplied by its refine rate* (if it's equipment). Items "pawned" through this script are available to be reclaimed if the loan (plus interest) are repaid in full within seven days. If a loan expires, the item pawned will be claimed by the NPC and "sold"; the original owner will no longer be able to retrieve it. Loan rates, interest rates, loan days, and the refine bonus trigger can be modified within the configuration settings under the 'OnInit' label. Please take care to NOT modify the leap year formula under this label. *The refine multiplier calculates the number of UNSAFE refines, then adds it to the loan total. For example, a Sword with the refine rate of 10 (which has a safety cap of seven) has a multiplier of three; so, if the "Buy" price is 100z, the default loan would be 33z. Multiply that by three, and you get a 99z refine bonus in addition to the original 33z, for a grand total of 132z. Interest is added AFTER the final loan price is determined, so at a rate of 10 percent, it would cost approximately 145z to reclaim the Sword. Download: https://github.com/datmumbles/Scripts/raw/master/util/pawnshop.txt
  11. If you insist on going about the "Next Page" route, you could just use multiple arrays; for example, "page 1" would use the array .page_1[0] and "page 2" would use the array .page_2[0]. Personally, I'd organize the custom items into separate categories or tiers, and have them exchanged that way. You could also try using multiple for loops. Here's a little sample of using the "next page" idea with multiple arrays; it's heavily commented, but feel free to ask any questions. prontera,150,150,5 script Pages Sample::pages_sample 999,{ do // Loop while no confirmation trigger received { // Reset page number @page_num = 0; do // Loop while next page trigger is received { // Clear "next page" trigger @next_page = 0; // Clear last page's options .@options$ = ""; // Increment page number @page_num++; // End session if max page reached if (@page_num > .max_option) { mes .npc_name$; mes "Come back soon!"; close; } // Intro Dialogue mes .npc_name$; mes "Please select an item you would like."; next; // Build menu options for (.@i = 0; .@i < getarraysize(getd(".page_"+ @page_num)); .@i++) { // Add next option in index to previous option .@options$ = .@options$ + getitemname(getd(".page_"+ @page_num +"["+ .@i +"]")) + ":"; } // Choose option if (@page_num < .num_pages) menu .@options$ + "^008800Next page^000000",-; else menu .@options$ + "^FF0000End session^000000",-; // Set next page trigger if it was chosen if (@menu > .max_option) @next_page++; } while (@next_page); // Set index @i = @menu - 1; // Confirmation Dialogue mes .npc_name$; mes "You've selected "+ getitemname(getd(".page_"+ @page_num +"["+ @i +"]")) +", correct?"; next; // Set confirmation trigger if (select("That is correct:No, let me choose again") < 2) @confirm_option++; } while (!@confirm_option); // Receive selected item getitem getd(".page_"+ @page_num +"["+ @i +"]"), .amount; // Receipt Dialogue mes .npc_name$; mes "Here you go! Enjoy!"; close; OnWhisperGlobal: // Whisper anything to 'npc:pages_sample' to initialize settings (older emulators) message strcharinfo(0), strnpcinfo(1) +" : 'OnInit' label has been intialized."; OnInit: // NPC's name .npc_name$ = "[Pages Sample]"; // Max options per page .max_option = 5; // Number of pages .num_pages = 2; // Item IDs with corresponding pages setarray .page_1[0], 909, 910, 911, 912, 913; setarray .page_2[0], 914, 915, 916, 917, 918; // Global amount to receive .amount = 1; end; }
  12. Here's my method, which utilizes your array and makes it a little easier to reconfigure (if needed): guild_vs5,57,47,4 script Wave Mobs#rand::wave_mobs 73,{ // Dialogue mes "Hello"; mes "You've caused monsters to be summoned!"; close2; // Summon all monsters in the '.monster_weak' array for (.@i = 0; .@i < getarraysize(.monster_weak); .@i++) monster .map$, 0, 0, .weak_name$, .monster_weak[.@i], .weak_amount, strnpcinfo(3) +"::OnWave"; end; OnWave: // Mob death event if (mobcount(.map$, strnpcinfo(3) +"::OnWave") <= .announce_start) announce "There are only "+ mobcount(.map$, "all") +" left! Good luck!", 0; end; OnInit: // Map name .map$ = "guild_vs5"; // Mob count before announcements start .announce_start = 95; // Weak monster name .weak_name$ = "--ja--"; // List of weak monster IDs setarray .monster_weak[0], 1301,1297,1403,1654,1268,1507,1830,1307,1302,1635, 1655,1636,1777,1837,1656,1219,1502,1637,1262,1700, 1320,1865,1657,1702,1829,1375,1204,1653,1416,1200, 1197; // Amount of weak monsters to summon .weak_amount = 100; end;} You should consider reading a little more on looping through arrays in the documentation or on Wiki. The basic concept of using a for loop with your array(s) is that you'll essentially run the same sequence of code through your array indexes until each index has been used. for (.@i = 0; .@i < getarraysize(.monster_weak); .@i++) This loop says, "Start .@i off with the value 0. For each loop in which .@i is less than the array size of the array .monster_weak, run the script on the first line below (or within curlies { } below), then increase the current value of .@i by 1." Now, this might seem like a mouthful at first, but it really starts to make sense once you understand the relation between array indexes and the usage of an incrementation variable (.@i, in this case) in your script. The first value of an array is at the index 0; this means that an array set up like this: setarray .array[0], 123, 231, 321; ...will have its first index value (.array[0]) as 123, its second index value (.array[1]) as 231, and its third index value (.array[2]) as 321. When we go through the array with a loop, we start .@i off at 0 so that we can use .@i as a place holder for the array and start reading from the first index (.array[0]) with .array[.@i]. Here's an example of this usage: for (.@i = 0; .@i < getarraysize(.array); .@i++) mes .array[.@i]; close; This loop will display an NPC message dialogue with the value of the current index being referred to. The final product will look something like: 123 231 321 ...followed by a close button. If you wanted to do more, enclose your looped script within curlies { }, like you would with an if statement. Regarding getarraysize(): This script command returns a value with the size of an array - the amount of indexes an array has. Our array .array has three indexes, therefore it has an array size of 3. Since there is no value for .array[3], we can safely use the condition .@i < getarraysize(.array) within the for loop's expression; this also allows us to increase the amount of values our array has without having to modify the loop directly. To reiterate what @Emistry said, you can just use permanent NPC variables (.variable_name) instead of global variables - that is, unless you intend to use your arrays in such a way that permanent NPC variables would not suffice.
  13. Read this: http://herc.ws/board/topic/152-obtaining-hercules/?p=845 You'll have to compile it in MSVC, but it works just fine.
  14. You could do it with a script, like: OnPCDieEvent: sc_end SC_PROPERTYFIRE; end;
  15. You could enable DNS support on your client and configure a subdomain to point to your IP and/or use a VPN. I'm sure there are better methods now, but one popular method I recall is the use of Hamachi to create a VPN and have players connect with that IP address. Example: Update all of your public IP address configurations to server.myRO.com, which points to your computer's public IP address, 87.65.43.21 - doing so allows you to update where your subdomain points to with ease, rather than updating a bunch of files.; alternatively, use Hamachi to create a VPN and generate an IP address for players to connect to, and use that for your public IP address settings. The best solution? Lease space with hosting providers to suit your needs. I prefer BuyVM.net, but if you don't know how to manage or set up a server, I suggest you try hosting services that will set up your server and provide support. For a list of services that are backed by our community, check out our Paid Services section.
  16. Oh, I suppose that was my mistake from reading and converting Wolf's loop. You can fix that by simply changing < to <=, like so: for (@i = 82000; @i <= 82267; @i++) Updated the link in my first post with this change.
  17. for (set @i, 82000; @i < 82267; set @i, @i +1) { if (checkquest[@i]) callsub "N_Progess"; set @i, @i + 1;} I don't see much of a difference in the usage of callsub here, in comparison to goto; in either case, it's just sloppy coding and could be written like this: for (@i = 82000; @i < 82267; @i++) { if (checkquest(@i)) { mes "You're currently still performing a quest!"; mes "Please ^FF0000finish the quest or abandon the quest!^000000"; close; } } Using descriptive labels and names is important too, especially when you want to look back at your code and figure out what's going on; comments are useful, but functions named like L_quest, R_quest, and so forth don't tell me or anyone else a whole lot about what the function does. Regardless, calling the functions was a little pointless, as they were both only called once throughout all 4828 lines; it'd make more sense to simply include the content of the function where it was originally called. Here's my method, which is a little prettier than @Emistry's (no offense c:) but basically the same thing. I placed the level checks outside of the switch, as they're only needed once anyways, and organized the entire script to be more readable. It's 358 lines (including the header and comments) versus Emistry's 207 lines, but I like my code to be a little less mashed together. http://upaste.me/b3607239c4edd0b0
  18. Hi @jolnar, You might be better off following the guide by Patskie and running Hercules on your own computer, unless you plan on having others connect as well. If you'd like to connect remotely, read on. In step 8 in Patskie's guide, you'll want to change your char_ip and map_ip setting to your remote server's public IP address. Afterwards, change the <address> IP in your clientinfo.xml to the same IP and try connecting. If you're actually using a Hercules emulator, 2012-04-18 is the default client configured in src/common/mmo.h
  19. Hi @kerbiii, It appears there is currently no proper method to execute this effect. I've gone ahead and started a new issue in the tracker regarding the change. Thanks for bringing this to our attention.
  20. You can just point your servers to read from the same login database and columns; I don't know anything about private FlyFF, WoW, or Mana World(?) servers, but if they can read plain text or MD5 hashes and be configured to read from specific tables and columns, it should work fine.
  21. If you have unclaimed castles that aren't designated WoE castles, just remove either the entrance warps or the Emp room warps.
  22. - script noon_porings -1,{ OnHour12: monster "prontera", 0, 0, "Poring", 1002, 50; monster "prontera", 0, 0, "Drops", 1113, 20; monster "prontera", 0, 0, "Poporing", 1031, 10; end; }
  23. Hi Helena, While we do not directly provide support for the rAthena emulator, this issue was fixed in Hercules on commit cfa452c. If you download the latest version of Hercules, this fix is included. Although this is the Hercules forum, we are not inclined to deny support queries based on what emulator someone uses. I'd encourage you to suggest others use Hercules, rather than shooing them away to a different forum.
  24. In a nutshell: switch (getrefine()) { case 1: bonus bStr, 10; bonus bAgi, 5; bonus bMaxSPrate, 12; break; case 2: bonus bStr, 11; bonus bDex, 7; bonus bMaxHPrate, 15; bonus bMaxSPrate, 15; break; default: bonus bStr, 5; bonus bAgi, 5; bonus bMaxSPrate, 10; } Cleaner readout (don't paste this into your db lol): switch (getrefine()){ case 1: bonus bStr, 10; bonus bAgi, 5; bonus bMaxSPrate, 12; break; case 2: bonus bStr, 11; bonus bDex, 7; bonus bMaxHPrate, 15; bonus bMaxSPrate, 15; break; default: bonus bStr, 5; bonus bAgi, 5; bonus bMaxSPrate, 10;} The case number would be the refine level; if no case is defined (typically, 0), it will use default instead. I'd only recommend using this method if you wanted very specific bonusesfor each refine; keep in mind that because the way this is written, the item will have the same effect as +0 when refined to +3, unless you add a new case label for each refine; if you want two refines to have the same effect, just stack the labels next to each other (i.e. case 1: case 2: bonus bStr, 10; break;) If you have an algorithmic way of increasing the bonuses given, this can be written differently.
  25. Err...this line will cause the player to freeze if the expression is false: if ( countitem(7227) < 100 ) end; Additionally, the check can be placed before the switch; since it's checked every time anyways, it would be pointless to repeat the check. Here's my method: prontera,150,150,5 script Exchanger 100,{ // Dialogue I mes .name$; mes "Hi there, I can exchange "+ .voucher_amt +" of your "+ getitemname(.voucher_id) +" for several different rewards."; next; // Choose item to exchange menu .option$, -; // Dialogue II mes .name$; // Check required voucher amount if (countitem(.voucher_id) < .voucher_amt) { mes "Sorry, but you do not have enough "+ getitemname(.voucher_id) +" to complete this transaction."; close; } // Delete required item delitem .voucher_id, .voucher_amt; // Get reward .@i = @menu - 1; getitem .item_id[.@i], .amount[.@i]; // Dialogue III mes "Thank you! Enjoy your "+ .amount[.@i] +" "+ getitemname(.item_id[.@i]) +"!"; close; OnInit: // NPC name .name$ = "["+ strnpcinfo(1) +"]"; // Voucher ID and amount .voucher_id = 7227; .voucher_amt = 100; // Item IDs and corresponding amounts setarray .item_id[0], 7179, 12214, 909; setarray .amount[0], 10, 20, 15; // Fill secondary menu items for (.@i = 1; .@i < getarraysize(.item_id); .@i++) .option$ = .option$ +":"+ .amount[.@i] +" "+ getitemname(.item_id[.@i]); // Add menu items to primary option .option$ = .amount[0] +" "+ getitemname(.item_id[0]) + .option$; end;}
×
×
  • Create New...

Important Information

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