Jump to content
  • 0
Sign in to follow this  
mrlongshen

Restrict gm below 60

Question

Hello, is that possible to restrict gm below level 60 to spawn only limited mobs.

For example a gm can spawn only 5 mob number (adjustable) the quantity. If the gm spawn 6 mobs, a disbottom msg appear, you cannot spawn more that (mob number).

 

My stupid gm like spawn (unlimited) mobs for player. So I need to make it limited. Haha. Besides that, that will make the gm tired to spawn many times. Lol.

 

@spawn poring 30

 

With new script

 

@spawn poring 5 ( gm need to write 6 times to spawn 30 poring )

 

#crazy gm that help too much spawn mobs for player. That a bad idea because make player easy hunting a mobs or doing questing. I had warning him, but seem it ignore me. LoL.

Share this post


Link to post
Share on other sites

10 answers to this question

Recommended Posts

  • 0

I dont know if that works, but maybe you can disable it via groups.conf for GMs below 60 and use that script:

-	script	mobspawn_restriction	-1,{	OnInit:		bindatcmd("monster", strnpcinfo(3) + "::OnAtcommand");		.maxMobsPerSpawn = 5;	end;	OnAtcommand:		if(getgmlevel() >= 60 || getgmlevel() == 0) end;		.@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]);				if(.@mobCount > .maxMobsPerSpawn) {			dispbottom("You can't spawn more than " +  .@mobCount +  " mobs at a time.");			end;		}				atcommand("@monster " + .@atcmd_parameters$[0] + " " + .@mobCount);	end;}

I don't know if this doesn't fail when the @monster command is restricted but how it should work is, it blocks the original monster command, hooks it and starts the atcommand via script and restricts the monster spawn. If a user with a gm level below 1 or above 60 uses @monster, the script just ends itself instead of doing anything since users below gm level 1 shouldn't be able to use it and users above 60 aren't restricted so the original should work.

 

If that approach fails or you don't mind having a second monster command you also could use this:

-	script	mobspawn_restriction	-1,{	OnInit:		bindatcmd("monster2", strnpcinfo(3) + "::OnAtcommand");		.maxMobsPerSpawn = 5;	end;	OnAtcommand:		if(getgmlevel() == 0) end;		.@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]);				if(.@mobCount > .maxMobsPerSpawn) {			dispbottom("You can't spawn more than " +  .@mobCount +  " mobs at a time.");			end;		}				atcommand("@monster " + .@atcmd_parameters$[0] + " " + .@mobCount);	end;}

Can be used like @monster you just have to use @monster2 it ignores everything below gm level 1. If used by any gm it works like a restricted @monster. All you have to do is to restrict the original @monster command for gms below 60 in the groups.conf.

Edited by Winterfox

Share this post


Link to post
Share on other sites
  • 0

@@mleo1 I cant simplify remove him, he has done helped me alot. I just dont like his attitute like spawn monster for player. He said "I just like helped player". -_-

 

@@Winterfox thanks ! I prefer your script no 1. Lets me test first after disable it th groups. Will lets you know this Monday.

Share this post


Link to post
Share on other sites
  • 0

@@mrlongshen Well, i just don't know if the bindatcmd works on disabled @commands, in case it doesn't, i provided the other script, that implements it as a own command. I am looking forward to hear how it is working out.

Share this post


Link to post
Share on other sites
  • 0
-	script	mobspawn_restriction	-1,{	OnInit:		bindatcmd("monster", strnpcinfo(3) + "::OnMonster", 1);		bindatcmd("monstersmall", strnpcinfo(3) + "::OnMonsterSmall", 1);		bindatcmd("monsterbig", strnpcinfo(3) + "::OnMonsterBig", 1);		.maxMobsPerSpawn = 5;	end;	OnMonster:		.@cmdType$ = "monster";	OnMonsterSmall:		if(.@cmdType$ == "")			.@cmdType$ = "monstersmall";	OnMonsterBig:		if(.@cmdType$ == "")			.@cmdType$ = "monsterbig";				if(getgmlevel() >= 60) end; 		.@mobCount = (.@atcmd_parameters$[1] == "") ? 1 : atoi(.@atcmd_parameters$[1]);				if(.@mobCount > .maxMobsPerSpawn) {			dispbottom("You can't spawn more than " +  .@mobCount +  " mobs at a time.");			end;		}				atcommand("@" + .@cmdType$ + " " + .@atcmd_parameters$[0] + " " + .@mobCount);	end;}
Edited by Winterfox

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.