vijay 3 Posted August 2, 2015 Can anyone please help by converting the script below to work on eAthena 3CeAm! - script Strict -1,{ OnInit: setarray .mob_restriction[0],1646,1647,1648,1649,1650,1651,1751,1708; .size = getarraysize(.mob_restriction); bindatcmd "monster",strnpcinfo(3)+"::OnExe",0,99; end; OnExe: .monster_id = atoi( .@atcmd_parameters$[0] ); for ( .@i = 0; .@i < .size; .@i++ ) { if ( .monster_id == .mob_restriction[.@i] || getgmlevel() < 90 ) { dispbottom "You cannot summon this monster"; end; } } if ( getmonsterinfo( .monster_id, 0 ) != "null" ) { .@amount = atoi( .@atcmd_parameters$[1] ); atcommand "@monster " +.monster_id+ " " +(!.@amount?1:.@amount); } end;} Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted August 2, 2015 @@vijay Try this: - script Strict -1,{ OnInit: setarray .mob_restriction$, 1646, 1647, 1648, 1649, 1650, 1651, 1751, 1708; set .size, getarraysize( .mob_restriction$ ); bindatcmd "monster", strnpcinfo( 3 ) + "::OnExe", 0, 99; end; OnExe: if ( compare( implode( .@mob_restriction$, ":" ), .@atcmd_parameters$[0] ) || getgmlevel() < 90 ) { dispbottom "You cannot summon this monster"; end; } set .@monster_id, atoi( .@atcmd_parameters$[0] ); if ( getmonsterinfo( .@monster_id, MOB_NAME ) != "null" ) { set .@amount, atoi( .@atcmd_parameters$[1] ); atcommand "@monster " +.monster_id + " " + ( !.@amount ? 1 : .@amount ); } end;} It might be possible there is still something hercules exclusive, so if you get errors just report back. Quote Share this post Link to post Share on other sites
0 vijay 3 Posted August 2, 2015 (edited) Thanks for helping Winterfox.Here are the error when i load the npc: [Error]: script error on npc/wowro/mobrestriction.txt line 5 parse_line: expect command, missing function name or calling undeclared func tion 1 : { 2 : OnInit: 3 : setarray .mob_restriction$, 1646, 1647, 1648, 1649, 1650 , 1651, 1751, 1708; 4 : set .size, getarraysize( .mob_restriction$ ); * 5 : 'b'indatcmd "monster", strnpcinfo( 3 ) + "::OnExe", 0, 9 9; 6 : end; 7 : 8 : OnExe: 9 : if ( compare( implode( .@mob_restriction$, ":" ), .@atc md_parameters$[0] ) || getgmlevel() < 90 ) { 10 : dispbottom "You cannot summon this monster"; Edited August 2, 2015 by vijay Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted August 2, 2015 Seems like 3CeAm doesn't have the bindatcmd. You will have to search for a source mod to add it. Quote Share this post Link to post Share on other sites
0 vijay 3 Posted August 2, 2015 Okay ill give it a try. Winterfox i did add the bindatcmd from a diff now. bindatcmd diff: http://pastebin.com/5TqdF1pn After when i load up your npc, i'm not even able to @monster any of monsters(which are not on the mob_restriction).Map server says [Warning]: script:implode: array length = 0 How to fix this issue? Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted August 2, 2015 (edited) - script Strict -1,{ OnInit: setarray .mob_restriction$, 1646, 1647, 1648, 1649, 1650, 1651, 1751, 1708; bindatcmd "monster", strnpcinfo( 3 ) + "::OnExe", 0, 99; end; OnExe: if ( compare( implode( .mob_restriction$, ":" ), .@atcmd_parameters$[0] ) || getgmlevel() < 90 ) { dispbottom "You cannot summon this monster"; end; } set .@monster_id, atoi( .@atcmd_parameters$[0] ); if ( getmonsterinfo( .@monster_id, MOB_NAME ) != "null" ) { set .@amount, atoi( .@atcmd_parameters$[1] ); atcommand "@monster " +.@monster_id + " " + ( !.@amount ? 1 : .@amount ); } end;} Edited August 2, 2015 by Winterfox Quote Share this post Link to post Share on other sites
0 vijay 3 Posted August 2, 2015 The error is fixed but i still cant even @monster poring too doe its not on the mob_restriction list.It keeps telling you cannot summon this monster. Even when i type @monster and hit enter, it says "you cannot summon this monster."! Quote Share this post Link to post Share on other sites
0 Winterfox 83 Posted August 2, 2015 @@vijay There are only 2 possible reasons for this, either the monster is on the restricted list or the login you use doesn't have a gm level above 90. Quote Share this post Link to post Share on other sites
0 vijay 3 Posted August 2, 2015 What ever mob i try to @monster with my lvl 80 char it says "You cannot spawn this monster".Even i can't @monster 1646 on my lvl 100 GM id, it says "You cannot spawn this monster". - script mobrest -1,{ OnInit: setarray .mob_restriction$, 1646, 1647, 1648, 1649, 1650, 1651, 1751, 1708; set .size,getarraysize(.mob_restriction); bindatcmd "spawn",strnpcinfo(3)+"::OnExe"; end; OnExe: set .monster_id,atoi( .@atcmd_parameters$[0] ); for( set .@i,0; .@i < .size; set .@i,.@i + 1 ) { if ( .monster_id == .mob_restriction[.@i] && getgmlevel() < 99 ) { dispbottom "You cannot summon this monster"; end; } } if ( getmonsterinfo( .monster_id, 0 ) != "null" ) { set .@amount,atoi( .@atcmd_parameters$[1] ); atcommand "@monster " +.monster_id+ " " +(!.@amount?1:.@amount); } end;} When i change the monster to spawn, its working now >.< Quote Share this post Link to post Share on other sites
Can anyone please help by converting the script below to work on eAthena 3CeAm!
Share this post
Link to post
Share on other sites