SlashGeeGee Posted August 10, 2012 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
Ryuuzaki Posted August 10, 2012 Posted August 10, 2012 That treasure box should drop loot around it when it gets killed? Quote
SlashGeeGee Posted August 10, 2012 Author 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
Ryuuzaki Posted August 10, 2012 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
SlashGeeGee Posted August 10, 2012 Author 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
Ryuuzaki Posted August 10, 2012 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
Euphy Posted August 10, 2012 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
SlashGeeGee Posted August 17, 2012 Author 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
Arcenciel Posted August 17, 2012 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
SlashGeeGee Posted August 18, 2012 Author 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
Nipsino Posted August 18, 2012 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
Emistry Posted August 18, 2012 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
SlashGeeGee Posted August 19, 2012 Author 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
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
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.