Akinari Posted October 23, 2013 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
Yoona Posted October 24, 2013 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
GmOcean Posted November 7, 2013 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
Akinari Posted November 7, 2013 Author 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
GmOcean Posted November 7, 2013 Posted November 7, 2013 Okay, that helps. Needed that info before I started on a script lol. Quote
Akinari Posted November 7, 2013 Author 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
nanakiwurtz Posted November 12, 2013 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
Talis Posted November 12, 2013 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
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.