naaaan Posted April 6, 2013 Posted April 6, 2013 (edited) Need help on this one. custom bloody branch item script. i want that: 1.If you click bloody branch, box will appear like this (text will be ignored and no monster will be summon) 2.Then if you want to summon monsters. example poring ID:1002 it will summoned poring. 3. If you replace the 1st number with "9" Large Monster Will be summoned Example Poring ID:1002 replace 1 with 9 then "9002" summoned large poring . 4 If you use "5" example poring 1002 -> "5002" it summoned small poring. 5. If you input number 1 in the box and click okay. All monster that you summon will be disappear I need the item script for this.Hope you help me Edited April 7, 2013 by naaaan Quote
Emistry Posted April 6, 2013 Posted April 6, 2013 monster support the optional parameter of size since r16904 ...update ur svn... try - script Sample -1,{ OnTalk: input .@mob_id; if( .@mob_id == 1 ){ killmonster strcharinfo(3),strnpcinfo(0)+"::OnMobKill"; message strcharinfo(0),"All Summoned Mobs killed."; }else if( getmonsterinfo( .@mob_id,MOB_NAME ) == "null" ){ message strcharinfo(0),"Invalid Mob ID."; }else{ mes "Select size for "+getmonsterinfo( .@mob_id,MOB_NAME ); .@size = select( "Medium Size","Small Size","Large Size" ) - 1; close2; // monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill"; monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill",.@size; } OnMobKill: end; } .................{ doevent "Sample::OnTalk"; },{},{} Quote
Capuche Posted April 6, 2013 Posted April 6, 2013 Like this ? - script B_branch -1,{ OnSpawn: if( input( .@s$, 1, 5 ) != 0 ) { message strcharinfo(0), "Wrong typo. <mob_ID>{M, S, L}. Example: 1002S for small poring. 1002 for normal poring."; end; } else if( atoi( .@s$ ) == 1 ) { killmonster strcharinfo(3), strnpcinfo(0) +"::OnMobDead"; end; } else if( strmobinfo( 4,atoi( .@s$ ) ) == 0 ) { message strcharinfo(0), "Unknown monster."; end; } else if( getstrlen( .@s$ ) > 4 ) { while( .@size_m < 3 && strtoupper( charat( .@s$,4 ) ) != .size_typo$[.@size_m] ) .@size_m++; if( .@size_m == 3 || atoi( delchar( .@s$,4 ) ) == 0 ) { message strcharinfo(0), "Wrong typo."; end; } } else if( countitem( .item_id ) < 1 ) { message strcharinfo(0), "You need 1 "+ getitemname( .item_id ) +"."; end; } monster "this",-1,-1,"--ja--",atoi( .@s$ ),1, strnpcinfo(0) +"::OnMobDead", .@size_m; delitem .item_id,1; end; OnInit: setarray .size_typo$, "M", "S" ,"L"; .item_id = 12103; // Bloody branch ID OnMobDead: end; } 12103,Bloody_Dead_Branch,Bloody Branch,11,10000,,200,,,,,0xFFFFFFFF,7,2,,,,,,{ doevent "B_branch::OnSpawn"; },{},{} 3. If you replace the 1st number with "9" Large Monster Will be summoned Example Poring ID:1002 replace 1 with 9 then "9002" What if you want to summon a mob with ID 2000 ? I change the typo message strcharinfo(0), "Wrong typo. <mob_ID>{M, S, L}. Example: 1002S for small poring. 1002 for normal poring."; If you input number 1 in the box and click okay. All monster that you summon will be disappear In my script, all monsters with this label will disappear (all monsters summoned with BB by all players on the map). If you only want to kill the monster summoned by the player, I think you need source modification. Quote
Emistry Posted April 6, 2013 Posted April 6, 2013 (edited) try - script Sample -1,{ OnTalk: input .@mob_id; if( .@mob_id == 1 ){ killmonster strcharinfo(3),strnpcinfo(0)+"::OnMobKill"; message strcharinfo(0),"All Summoned Mobs killed."; }else if( getmonsterinfo( .@mob_id,MOB_NAME ) == "null" ){ message strcharinfo(0),"Invalid Mob ID."; }else{ mes "Select size for "+getmonsterinfo( .@mob_id,MOB_NAME ); .@size = select( "Medium Size","Small Size","Large Size" ) - 1; close2; // monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill"; monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill",.@size; } OnMobKill: end; } .................{ doevent "Sample::OnTalk"; },{},{} Edited April 6, 2013 by Emistry Quote
naaaan Posted April 6, 2013 Author Posted April 6, 2013 (edited) @capuche i occurred some error how to fix them? [Error]: Loading NPC file: npc/custom/B_branch.txt script error on npc/custom/B_branch.txt line 26 parse_line: need ';' 21 : } 22 : else if( countitem( .item_id ) < 1 ) { 23 : message strcharinfo(0), "You need 1 "+ getitemname( .ite m_id ) +"."; 24 : end; 25 : } * 26 : monster "this",-1,-1,"--ja--",atoi( .@s$ ),1, strnpcinfo(0) +":: OnMobDead"',' .@size_m; 27 : delitem .item_id,1; 28 : end; 29 : OnInit: 30 : setarray .size_typo$, "M", "S" ,"L"; 31 : .item_id = 12103; // Bloody branch ID And i cant use it. When i click bloody branch nothing happens just recieving this error on my mapserver [Error]: npc_event: event not found [B_branch::OnSpawn] [Error]: npc_event: event not found [B_branch::OnSpawn] [Error]: npc_event: event not found [B_branch::OnSpawn] [Error]: npc_event: event not found [B_branch::OnSpawn] [Error]: npc_event: event not found [B_branch::OnSpawn] @Emistry Your script too. same error like this. or something that i did wrong... How can i fix them? thanks.. Edited April 6, 2013 by naaaan Quote
naaaan Posted April 6, 2013 Author Posted April 6, 2013 (edited) monster support the optional parameter of size since r16904 ...update ur svn... try - script Sample -1,{ OnTalk: input .@mob_id; if( .@mob_id == 1 ){ killmonster strcharinfo(3),strnpcinfo(0)+"::OnMobKill"; message strcharinfo(0),"All Summoned Mobs killed."; }else if( getmonsterinfo( .@mob_id,MOB_NAME ) == "null" ){ message strcharinfo(0),"Invalid Mob ID."; }else{ mes "Select size for "+getmonsterinfo( .@mob_id,MOB_NAME ); .@size = select( "Medium Size","Small Size","Large Size" ) - 1; close2; // monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill"; monster "this",-1,-1,"--ja--",.@mob_id,1,strnpcinfo(0)+"::OnMobKill",.@size; } OnMobKill: end; } .................{ doevent "Sample::OnTalk"; },{},{} oh i use old revision thats why.. and its working now. Thank you for this cool script. Edited April 6, 2013 by naaaan Quote
Question
naaaan
Need help on this one.
custom bloody branch item script.
i want that:
1.If you click bloody branch, box will appear like this (text will be ignored and no monster will be summon)
2.Then if you want to summon monsters. example poring ID:1002 it will summoned poring.
3. If you replace the 1st number with "9" Large Monster Will be summoned Example Poring ID:1002 replace 1 with 9 then "9002"
summoned large poring .
4 If you use "5" example poring 1002 -> "5002" it summoned small poring.
5. If you input number 1 in the box and click okay. All monster that you summon will be disappear
I need the item script for this.Hope you help me
7 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.