Jump to content
  • 0
Sign in to follow this  
vijay

Mob Restriction Script

Question

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;}

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0

@@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.

Share this post


Link to post
Share on other sites
  • 0

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 by vijay

Share this post


Link to post
Share on other sites
  • 0

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?

Share this post


Link to post
Share on other sites
  • 0
-	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 by Winterfox

Share this post


Link to post
Share on other sites
  • 0

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."!

Share this post


Link to post
Share on other sites
  • 0

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 >.<

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.