mawjustin Posted February 16, 2023 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 124 Reputation: 6 Joined: 09/26/14 Last Seen: August 20, 2024 Share Posted February 16, 2023 Hi Team, Is there a way to check for monster level for every monster kill? I would like to give a reward to player based on monster level. ie. If player kills a Kobold (Level 31), they will have a chance to get a reward for level 30-40 monsters. Thank you. Quote Link to comment Share on other sites More sharing options...
1 pajodex Posted February 16, 2023 Group: Members Topic Count: 79 Topics Per Day: 0.03 Content Count: 439 Reputation: 173 Joined: 12/12/17 Last Seen: Monday at 05:33 PM Share Posted February 16, 2023 Never tried this but I think this should work. *strmobinfo(<type>,<monster id>); This function will return information about a monster record in the database, as per 'db/(pre-)re/mob_db.yml'. Type is the kind of information returned. Valid types are: It will return 0 if there is no such monster (or the type value is invalid), or an empty string if you requested the monster's name. 1 - 'english name' field in the database, a string. 2 - 'japanese name' field in the database, a string. All other returned values are numbers: 3 - Level. 4 - Maximum HP. 5 - Maximum SP. 6 - Experience reward. 7 - Job experience reward. - script test -1, OnNPCKillEvent: if ( killedrid == 1134 && strmobinfo(3,killedrid) == 31 ) { // Check if kobold lv 31 if (rand(100) > 50) getitem 501, 1; // get a 50% chance to have reward } end; } you can expand this by adding variables and loops.. Quote Link to comment Share on other sites More sharing options...
1 LearningRO Posted February 16, 2023 Group: Members Topic Count: 107 Topics Per Day: 0.02 Content Count: 778 Reputation: 73 Joined: 02/10/12 Last Seen: 4 hours ago Share Posted February 16, 2023 Quote OnNPCKillEvent: set .@monsterlv,getmonsterinfo(killedrid,MOB_LV); if ( .@monsterlv >= 41) { dispbottom "You just kill monster above lv 41"; } else { dispbottom "You just kill monster below lv 41"; } end; Quote Link to comment Share on other sites More sharing options...
0 mawjustin Posted February 16, 2023 Group: Members Topic Count: 48 Topics Per Day: 0.01 Content Count: 124 Reputation: 6 Joined: 09/26/14 Last Seen: August 20, 2024 Author Share Posted February 16, 2023 Thanks, both worked! Quote Link to comment Share on other sites More sharing options...
Question
mawjustin
Hi Team,
Is there a way to check for monster level for every monster kill?
I would like to give a reward to player based on monster level.
ie. If player kills a Kobold (Level 31), they will have a chance to get a reward for level 30-40 monsters.
Thank you.
Link to comment
Share on other sites
3 answers to this question
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.