Jump to content
  • 0

KOTH need help here


Microsoft

Question


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  244
  • Reputation:   17
  • Joined:  11/19/11
  • Last Seen:  

Here's a koth script I have I'm having errors on running it on eathena can anyone help me?

script	KOHannouncer	-1,{

OnInit:
	disablenpc "KingOfHillRace";
	disablenpc "kohfinish";
	end;
}

quiz_00,26,111,5	script	Koth Assistant	56,{
	if ($started == 1) donpcevent "KingOfHill::Onregister";
	if (getgmlevel()>=60) goto L_GAMEMASTER;
	mes "^FF0000Scripted by: Fantomexâ„¢^000000";
	mes "[King Of Hill]";
	mes "Only Freedom RO GameMaster's can open the race";

L_no:
	close;

L_GAMEMASTER:


	mes "[Koth Assistant]";
	mes "Good day, Would you like to start the KOTH event?";
	menu " - Yes",-,"- No",L_no;
	close2;
	cleararray $kohplayers[0],0,getarraysize($kohplayers);
	announce "King Of Hill Event Has started",0;
	enablenpc "KingOfHill";
	enablenpc "kohfinish";
	set $started,1;
	sleep2 10000;
	announce "Please proceed to the upper part of Prontera if you want to participate",0;
	sleep 10000;
	announce "Enter the portal before it closes",0;
	initnpctimer;
	close;

OnTimer30000:
	announce "King Of Hill event will start in 30 seconds",0;
	sleep2 5000;
	announce "Hurry before the portal closes",0;
	end;

OnTimer50000:
	announce "King Of Hill Portal is now closed",0;
	end;

OnTimer51000:
	donpcevent "KOHannouncer::OnEnable";
	stopnpctimer;
	disablenpc "KingOfHillRace";
	end;

}

//===========================================================

prontera,156,220,5	script	KingOfHillRace	905,{
Onregister:
if ($started == 1) {
	
	mes "Hello would you like to register to join the race?";
	next;
	menu " -Yes",-," -No",L_no;
		next;
		mes "Thankyou for registering " + strcharinfo(0) + ", Remember Run as fast as your can and Have fun!";
		if (getarraysize($kohplayers) == 0) setarray $kohplayers[0], getcharid(3);
		else setarray $kohplayers[getarraysize($kohplayers)], getcharid(3);
		atcommand "@option 255,0,0";
		warp "mjolnir_04",77,304;
		end;
}
end;
L_no:
close;
end;
}

//===========================================================

-	script	KOHannouncer	-1,{
OnEnable:
	mapannounce "mjolnir_04","The one who will reach the end of the bridge found at the top of the Hill will win the event",16;
	announce "Get Ready... Countdown will begin at 5",bc_all;

sleep2 1000;
	mapannounce "4",bc_all;

sleep2 1000;
	mapannounce "3",bc_all;

sleep2 1000;
	mapannounce "2",bc_all;

sleep2 1000;
	mapannounce "1",bc_all;

sleep2 1000;
		donpcevent "freezer::OnEvent";
		//areawarp "mjolnir_04",72,307,82,300,"mjolnir_04",77,304;
	mapannounce "GO!",bc_all;
end;

}
mjolnir_04,135,208,5	script	Finish Line!::kohfinish	111,2,2,{
if ($started == 0) end;
OnTouch:
	if (.winner == 1) {
	mes "We now have a winner!.";
	end;
	}	
if (.winner == 0) {
	mes "You win !!";
	set .winner,1;
	close2;
	}	

announce strcharinfo(0)+" is the King of the Hill!!!",bc_all;
getitem 7227,3;
getitem 674,30;
getitem 7608,5;
set $started,0;
atcommand "@doommap";
atcommand "@kill "+strcharinfo(0);
set .winner,0;
cleararray $kohplayers[0],0,getarraysize($kohplayers);
disablenpc "kohfinish";
end;



}

mjolnir_04,0,0,0	script	freezer	111,2,2,{
OnEvent:
		for (set .@i, 0; .@i < getarraysize($kohplayers); set .@i, .@i + 1) {
		attachrid($kohplayers[.@i]);
		atcommand "@option 0 0 0";
		}
		end;
		}


//=================MapFlags=============================

mjolnir_04	mapflag	noteleport
mjolnir_04	mapflag	nosave	SavePoint
mjolnir_04	mapflag	nobranch
mjolnir_04	mapflag	restricted.txt	
mjolnir_04	mapflag	gvg
mjolnir_04	mapflag	nomemo
mjolnir_04	mapflag	nowarpto
mjolnir_04	mapflag	noreturn
mjolnir_04	mapflag	noskill
mjolnir_04	mapflag	novending
mjolnir_04	mapflag	monster_noteleport

Here's the error

 

ewq9.gif

Link to comment
Share on other sites

11 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  51
  • Reputation:   0
  • Joined:  06/16/12
  • Last Seen:  

