Jump to content
  • 0

Invasion: Automatic Event


Strand

Question


  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  102
  • Reputation:   2
  • Joined:  07/01/13
  • Last Seen:  

Hello guys.

 

I just got this script from one guy on rAthena.org, its really good but when i try to make it automatic at a certain time it just doesnt start, i dont know why...

 

If you have better eyes than me, maybe you could help me out...

 

I'd be thankful... (By the way, i want it to be every 4 hours...)

 

Heres de script:

-	script	TownInvasion	-1,{

OnClock0100:
OnClock0500:
OnClock1033:
OnClock1300:
OnClock1700:
OnClock2100:
	if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) {

		for(.@i = 0; .@i < 1; .@i++) { //Spawn on 4 towns
			.Town_Invade$ = .Town$[rand(getarraysize(.Town$))];
			announce Guardia de .Town_Invade$+": ¡Ayuda! nos han invadido",bc_blue|bc_all;

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

			for(.@iy = 0; .@iy < 400; .@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],1630,1885,1389,1583,1418;


	//Prize to give MVP
	setarray .Prize[0],604,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],604,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;

}

Thanks.

 

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  317
  • Reputation:   63
  • Joined:  11/13/11
  • Last Seen:  

-	script	TownInvasion	-1,{

OnClock0100:
OnClock0500:
OnClock1033:
OnClock1300:
OnClock1700:
OnClock2100:

for(.@i = 0; .@i < 1; .@i++) { //Spawn on 4 towns
	.Town_Invade$ = .Town$[rand(getarraysize(.Town$))];
	announce Guardia de .Town_Invade$+": ¡Ayuda! nos han invadido",bc_blue|bc_all;

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

	for(.@iy = 0; .@iy < 400; .@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],1630,1885,1389,1583,1418;


	//Prize to give MVP
	setarray .Prize[0],604,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],604,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;

}

if(gettime(3) % 2 == 1 && !agitcheck() && !agitcheck2()) - This line checked if your script met the conditions before starting it.

 

Breaking it down one by one;

if(gettime(3) % 2 == 1 -> If the HOUR is ODD (1,3,5,7,9,etc).

&& !agitcheck() -> If WoE is currently off.

&& !agitcheck2() -> If WoE:SE is currently off.

 

If any of the above checks didn't meet the condition, your script wont start.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  131
  • Reputation:   53
  • Joined:  06/02/12
  • Last Seen:  

announce Guardia de .Town_Invade$+": ¡Ayuda! nos han invadido",bc_blue|bc_all;

Change this line to:

announce "Guardia de " + .Town_Invade$+": ¡Ayuda! nos han invadido",bc_blue|bc_all;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  50
  • Topics Per Day:  0.01
  • Content Count:  1702
  • Reputation:   238
  • Joined:  09/05/12
  • Last Seen:  


OnMinute00:

if ( gettime( 3 ) % 4 || agitcheck() || agitcheck2() ) end;

// start the event after this line

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