Jump to content
  • 0

Woe Script Problem


Question

Posted

This Script is not working. It starts the woe, but dont show the Emperium in any castle.

prontera,162,194,5	script	WoE Setter	806,{
	mes "[Woe Setter]";
	if(getgmlevel()<99) goto L_NotGM;
	mes "Welcome, I can set WoE times for you";
	mes "Simply follow the intruction given in each section after this, and it should be set and ready to use";
	next;
	mes "[Woe Setter]";
	mes "Now the fun starts";
	mes "Please select what you want to do";
	next;
	menu "Add a WoE time",L_Add,"Reset All WoE times",L_Reset,"View Current WoE times",-;
	mes "[Woe Setter]";
	mes "Ok currently you have WoE times set for:-";
	set @num,0;
L_LoopList:
	if($sday[@num] == 0 && $eday[@num] == 0 && $woetime[@num] == 0 && $woetime2[@num] == 0) goto L_LoopListEnd;
	if($sday[@num]==0) set $@tempday$,"Sunday";
	if($sday[@num]==1) set $@tempday$,"Monday";
	if($sday[@num]==2) set $@tempday$,"Tuesday";
	if($sday[@num]==3) set $@tempday$,"Wednesday";
	if($sday[@num]==4) set $@tempday$,"Thursday";
	if($sday[@num]==5) set $@tempday$,"Friday";
	if($sday[@num]==6) set $@tempday$,"Saturday";
	if($eday[@num]==0) set $@tempday2$,"Sunday";
	if($eday[@num]==1) set $@tempday2$,"Monday";
	if($eday[@num]==2) set $@tempday2$,"Tuesday";
	if($eday[@num]==3) set $@tempday2$,"Wednesday";
	if($eday[@num]==4) set $@tempday2$,"Thursday";
	if($eday[@num]==5) set $@tempday2$,"Friday";
	if($eday[@num]==6) set $@tempday2$,"Saturday";
	if($eday[@num]==$sday[@num]) mes $@tempday$+" from "+$woetime[@num]+":00 till "+$woetime2[@num]+":00";
	if($eday[@num]!=$sday[@num]) mes "From "+$@tempday$+" "+$woetime[@num]+":00 till "+$@tempday2$+" "+$woetime2[@num]+":00";
	set @num,@num+1;
	goto L_LoopList;
L_LoopListEnd:
	close;
L_Add:
	set @num,0;
L_AddLoop:
	if($sday[@num] == 0 && $eday[@num] == 0 && $woetime[@num] == 0 && $woetime2[@num] == 0) goto L_AddLoopEnd;
	set @num,@num+1;
	goto L_AddLoop;
L_AddLoopEnd: 
	mes "[Woe Setter]";
	mes "What day do you want the WoE to start ^FF0000start^000000 in?";
	next;
	menu "Sunday",-,"Monday",-,"Tuesday",-,"Wednesday",-,"Thursday",-,"Friday",-,"Saturday",-;
	if(@menu==1) set $sday[@num],0;
	if(@menu==2) set $sday[@num],1;
	if(@menu==3) set $sday[@num],2;
	if(@menu==4) set $sday[@num],3;
	if(@menu==5) set $sday[@num],4;
	if(@menu==6) set $sday[@num],5;
	if(@menu==7) set $sday[@num],6;
	mes "[Woe Setter]";
	mes "Ok, now please enter the hour you wish the WoE to ^FF0000start^000000 at";
	mes "This is using a 24 hour clock";
	mes "00 = Midnight";
	mes "12 = Mid-day";
	mes "23 = 11pm";
	next;
	input @input;
	if (@input < 0 || @input > 24) goto L_BadNumber;
	set $woetime[@num],@input;
	mes "[Woe Setter]";
	mes "What day do you want the WoE to start ^FF0000finish^000000 in?";
	next;
	menu "Same as start",-,"Sunday",-,"Monday",-,"Tuesday",-,"Wednesday",-,"Thursday",-,"Friday",-,"Saturday",-;
	if(@menu==1) set $eday[@num],$sday[@num];
	if(@menu==2) set $eday[@num],0;
	if(@menu==3) set $eday[@num],1;
	if(@menu==4) set $eday[@num],2;
	if(@menu==5) set $eday[@num],3;
	if(@menu==6) set $eday[@num],4;
	if(@menu==7) set $eday[@num],5;
	if(@menu==8) set $eday[@num],6;
	mes "[Woe Setter]";
	mes "Ok, now please enter the hour you wish the WoE to ^FF0000finish^000000 at";
	mes "This also uses the 24 hour clock";
	mes "00 = Midnight";
	mes "12 = Mid-day";
	mes "23 = 11pm";
	next;
	input @input;
	if (@input < 0 || @input > 24) goto L_BadNumber;
	set $woetime2[@num],@input;
	mes "[Woe Setter]";
	mes "You WoE time has now been set";
	mes "To confirm this, ask me to show you the ^FF0000'View Current WoE times'^000000";
	close;
L_Reset:
	mes "[Woe Setter]";
	mes "You are about to reset all the set WoE times you have created";
	mes "Are you sure?";
	next;
	menu "No, what was I thinking",L_No,"Yes I really want to do it",-;
	if(agitcheck()) goto L_WoEOn;
	deletearray $sday[0],200;
	deletearray $eday[0],200;
	deletearray $woetime[0],200;
	deletearray $woetime2[0],200;	
	mes "[Woe Setter]";
	mes "They are all gone now, please remember to set new ones";
	close;
L_WoEOn:
	mes "[Woe Setter]";
	mes "Sorry since there is a WoE in progress you cannot reset the WoE times";
	close;
L_No:
	mes "[Woe Setter]";
	mes "Oh, good, come back whenever";
	close;
L_NotGM:
	mes "The current WoE times are :-";
	set @num,0;
	goto L_LoopList;
	end;
L_BadNumber:
	mes "[Woe Setter]";
	mes "Sorry that was an invalid number, please try again";
	close;
}
-	script	Agit_Event2	-1,{
	end;
OnInit:
disablenpc "Agit_Event";
OnMinute00:
OnAgitInit:

// starting time check
	set $@num,0;
L_StartLoop:
	if($sday[$@num] == 0 && $eday[$@num] == 0 && $woetime[$@num] == 0 && $woetime2[$@num] == 0) goto L_StartLoopEnd;
	if(gettime(4)==$sday[$@num] && gettime(3)>=$woetime[$@num] && (gettime(3)<$woetime2[$@num] || $sday[$@num]!=$eday[$@num])) goto L_Start;
	set $@num,$@num+1;
	goto L_StartLoop;

// end time checks
	L_StartLoopEnd:
	set $@num,0;
	L_EndLoop:
	if($eday[$@num] == 0 && $woetime[$@num] == 0 && $woetime2[$@num] == 0) end;
	if((gettime(4)==$eday[$@num]) && (gettime(3)==$woetime2[$@num])) goto L_End;
	set $@num,$@num+1;
	goto L_EndLoop;
	end;

// Stop WoE
L_End:
	if(!agitcheck()) end;
	Announce "The War Of Emperium is over!",8;
	AgitEnd;
	end;

// Start WoE
L_Start:
	if(agitcheck()) end;
	Announce "The War Of Emperium has begun!",8;
	AgitStart;
	end;
}

1 answer to this question

Recommended Posts

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...