Akinari Posted October 23, 2013 Group: Members Topic Count: 32 Topics Per Day: 0.01 Content Count: 247 Reputation: 207 Joined: 10/23/12 Last Seen: March 2, 2022 Share Posted October 23, 2013 File Name: Script Command: getrandmob() File Submitter: Akinari File Submitted: 23 Oct 2013 File Category: Source Modifications Content Author: Akinari Another quick package up of a small command I've had lying around for a long time. Grabs a random monster from one of the branch databases. Useful for hunter quests, disguise events, and anything else you can think of. Uses database stored in memory, so it's faster and more efficient than running SQL queries and doesn't require you to use SQL dbs for items and mobs. /*========================================== * Fetches a random mob_id * getrandmob(num,type); * * type: Where to fetch from: * 0: dead branch list * 1: poring list * 2: bloody branch list * num: Mob level to check against (0 = all) *------------------------------------------*/ To add, simply place the files into the src/custom folder. If you already use those files, add the new code into your existing populated files and do a clean make. Click here to download this file Quote Link to comment Share on other sites More sharing options...
Yoona Posted October 24, 2013 Group: Members Topic Count: 153 Topics Per Day: 0.03 Content Count: 567 Reputation: 18 Joined: 04/15/13 Last Seen: April 21, 2016 Share Posted October 24, 2013 (edited) I see, so this is what it means i was checking lately on my src files and i notice this custom folder, by the way thanks ! great job more power rAthena ! and to all who built it ! Edited October 24, 2013 by Yoona Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 7, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 7, 2013 Question in regards, to the parameters, how would I enable the command to check ALL monsters in a specific list regardless of level. Would I just simply put 0? getrandmob(0,0)? OR //Is does it check against the level and choose all monsters lower or higher? getrandmob(10,0)? getrandmob(100,0)? Quote Link to comment Share on other sites More sharing options...
Akinari Posted November 7, 2013 Group: Members Topic Count: 32 Topics Per Day: 0.01 Content Count: 247 Reputation: 207 Joined: 10/23/12 Last Seen: March 2, 2022 Author Share Posted November 7, 2013 Question in regards, to the parameters, how would I enable the command to check ALL monsters in a specific list regardless of level. Would I just simply put 0? getrandmob(0,0)? OR //Is does it check against the level and choose all monsters lower or higher? getrandmob(10,0)? getrandmob(100,0)? Higher, up to MAX_LEVEL. If you want all mobs, just give it the max level of the server. Quote Link to comment Share on other sites More sharing options...
GmOcean Posted November 7, 2013 Group: Members Topic Count: 31 Topics Per Day: 0.01 Content Count: 666 Reputation: 93 Joined: 04/27/12 Last Seen: August 17, 2015 Share Posted November 7, 2013 Okay, that helps. Needed that info before I started on a script lol. Quote Link to comment Share on other sites More sharing options...
Akinari Posted November 7, 2013 Group: Members Topic Count: 32 Topics Per Day: 0.01 Content Count: 247 Reputation: 207 Joined: 10/23/12 Last Seen: March 2, 2022 Author Share Posted November 7, 2013 I updated the file. If you put in '0', it will give you all levels. It's untested, but should work. Let me know. Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 12, 2013 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 12, 2013 Well... I haven't know the purpose of the custom folder, is there a tutorial or post about it? I might have missed that one Quote Link to comment Share on other sites More sharing options...
Talis Posted November 12, 2013 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 7 Reputation: 2 Joined: 11/06/13 Last Seen: November 25, 2013 Share Posted November 12, 2013 The only announcement / mention on the boards is here: http://rathena.org/board/topic/87083-julyaugust-digest/?hl=a4fdc72# This might not be 100% accurate since I'm new here and havn't worked with the system, but the gist is: Putting source mods directly into the .c files, such as script.c and atcommands.c is messy, because it can make revision updates troublesome - often leading to manually having to merge together your custom file and the new server revision file. The custom folder contains script.inc, script_def.inc, atcommand.inc and atcommand_def.inc. The main part of a script ( BUILDIN_FUNC(command) ) goes into custom/script.inc The definition of a script ( BUILDIN_DEF(command, parameters) ) goes into custom/script_def.inc The main part of a atcommand ( ACMD_FUNC(command) ) goes into custom/atcommand.inc The definition of a atcommand ( { "command", gmlevel,gmlevel, atcommand_command } ) goes into custom/atcommand_def.inc This keeps things organized, and your main eAthena source code clean, allowing for painless revision updates. Does that clear it up? 1 Quote Link to comment Share on other sites More sharing options...
nanakiwurtz Posted November 12, 2013 Group: Members Topic Count: 81 Topics Per Day: 0.02 Content Count: 1654 Reputation: 583 Joined: 08/09/12 Last Seen: January 14, 2020 Share Posted November 12, 2013 Thanks for the explanation Talis Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.