Jump to content
  • 0

Monster spawn event.


Elqpal

Question


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   2
  • Joined:  09/01/12
  • Last Seen:  

Hi,

 

I want to request a script every hour a monster in town will spawn randomly and drops an item.

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.05
  • Content Count:  1546
  • Reputation:   192
  • Joined:  07/23/14
  • Last Seen:  

Here's a script that i search on google and its similar to your request. credits goes to sanbox.

-	script	TownInvasion	-1,{

OnMinute00:
	if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) {

		for(.@i = 0; .@i < 4; .@i++) { //Spawn on 4 towns
			.Town_Invade$ = .Town$[rand(getarraysize(.Town$))];
			announce .Town_Invade$+" Guard: Help us! Our town is being invaded!",bc_blue|bc_all;

			for(.@ix = 0; .@ix < 5; .@ix++) { //MvP spawner
				monster .Town_Invade$,0,0,"--ja--",.MvP[rand(getarraysize(.MvP))],1,strnpcinfo(1)+"::OnInvadeDeath";
				}

			for(.@iy = 0; .@iy < 100; .@iy++) { //Mob spawner
				monster .Town_Invade$,0,0,"--ja--",-1,1,strnpcinfo(1)+"::OnMobsDeath";
				}
		}
	}
	end;

OnInvadeDeath:
	.@RandMvP = rand(getarraysize(.Prize));
	getitem .Prize[.@RandMvP],.PAmt[.@RandMvP];
	end;

OnMobsDeath:
	.@RandMob = rand(getarraysize(.Prize2));
	getitem .Prize2[.@RandMob],.PAmt2[.@RandMob];
	end;


OnInit:
	//Towns to Invade
	setarray .Town$[0],"prontera","izlude","geffen","payon","alberta","aldebaran","yuno","lighthalzen","einbroch","einbech","comodo","umbala","amatsu","gonryun","ayothaya","louyang","hugel","rachel","veins";

	//MvPs to summon
	setarray .MvP[0],1583,1832,1312;


	//Prize to give MVP
	setarray .Prize[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512;
	setarray .PAmt[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;

	//Prize to give Mobs	
	setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512;
	setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
	end;

}

how to run this everyhour? just change this part

OnMinute00:

into this

OnMinute60:

its easy and user friendly script that you can understand. it contains (maps), (mvp's ID#),(prizes)

	//Towns to Invade
	setarray .Town$[0],"prontera","izlude","geffen","payon","alberta","aldebaran","yuno","lighthalzen","einbroch","einbech","comodo","umbala","amatsu","gonryun","ayothaya","louyang","hugel","rachel","veins";

	//MvPs to summon
	setarray .MvP[0],1583,1832,1312;


	//Prize to give MVP
	setarray .Prize[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512;
	setarray .PAmt[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;

	//Prize to give Mobs	
	setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512;
	setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
	end;
Edited by Ginji
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  16
  • Topics Per Day:  0.00
  • Content Count:  66
  • Reputation:   2
  • Joined:  09/01/12
  • Last Seen:  

Hi, Thanks for your reply!

if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) {

In this line the event will not work when WoE is active right?

	//Prize to give Mobs	
	setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512;
	setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;

And in this line the prize is random?

-	script	TownInvasion	-1,{

OnMinute60:
	if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) {

		for(.@i = 0; .@i < 4; .@i++) { //Spawn on 4 towns
			.Town_Invade$ = .Town$[rand(getarraysize(.Town$))];
			announce .Town_Invade$+" Guard: Help us! Our town is being invaded!",bc_blue|bc_all;

			for(.@iy = 0; .@iy < 100; .@iy++) { //Mob spawner
				monster .Town_Invade$,0,0,"--ja--",-1,1,strnpcinfo(1)+"::OnMobsDeath";
				}
		}
	}
	end;


OnMobsDeath:
	.@RandMob = rand(getarraysize(.Prize2));
	getitem .Prize2[.@RandMob],.PAmt2[.@RandMob];
	end;


OnInit:
	//Towns to Invade
	setarray .Town$[0],"prontera","izlude","geffen","payon","alberta","aldebaran","yuno","lighthalzen","einbroch","einbech","comodo","umbala","amatsu","gonryun","ayothaya","louyang","hugel","rachel","veins";


	//Prize to give Mobs	
	setarray .Prize2[0],7227,607,608,501,502,503,504,505,506,507,508,509,510,511,512;
	setarray .PAmt2[0],1,1,1,1,1,1,1,1,1,1,1,1,1,1,1;
	end;

}

What monsters will be spawn here? I deleted the MvP spawn.

Link to comment
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.   Paste as plain text instead

  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.

×
×
  • Create New...