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

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

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