You are missing the "-" before "script" in the first line. And don't forget putting a TAB between "-" and "script"

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  244
  • Reputation:   17
  • Joined:  11/19/11
  • Last Seen:  

Here's one more when I run the event the 2nd npc KingOfHillRace npc wont show up its suppose to show up when i start the event.


Update: Managed to make it work but still having this error

 

mnw7.jpg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

1.

if ($started == 1) donpcevent "KingOfHill::Onregister";
comment this line

but this edit will force the player to register from prontera town

 

 

2.

    sleep 10000;
    announce "Enter the portal before it closes",0;
    initnpctimer;
    close; // <-- change to end;
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  244
  • Reputation:   17
  • Joined:  11/19/11
  • Last Seen:  

Thanks annie managed to make it  work no more errors, one more how can I make the event end when there are no players on the map and what do I add if I want to make traps to players.


Update played around with it and I got this error

 

Script 

//===========================================================

-	script	KOHannouncer	-1,{

OnEnable:
	mapannounce "mjolnir_04","The one who will reach the end of the bridge found at the top of the Hill will win the event",16;
	announce "Get Ready... Countdown will begin at 5",bc_map;

sleep2 1000;
	announce "4",bc_map;

sleep2 1000;
	announce "3",bc_map;

sleep2 1000;
	announce "2",bc_map;

sleep2 1000;
	announce "1",bc_map;

sleep2 1000;
		donpcevent "freezer::OnEvent";
		//areawarp "mjolnir_04",72,307,82,300,"mjolnir_04",77,304;
	announce "GO!",bc_map;
end;

}

	mjolnir_04,146,208,5	script	Finish Line!::kohfinish	111,2,2,{
	if ($started == 0) end;
	OnTouch:
	if (.winner == 1) {
	mes "We now have a winner!.";
	end;
	}	
	if (.winner == 0) {
	mes "You win !!";
	set .winner,1;
	close2;
	}	

	announce strcharinfo(0)+" is the King of the Hill!!",bc_all;
	getitem 7227,5;
	getitem 674,20;
	set $started,0;
	atcommand "@doommap";
	atcommand "@warp prontera,150,150 "+strcharinfo(0);
	set .winner,0;
	cleararray $kohplayers[0],0,getarraysize($kohplayers);
	disablenpc "kohfinish";
	end;



	}

	mjolnir_04,0,0,0	script	freezer	111,2,2,{
	OnEvent:
		for (set .@i, 0; .@i < getarraysize($kohplayers); set .@i, .@i + 1) {
		attachrid($kohplayers[.@i]);
		atcommand "@option 0 0 0";
		}
		end;
		}

0nj3.jpg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

note that the type of timer runs in an event script, make sure all them are running without rid attached

I think if you want to play around with the script, I better rewrite it, since this script is so unoptimized

[paste=5wz8uee3plf5]

hehe ... use this new pastebin

if you want to make obstacles

create a new npc with sprite ID -1 and trigger OnTouch

 

mjolnir_04,151,209,5	script	koth_slow#1	-1,2,2,{
	end;
OnTouch:
//	sc_start SC_STUN, rand(1000,5000), 1;
//	sc_start SC_BLIND, rand(5000,10000), 1;
	sc_start SC_DECREASEAGI, rand(1000,5000), 10;
	end;
OnInit:
	while ( checkcell( strnpcinfo(4), .@x = rand(450), .@y = rand(450), cell_chknopass ) );
	movenpc strnpcinfo(0), .@x, .@y;
	end;
}
there are a bunch of status change (sc_) defined in const.txt, you can play around with them

its better to randomize the npc location every time the event start

so after the "GO!" announcement, add donpcevent "koth_slow#1"; ... and so on to move the npc into random locations

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  244
  • Reputation:   17
  • Joined:  11/19/11
  • Last Seen:  

Thanks annie, Gonna try this :)


The link your provided me its not working it redirects me to the forums

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

just fixed it,

me just play around with this new pastebin

PS : actually I made so many fault in previous version ...

gotta ask someone delete them later

http://rathena.org/board/pastebin/3pnsf9klozhf/

http://rathena.org/board/pastebin/3ipi9o3fd7h/

http://rathena.org/board/pastebin/6j0ojwnukct/

http://rathena.org/board/pastebin/5wz8uee3plf5/ <-- this is the only one correct

I somehow still prefer to use attachment, so I can always delete it if I made fault with it

but this new forum pastebin ... I'm still thinking about using it or not

EDIT: hmm now it seems fun

I can remove my own paste now

Edited by AnnieRuru
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  244
  • Reputation:   17
  • Joined:  11/19/11
  • Last Seen:  

Thanks again annie, Your a big help to me :) again ill try this and see what I could still add on it .

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  244
  • Reputation:   17
  • Joined:  11/19/11
  • Last Seen:  

Tried it annie I get this error? 

 

5dm0.jpg

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

don't tell me you are using eathena ?

then why you put rathena under your username ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  244
  • Reputation:   17
  • Joined:  11/19/11
  • Last Seen:  

I switch between the two. :) but mostly I use rathena.

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