Mumbles

Community Contributors
  • Content Count

    614
  • Joined

  • Last visited

  • Days Won

    13

Everything posted by Mumbles

  1. identifyall was solely added as an atcommand, wasn't it? I made this as a script-command based on reiterations of identify() so users could make an inline function in their quest, event, or utility scripts. The benefits are trivial and would mostly suit low-rate servers with a low zeny pool, but they're beneficial nonetheless. ¯\_(ツ)_/¯ This script-command version of identifyall() provides the following: A return value for the number of items identified Enables the possibility of using the amount of items identified to create individual cost or bulk pricing i.e. 10 items identified for 400 Z (base cost for 10x items identified @ 40 Z each) i.e. 23 items identified for 805 Z (bulk cost for 23x items identied @ 35 Z each, when identifying 20 or more at once) Allows for the number of items identified (and the maths on cost) to be displayed to the user, for informational purposes Eliminates redundant scripting by alternatively using atcommand "@identifyall"; in a script and still needing to gather the number of items identified Allows for use of identifyall as a script-command rather than an atcommand, particularly under circumstances when using atcommands in general are restricted, limited, or undesirable With some modification, this can be changed into a global function so it can be used across multiple scripts With a little imagination and creativity, identifyall as a script-command can be used for interfacing with various utilities, zeny sinks, and other features. Like I said -- this little script command would find its niche mostly in low-rate servers, but it'll be here if it's needed.
  2. Function: identifyall() Quick function to complement commit #24c4d53. Full version: Identifies all unidentified items in user's inventory and returns the number of items identified. Quick-use version: Identifies all unidentified items in user's inventory without returning any additional values. Usage: Download: identifyall.txt Mirror: https://upaste.me/f75351070d03c790e
  3. If anyone came crying, it'd appear to be you. To answer your question, though -- no; I just had the misfortune of coming across your cancerous post on the front page. Poor you -- you wasted a whole few moments of your pathetic life waiting for something that was free; of no cost to you whatsoever. And for all your efforts, you didn't get it. Geez. How sad. I've collaborated with Daifuku in the past, and I've admittedly pushed her limits in order to meet a deadline -- but never once did I disrespect her or cause her to feel like abandoning a project was a better solution. You've got to be a pretty foul human being to make someone as nice as her pass on you. If you want a prize, take a life lesson instead as a consolation: Treat people with dignity and respect, and maybe next time you won't be such a loser.
  4. People get busy; we all have lives outside of these boards (believe it or not), and it should be expected that our real-world responsibilities and obligations take precedence over our business online. You obviously had your own priorities (in this case, your health), and were unable to contact Daifuku in a timely manner to redeem your prize. Fortunately, she was still willing to work with you instead of choosing a runner-up. Considering that she had been willing to be flexible with you a month after the fact, you should have been similarly acquiescent when she had contacted you a few days after the date she said she'd respond by — but instead, you harassed her to the point that she ultimately rescinded her giveaway. I haven't posted here in years, but seeing this post was triggering. To say that Hercules deserves better is ridiculous and insulting. Hercules holds a high standard for staff members; Daifuku wouldn't have earned her position if she wasn't of good moral character, untalented, or undeserving. If anything, Daifuku deserves better than to be treated like some sort of servant. Did you lose anything of value by entering her giveaway? Did you lose sleep while you were waiting for a response? I'd hope not. Maybe evaluate how you communicate with people when they are doing something out of their own free will and generosity — especially when it's at no cost to you.
  5. Mumbles

    AFK Homunculus

    Here's an updated version without global variables and a simplified flow: - script vaporize -1,{ OnPCLoginEvent: // Set AFK check on login addtimer 60000, strnpcinfo(0) + "::On1min"; end; On1min: // Check if player has Homunculus and if AFK longer than allowed if(gethominfo(2) != "null" && checkidle() >= .vaporize) { atcommand "@useskill 244 1 " + strcharinfo(0); dispbottom "You are not allowed to farm with Homunculus while AFK."; } // Reset AFK check addtimer 60000, strnpcinfo(0) + "::On1min"; end; OnInit: // Time (in seconds) before vaporizing .vaporize = 120; end; }
  6. This code might be deprecated. If it does still work, it should overwrite the existing functionality of @go. When this was written, you did not need to make any src changes, as bindatcmd binded @go to the specified label within the script.
  7. In previous versions (not sure if still possible), you could pre-load a script in npc/scripts_custom.conf and it could potentially affect the next script in line if it wasn't closed properly. Example: npc: npc/custom/npc1.txtnpc: npc/custom/npc2.txt If npc/custom/npc1.txt was missing a right curly at the end of the file, it would still load, but the next file in line (in this example, npc/custom/npc2.txt) would throw an error at line 1. Just throwing that idea out there; it very well might not be the solution to your problem, but there's nothing wrong with making sure all of your custom scripts have no errors. d:
  8. What's the file above it, in npc/vroevents/ ? Might be missing a right curly at the end of that file.
  9. Or you could just not @reloadscript lol But anyway, here you go: http://upaste.me/2f9618109227d4fcd
  10. You're over-thinking your implementation. On a smaller scale, you could write something like: - script summon_mvp -1,{ OnInit: monster "prt_fild08", 0, 0, "Baphomet", BAPHOMET, 1, strnpcinfo(0) +"::OnKilledBapho"; end; OnKilledBapho: announce strcharinfo(0) +" has killed "+ getmonsterinfo(BAPHOMET, MOB_NAME) +"!", bc_all; end;} ...but since you've already specified a very particular event (OnKilledBapho) for your Baphomet mob, you don't really need to pull the RID to display the name, nor do you even need to use getmonsterinfo(). Since you told the script to run OnKilledBapho when the event Baphomet is killed, you could just simply write your announcement like this: announce strcharinfo(0) +" has killed Baphomet!", bc_all; If you were randomizing MVP summons, however, you could do something like this: - script summon_mvp -1,{ OnInit: // Set MVP IDs setarray .mvp_id[0], BAPHOMET, GOLDEN_BUG, KNIGHT_OF_WINDSTORM, GARM, ORK_HERO; OnSetID: // Randomly select MVP to summon .summon_id = .mvp_id[rand(getarraysize(.mvp_id))]; // Summon Random MVP monster "prt_fild08", 0, 0, getmonsterinfo(.summon_id, MOB_NAME), .summon_id, 1, strnpcinfo(0) +"::OnKilledMVP"; end; OnKilledMVP: // Announce MVP death announce strcharinfo(0) +" has killed "+ getmonsterinfo(.summon_id, MOB_NAME) +"!", bc_all; // Respawn new MVP donpcevent strnpcinfo(3) +"::OnSetID"; end; }
  11. So the documentation for nowarpto is correct, then; lost track of what the original issue was for a sec lol. In your last reply, you mentioned replacing mf_nowarp with mf_nowarpto: } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp)) { However, the intent of this line is to prevent warping if the player's Group ID isn't high enough OR if the destination has a nowarp flag, regardless of Group ID. You can bypass this for GMs by changing the expression a little (I'm sure there's a prettier way to do it, but I'm not feeling up to it): } else if (getgroupid() < getarg(4) || getmapflag(getarg(0), mf_nowarp) && getgroupid() < getarg(4)) { In regard to your original inquiry, the behaviour of nowarp is to prevent the use of @go to a destination; to prevent the use of @go from a map flagged with nowarp (despite this not being the intent of the nowarp flag), you can still prevent warping by adding an expression similar to my original suggestion: } else if (getmapflag(strcharinfo(3), mf_nowarp)) { message strcharinfo(0), "You are not authorised to warp from this map."; If you would like to prevent warping from specific maps, I would recommend moving forward with the filter/blacklist route — hell, you could even prevent both nowarp-flagged and specific maps from being warped to if you wanted to.
  12. Can you please confirm (via in-game test) that nowarpto prevents this version of @go from warping to a map flagged with nowarpto, and that nowarp prevents warping from a map flagged with nowarp? I am unable to test any in-game behaviours at this time.
  13. You could probably do without getmapxy() since the script is attached to a player when run; strcharinfo(3) will return the attached player's map name. I'd say you were correct in changing mf_nowarp to mf_nowarpto, should the function of nowarpto be that players cannot warp to the map (duh; though sometimes the documentation isn't tell-all). Someone should really update the documentation for both mapflags, as they are either lacking in information or documented incorrectly. /swt
  14. Hi Kong, Per mf_nowarp's documentation (see nowarp.txt), mf_nowarp prevents the use of @go to a map, not from it. There is currently no mapflag (that I'm aware of) that prevents warping from the map, but you can circumvent this by either adding your own blacklist/filter of disabled maps. This is an example of a blacklist injection (though I wouldn't recommend punching this into this script exactly as it is written): setarray [email protected]$[0], "payon", "prontera", "izlude";for ([email protected] = 0; [email protected] < getarraysize([email protected]$); [email protected]++) { if (strcharinfo(3) == [email protected]$[[email protected]])) { message strcharinfo(0), "You may not warp from this map."; end; }}
  15. Hi Kong, Thanks for the feedback. I'll push an update when I get back to my desk; for now, you can add this block of code at line 62 to accommodate your needs: } else if (getmapflag(getarg(0), mf_nowarp)) { message strcharinfo(0), "You are not authorised to warp to this map.";
  16. You can use the monster command after the line containing the progressbar command.
  17. This will not work with *Athena emulators until they add compatibility for item constants (in place of IDs); this script is optimised for Hercules emulators only.1 1If you are using Hercules, please update your emulator.
  18. 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 ([email protected] = 0; [email protected] < getarraysize(.arena_data$); [email protected] += 4) { [email protected]_name$[[email protected]++] = .arena_data$[[email protected]]; [email protected]$[[email protected]++] = .arena_data$[[email protected]] +" ["+ getmapusers(.arena_data$[[email protected] + 1]) +"]"; } // Select desired arena menu implode([email protected]$, ":"), -; mes .npc_name$; [email protected] = @menu - 1; // Hercules //[email protected] = @menu - 2; // rAmod [email protected] = [email protected] * 4; // Determine map name [email protected]_name$ = .arena_data$[[email protected] + 1]; // Determine Base Level requirement [email protected]_req = atoi(.arena_data$[[email protected] + 2]); // Determine room limit [email protected]_limit = atoi(.arena_data$[[email protected] + 3]); *I'm also extremely rusty on scripting so maybe there's a better method by now lul
  19. Right, in which case just change line 4: query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ getarg(0) +"'", [email protected]_id; to this: query_sql "SELECT `party_id` FROM `party` WHERE `name` ='"+ escape_sql(getarg(0)) +"'", [email protected]_id;
  20. Load this in once to delete cards from the [email protected]_id array from the server. Note that all players to be affected should be offline. Add card constants or IDs to the [email protected]_id array as needed. Be sure to unload this script once the task is completed. - script del_cards -1,{ OnInit: setarray [email protected]_name$[0], "inventory", "cart_inventory", "storage", "guild_storage", "mail", "auction"; // Card constants or IDs to delete setarray [email protected]_id[0], Golden_Bug_Card, Ifrit_Card, Ghostring_Card, Drake_Card; // Loop through all tables to clear for ([email protected] = 0; [email protected] < getarraysize([email protected]_name$); [email protected]++) { // Loop through all cards to delete for ([email protected] = 0; [email protected] < getarraysize([email protected]_id); [email protected]++) { // Delete card from table query_sql "DELETE FROM `"+ [email protected]_name$[[email protected]] +"` WHERE `nameid` = '"+ [email protected]_id[[email protected]] +"'"; // Remove compounded cards query_sql "UPDATE `"+ [email protected]_name$[[email protected]] +"` SET `card0` = '0' WHERE `card0` = '"+ [email protected]_id[[email protected]] +"'"; query_sql "UPDATE `"+ [email protected]_name$[[email protected]] +"` SET `card1` = '0' WHERE `card1` = '"+ [email protected]_id[[email protected]] +"'"; query_sql "UPDATE `"+ [email protected]_name$[[email protected]] +"` SET `card2` = '0' WHERE `card2` = '"+ [email protected]_id[[email protected]] +"'"; query_sql "UPDATE `"+ [email protected]_name$[[email protected]] +"` SET `card3` = '0' WHERE `card3` = '"+ [email protected]_id[[email protected]] +"'"; } } // Confirm completion announce "Restricted cards have been removed from the server.", bc_all; end;}