SlashGeeGee Posted August 10, 2012 Group: Members Topic Count: 111 Topics Per Day: 0.02 Content Count: 573 Reputation: 20 Joined: 11/19/11 Last Seen: October 24, 2014 Share Posted August 10, 2012 Hello rA Ok I have this Instance the 300 Monster Challenge and after it's completed a treasure chest will spawn the mob_db cannot drop 1 pc of item when it's killed so I made it this way : - script 300_Monster_Prize -1,{ OnNPCkillEvent: if(killedrid!=1324){ end;} getmapxy(@m$,@x,@y,0); getitem 969,50,@m$,@x,@y; end; } so how can i make it to many monsters I mean the monster ID 1324 because there are 5 treasure chest in the instance that will randomly spawn. //= Treasure - Mob ID setarray .@chamonid5[0],1337,1329,1946,1938; Need Help SlashGeeGee Quote Link to comment Share on other sites More sharing options...
Ryuuzaki Posted August 10, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 87 Reputation: 13 Joined: 02/15/12 Last Seen: September 11, 2024 Share Posted August 10, 2012 That treasure box should drop loot around it when it gets killed? Quote Link to comment Share on other sites More sharing options...
SlashGeeGee Posted August 10, 2012 Group: Members Topic Count: 111 Topics Per Day: 0.02 Content Count: 573 Reputation: 20 Joined: 11/19/11 Last Seen: October 24, 2014 Author Share Posted August 10, 2012 That treasure box should drop loot around it when it gets killed? yeah but my problem is there is 5 treasure boxes and my script has one only. Quote Link to comment Share on other sites More sharing options...
Ryuuzaki Posted August 10, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 87 Reputation: 13 Joined: 02/15/12 Last Seen: September 11, 2024 Share Posted August 10, 2012 The treasure box amount is no problem, the script you posted gives the items to the killer, do you want the items to 100% drop on the ground? Quote Link to comment Share on other sites More sharing options...
SlashGeeGee Posted August 10, 2012 Group: Members Topic Count: 111 Topics Per Day: 0.02 Content Count: 573 Reputation: 20 Joined: 11/19/11 Last Seen: October 24, 2014 Author Share Posted August 10, 2012 The treasure box amount is no problem, the script you posted gives the items to the killer, do you want the items to 100% drop on the ground? read my first post , i said i want to make my script to add more monsters to it. Quote Link to comment Share on other sites More sharing options...
Ryuuzaki Posted August 10, 2012 Group: Members Topic Count: 1 Topics Per Day: 0.00 Content Count: 87 Reputation: 13 Joined: 02/15/12 Last Seen: September 11, 2024 Share Posted August 10, 2012 (edited) Ok there are several ways to "check" for more monsters when something gets killed: 1. if(killedrid!=1324 && killedrid != 1329 && killedrid != 1337 && killedrid != 1938 && killedrid != 1946){ end;} This method is pretty lame, especially when you want to add new monsters it can grow really huge. 2. setarray .@chamonid5[0],1324,1337,1329,1946,1938; for( set .@i,0; .@i < getarraysize(.@chamonid5); set .@i,.@i +1 ) { if(killedrid != .@chamonid5[.@i]) end; your code here... } Method 2 utilizes the for loop and you only need to edit the array at the start to put a new monster in. Edited August 10, 2012 by shadowseph Quote Link to comment Share on other sites More sharing options...
Euphy Posted August 10, 2012 Group: Members Topic Count: 72 Topics Per Day: 0.02 Content Count: 2997 Reputation: 1132 Joined: 05/27/12 Last Seen: June 1, 2017 Share Posted August 10, 2012 You should add your script to the OnKill event label of the monsters you want, not as an NPCKillEvent. *monster "<map name>",<x>,<y>,"<name to show>",<mob id>,<amount>{,"<event label>"}; OnNPCKillEvent will go and loop through every monster killed, which (of course) is highly, highly inefficient. Quote Link to comment Share on other sites More sharing options...
SlashGeeGee Posted August 17, 2012 Group: Members Topic Count: 111 Topics Per Day: 0.02 Content Count: 573 Reputation: 20 Joined: 11/19/11 Last Seen: October 24, 2014 Author Share Posted August 17, 2012 is this script correct ? - script 300_Monster_Prize -1,{ OnNPCkillEvent: setarray .@chamonid5[0],1324,1337,1329,1946,1938; for( set .@i,0; .@i < getarraysize(.@chamonid5); set .@i,.@i +1 ) { if(killedrid != .@chamonid5[.@i]) end;} getmapxy(@m$,@x,@y,0); makeitem 969,50,@m$,@x,@y; end; } BUMP ! Quote Link to comment Share on other sites More sharing options...
Arcenciel Posted August 17, 2012 Group: Members Topic Count: 69 Topics Per Day: 0.01 Content Count: 1315 Reputation: 372 Joined: 12/10/11 Last Seen: August 31, 2013 Share Posted August 17, 2012 You're making the script way harder than it needs to be. Read the documentation that came with it. The best way to give the player a reward is to create a custom treasure chest mob with the item you want the player to get upon finishing the instance. Quote Link to comment Share on other sites More sharing options...
SlashGeeGee Posted August 18, 2012 Group: Members Topic Count: 111 Topics Per Day: 0.02 Content Count: 573 Reputation: 20 Joined: 11/19/11 Last Seen: October 24, 2014 Author Share Posted August 18, 2012 You're making the script way harder than it needs to be. Read the documentation that came with it. The best way to give the player a reward is to create a custom treasure chest mob with the item you want the player to get upon finishing the instance. Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor. Quote Link to comment Share on other sites More sharing options...
Nipsino Posted August 18, 2012 Group: Members Topic Count: 28 Topics Per Day: 0.01 Content Count: 218 Reputation: 16 Joined: 01/24/12 Last Seen: May 24, 2015 Share Posted August 18, 2012 You're making the script way harder than it needs to be. Read the documentation that came with it. The best way to give the player a reward is to create a custom treasure chest mob with the item you want the player to get upon finishing the instance. Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor. It's easier if you just use getitem 969,10; Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 18, 2012 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Yesterday at 05:32 PM Share Posted August 18, 2012 Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor. OnMobKillLabel: getmapxy( .@Map$,.@X,.@Y,0 ); makeitem 969,10,.@Map$,.@X,.@Y; end; *makeitem <item id>,<amount>,"<map name>",<X>,<Y>; *makeitem "<item name>",<amount>,"<map name>",<X>,<Y>; This command will create an item lying around on a specified map in the specified location. itemid - Found in 'db/item_db.txt' amount - Amount you want produced map name - The map name X - The X coordinate Y - The Y coordinate. This item will still disappear just like any other dropped item. Like 'getitem', it also accepts an 'english name' field from the database and creates apples if the name isn't found. If the map name is given as "this", the map the invoking character is on will be used. Quote Link to comment Share on other sites More sharing options...
SlashGeeGee Posted August 19, 2012 Group: Members Topic Count: 111 Topics Per Day: 0.02 Content Count: 573 Reputation: 20 Joined: 11/19/11 Last Seen: October 24, 2014 Author Share Posted August 19, 2012 Monster's can't drop many items like I want 969 Gold to be Dropping 10pcs. on the floor. OnMobKillLabel: getmapxy( .@Map$,.@X,.@Y,0 ); makeitem 969,10,.@Map$,.@X,.@Y; end; *makeitem <item id>,<amount>,"<map name>",<X>,<Y>; *makeitem "<item name>",<amount>,"<map name>",<X>,<Y>; This command will create an item lying around on a specified map in the specified location. itemid - Found in 'db/item_db.txt' amount - Amount you want produced map name - The map name X - The X coordinate Y - The Y coordinate. This item will still disappear just like any other dropped item. Like 'getitem', it also accepts an 'english name' field from the database and creates apples if the name isn't found. If the map name is given as "this", the map the invoking character is on will be used. Thanks ! Problem Solved Quote Link to comment Share on other sites More sharing options...
Question
SlashGeeGee
Hello rA
Ok I have this Instance the 300 Monster Challenge and after it's completed a treasure chest will spawn the mob_db cannot drop 1 pc of item when it's killed so I made it this way :
so how can i make it to many monsters I mean the monster ID 1324 because there are 5 treasure chest in the instance that will randomly spawn.
Need Help
SlashGeeGee
Link to comment
Share on other sites
12 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.