Jump to content
  • 0

Soul Hunter Quest !


Question

Posted (edited)

Hello rAthena Script Master's! i just want to clarify this NPC, i dont own or made this one i found it on Game, Event, Quest Scripts and made by Spyra! the problem is when i tried to change the prize in game, something will pop out, like this " Incorrect use of "close" command ! (blahblah) " its just a Warning on my Map.sql and here's the script !

 

and can someone explain a little bit how this Game Works? thanks in advance :)

 

//===== Script ==============================================================================
//= SoulHunters
//===== Original By =========================================================================
//= Spyra/og2 (Honor)
//===== Current Version: ====================================================================
//= 1.2
//===== Compatible With: ====================================================================
//= rAthena SVN
//===== Description: ========================================================================
//= Replica of Head Hunters (by og2) but modded, no src, or item edits.
//= Game Originally made for SpyraRO (www.spyrax.net)
//===== Updates: ============================================================================
//= 1.0 SoulHunter. [og2]
//= 1.1 Fixed a few bugs. [og2]
//= 1.2 if there's no tag, display default. [og2]
//======= MapFlags ==========================================================================
2@cata	mapflag	noteleport
2@cata	mapflag	nosave	SavePoint
2@cata	mapflag	nobranch
2@cata	mapflag	nopenalty
2@cata	mapflag	nomemo
2@cata	mapflag	nowarp
2@cata	mapflag	nowarpto
2@cata	mapflag	noicewall
2@cata	mapflag	noreturn
//2@cata	mapflag	pvp //Uncomment if your server 'pk_mode' is 0
force_1-1	mapflag	pvp	off
arena_room	mapflag	pvp	off
2@cata	mapflag	pvp_noparty
2@cata	mapflag	pvp_noguild
2@cata	mapflag	restricted	5
2@cata	mapflag	loadevent
prt_are01	mapflag	loadevent
lhz_cube	mapflag	noteleport
lhz_cube	mapflag	nosave	SavePoint
lhz_cube	mapflag	nobranch
lhz_cube	mapflag	nopenalty
lhz_cube	mapflag	nomemo
lhz_cube	mapflag	nowarp
lhz_cube	mapflag	nowarpto
lhz_cube	mapflag	noicewall
lhz_cube	mapflag	noreturn
lhz_cube	mapflag	pvp	off
//===== Spawn Points ========================================================================
//= 2@cata,x,y;
//= 2@cata,61,35;
//= 2@cata,97,35;
//= 2@cata,93,46;
//= 2@cata,66,46;
//= 2@cata,66,85;
//= 2@cata,93,85;
//= 2@cata,110,66;
//= 2@cata,49,66;
//= 2@cata,57,35;
//= 2@cata,100,35;
//=============================================================================================
prontera,146,172,5	script	Soul Hunters#1	843,{

	if(getgmlevel() < 99) { goto normalmenu; }
	/* Administrator Menu */
	message strcharinfo(0),"Hello "+strcharinfo(0)+", Welcome to SoulHunter Administrator Panel.";
	switch(select("^0000ff~^000000 Normal Menu",
	"^0000ff~^000000 Set Max Players [^0000ff"+$sh_max_players+"^000000]",
	"^0000ff~^000000 Set Max Score [^0000ff"+$sh_max_score+"^000000]",
	"^0000ff~^000000 Set Autowin Score [^0000ff"+$sh_autowin_score+"^000000]",
	"^0000ff~^000000 Set Prize Item [^0000ff"+getitemname($sh_prize)+"^000000]",
	"^0000ff~^000000 Set Prize Quantity [^0000ff"+$sh_prize_qty+"^000000]",
	"^0000ff~^000000 Set Min BaseLevel Req. [^0000ff"+$lv_req+"^000000]",
	"^0000ff~^000000 Reset current SH status games")) {
	case 1: goto normalmenu;
	case 2:
			input .@iii;
			if(.@iii == 0) { message strcharinfo(0),"~No value can be set to '0'."; break; }
			if(.@iii > 15) { message strcharinfo(0),"~The max amount of 'players' you can set is 15."; break; }
			else { set $sh_max_players,.@iii;
			announce "~ MAX PLAYERS for 'SoulHunter' has been changed to ("+$sh_max_players+"). By "+strcharinfo(0),0; }
			break;
	case 3:
			input .@iii;
			if(.@iii == 0) { message strcharinfo(0),"~No value can be set to '0'."; break; }
			if(.@iii > 25) { message strcharinfo(0),"~The max amount of 'score' is 25."; break; }
			else { set $sh_max_score,.@iii;
			announce "~ MAX SCORE for 'SoulHunter' has been changed to ("+$sh_max_score+"). By "+strcharinfo(0),0; }
			break;
	case 4:
			input .@iii;
			if(.@iii == 0) { message strcharinfo(0),"~No value can be set to '0'."; break; }
			if(.@iii > 10) { message strcharinfo(0),"~The max amount of 'autowin_score' is 10."; break; }
			else { set $sh_autowin_score,.@iii;
			announce "~ MAX AUTOWIN SCORE for 'SoulHunter' has been changed to ("+$sh_autowin_score+"). By "+strcharinfo(0),0; }
			break;
	case 5:
			message strcharinfo(0),"Please input the Item with numbers. Example: '969' (without the  ' ') for gold.";
			input .@iii;
			if(.@iii == 0) { message strcharinfo(0),"~No value can be set to '0'."; break; }
			if(getitemname(.@iii) == "null") { message strcharinfo(0),"~Please choose a valid item."; break; }
			else { set $sh_prize,.@iii;
			announce "~ PRIZE ITEM for 'SoulHunter' has been changed to ("+getitemname($sh_prize)+"). By "+strcharinfo(0),0; }
			break;
	case 6:
			input .@iii;
			if(.@iii == 0) { message strcharinfo(0),"~No value can be set to '0'."; break; }
			if(.@iii > 150) { message strcharinfo(0),"~The max amount of 'item_prize_quantity' is 150."; break; }
			else { set $sh_prize_qty,.@iii;
			announce "~ PRIZE ITEM QUANTITY for 'SoulHunter' has been changed to ("+$sh_prize_qty+") "+getitemname($sh_prize)+"(s). By "+strcharinfo(0),0; }
			break;
	case 7:
			input .@iii;
			if(.@iii == 0) { message strcharinfo(0),"~No value can be set to '0'."; break; }
			if(.@iii > 999) { message strcharinfo(0),"~The min 'baselevel_requirement' can't more than 999."; break; }
			else { set $lv_req,.@iii;
			announce "~ MIN REQUIREMENT BASE LEVEL for 'SoulHunter' has been changed to ("+$lv_req+"). By "+strcharinfo(0),0; }
			break;
	case 8:
		stopnpctimer "SH_CHECKWINNER1";
		stopnpctimer "SH_HILL_TIME";
		stopnpctimer "SOULHUNTERS_TIMR1";
		mapwarp "2@cata","arena_room",100,88;
		set $@SHwinner,0;
		set $@SHmatch,0;
		set $@SH_active_hill,0;
		set $@SH_temphill,0;
		for ( set .@i,0; .@i < $sh_max_players; set .@i, .@i+1 )
		{ 
			setd "$@sh_user_"+.@i,0;
			setd "$@SH_score"+.@i,0;
		}	
		break;
	}
	close;
	
normalmenu:
	if(shtag$ == "") { set shtag$,"SH"; }
	message strcharinfo(0),"Welcome back! "+shtag$;
	mes $@SHname$;
	mes "Welcome ^ff8800"+strcharinfo(0)+"^000000, how can I help you?";
	mes "Matchs Won: ^3c843a"+SHwins+"^000000.";
	mes "Matchs Lost: ^ff0000"+(SHmatchs-SHwins)+"^000000.";
	mes "Matchs Played: ^777777"+SHmatchs+"^000000.";
	mes "SoulHunters Reputation: ^0000ff"+Shrep+"^000000.";
	switch(select("^0000ff~^000000 Play Soul Hunters","^0000ff~^000000 Ranks","^0000ff~^000000 Register my ^0000ffSH^000000 Tag","^0000ff~^000000 Game Information")) {
	case 1:
		next;
		mes $@SHname$;
		mes "Are you sure you want to participate in the upcoming ^0000ffSoulHunters match^000000?";
		if(select("^0000ff~^000000 No thanks:^0000ff~^000000 Yes please!") == 2) {
			if(BaseLevel < $lv_req) goto L_Not_Met;
			//Setup Player to play
				if(getmapusers("force_1-1") >= $sh_max_players)
				{
					next;
					mes $@SHname$;
					mes "Im sorry but all arenas are full, please try again later.";
					break; 
				} else {
					mapannounce "prontera", "~ ("+shtag$+") "+strcharinfo(0)+" has entered to Soul Hunter", 1;
					mapannounce "prt_are01", "~ ("+shtag$+") "+strcharinfo(0)+" has entered to Soul Hunter", 1;
					mapannounce "arena_room", "~ ("+shtag$+") "+strcharinfo(0)+" has entered to Soul Hunter", 1;
					mapannounce "izlude", "~ ("+shtag$+") "+strcharinfo(0)+" has entered to Soul Hunter", 1;
					warp "force_1-1",100,116;
				}
				break;
		} else { break; }
	case 2:
		next;
		mes $@SHname$;
		mes "^ff0000This feat. is not yet available!^000000.";
		break;
	case 3:	
		next;
		mes $@SHname$;
		mes "Please Input your ^0000ffSoulHunters^000000 Tag";
		mes "^ff0000Note: Can't be longer than 4 Characters^000000.";
		input .@shtag$;
		if(getstrlen(.@shtag$) > 4) { message strcharinfo(0),"~The max amount of characters your 'SH_tag' can have is 4."; break; }
		if(compare(.@shtag$,"GM")) { message strcharinfo(0),"~You cannot contain the word 'GM' in your'SH_tag'"; break; }
		set shtag$,.@shtag$;
		mapannounce "arena_room","'"+strcharinfo(0)+"' has changed his shTag to -> '"+shtag$+"'.",1;
		break;
	case 4:
	infomenu:
	set .@infomenu,select("^0000ff~^000000 Game Info.","^0000ff~^000000 Hill / Point field","^0000ff~^000000 Respawns","^0000ff~^000000 Traps","^0000ff~^000000 Score","^0000ff~^000000 Cancel");
		if(.@infomenu == 1) { callfunc "SH_info","game"; }
		else if(.@infomenu == 2) { callfunc "SH_info","hill"; }
		else if(.@infomenu == 3) { callfunc "SH_info","resp"; }
		else if(.@infomenu == 4) { callfunc "SH_info","trap"; }
		else if(.@infomenu == 5) { callfunc "SH_info","scor"; }
		else { break; }
		message strcharinfo(0),"SoulHunters: Menu will re-appear in 4 seconds...";
		sleep2 4000; //Let player read.
		goto infomenu;
	}
close;

L_Not_Met:
next;
mes $@SHname$;
mes "I'm sorry but you do not meet the level requirement.";
mes "You ^ff0000must^000000 be at least ^0000ffLevel "+$lv_req+"^000000.";
close;

OnInit:
set $@SHname$,"[ ^0000ff---^000000 Soul Hunters ^0000ff---^000000 ]";
set $@SHweblink$,"www.spyrax.net/soulhunter";
//FIRST USE VARIABLES SETUP
if(!$sh_max_players)	{ set $sh_max_players,5;	}
if(!$sh_max_score) 		{ set $sh_max_score,16;		}
if(!$sh_autowin_score)	{ set $sh_autowin_score,10; }
if(!$sh_prize)			{ set $sh_prize,969; 		}
if(!$sh_prize_qty)		{ set $sh_prize_qty,15; 	}
if(!$lv_req)			{ set $lv_req,99; 			}
mapwarp "2@cata","arena_room",100,88; //Reset map
end;
}

//NPC in the Arena (Info.)
force_1-1,95,113,5	script	Soul Hunter Kafra#1	112,{
	cutin "kafra_06",2;
	infomenu:
	mes $@SHname$;
	mes "Can I help you?";
	set .@infomenu,select("^0000ff~^000000 Game Info.","^0000ff~^000000 Hill / Point field","^0000ff~^000000 Respawns","^0000ff~^000000 Traps","^0000ff~^000000 Score","^0000ff~^000000 Cancel");
		if(.@infomenu == 1) { callfunc "SH_info","game"; }
		else if(.@infomenu == 2) { callfunc "SH_info","hill"; }
		else if(.@infomenu == 3) { callfunc "SH_info","resp"; }
		else if(.@infomenu == 4) { callfunc "SH_info","trap"; }
		else if(.@infomenu == 5) { callfunc "SH_info","scor"; }
		else { cutin "",255; close; }
		message strcharinfo(0),"SoulHunters: Menu will re-appear in 4 seconds...";
		sleep2 4000; //Let player read.
		goto infomenu;
}

force_1-1,104,113,4	duplicate(Soul Hunter Kafra#1)	Soul Hunter Kafra#2	112

function	script	SH_info	{

if(getarg(0)=="game") {
	next;
	mes $@SHname$;
	mes "You gotta ^0000ffCollect Souls^000000, you have to ^ff0000kill^000000, you get the amount of Souls the player has on him/her.";
	mes "(that is its own Soul) you collect, you ^ff0000take them to^000000 the current ^ff8800Hill^000000 available, that you can see in your map northeast of the screen.";
}
if(getarg(0)=="hill") {
	next;
	mes $@SHname$;
	mes "Changes every ^0000ff30 Seconds^000000, it randomly changes its position, it is announced when it had changed.";
	mes "There's a red dot/cross flashing in your northeast map of your screen & it doens't changes well always";
	mes "So its better if you just learn the hill numbers.";
}
if(getarg(0)=="resp") {
	next;
	mes $@SHname$;
	mes "You gotta wait ^ff00004 seconds to re-spawn^000000. Respawn Points.";
}
if(getarg(0)=="trap") {
	next;
	mes $@SHname$;
	mes "These are traps are going to give you a random effect.";
	mes "Such as: Stun, Silence, Curse, Stone, Sleep, Quamarine, Divest Shield, Confusion, Blind, Bleed, Freeze";
	mes "Poison and Ankle Snare.";
}
if(getarg(0)=="scor") {
	next;
	mes $@SHname$;
	mes "You gotta score ^ff0000"+$sh_max_score+"^000000 to win a match and if you score ^ff8800"+$sh_autowin_score+"^000000 in a row, you'll automaticly win";
	mes "SoulHunters Match.";
}
	mes "^0000ff-----------------------------------^000000";
	mes "For more information please visit ^0000ff"+$@SHweblink$+"^000000";
	return;
}

// GAME START WARP (NPC)
force_1-1,100,116,1	script	SH_TIME1	-1,0,0,{
end;

OnInit:
	disablenpc "EnterSH";
	end;
	
//11 seconds
OnTimer11001:
	if($@SHmatch==0 && getmapusers("force_1-1") == $sh_max_players) {
		stopnpctimer;
		enablenpc "EnterSH"; 
		mapannounce "force_1-1","The portal will remain open for 10 seconds, hurry up!!",1;
		sleep2 10000;
		mapannounce "force_1-1","Time's Up, portal closed.",1;
		sleep2 2000;
		mapwarp "force_1-1","prontera",156,173;
		disablenpc "EnterSH";
	}
OnTouch:
	initnpctimer;
	if(getmapusers("force_1-1") > $sh_max_players) { warp "prontera",176,153; } //When 2 players click at the same time
}

force_1-1,100,124,0	script	EnterSH	45,1,1,{

	if(!$@sh_user_1) {
		for ( set .@i,0; .@i < $sh_max_players; set .@i, .@i+1 )
		{ setd "$@SH_score"+.@i,0; }
		set $@SHwinner,0;
		set $@SH_active_hill,0;
		set $@SH_temphill,0;
		set .player,0;
		mapwarp "2@cata","arena_room",100,88;
		donpcevent "SH_GameStart::OnStart1";
	}
	if(.player <= $sh_max_players) {
		set .player,.player+1;
		if(!getd("$@sh_user_"+.player)) { setd "$@sh_user_"+.player,getcharid(0); } //Example: set $@sh_user_1,getcharid(0);
	} else { warp "arena_room",100,88; }

	switch(rand(10)) { // SPAWNS
		case 0: set @SHx,61; set @SHy,35; goto SH_WarpChar;
		case 1: set @SHx,97; set @SHy,35; goto SH_WarpChar;
		case 2: set @SHx,93; set @SHy,46; goto SH_WarpChar;
		case 3: set @SHx,66; set @SHy,46; goto SH_WarpChar;
		case 4: set @SHx,66; set @SHy,85; goto SH_WarpChar;
		case 5: set @SHx,93; set @SHy,85; goto SH_WarpChar;
		case 6: set @SHx,110; set @SHy,66; goto SH_WarpChar;
		case 7: set @SHx,49; set @SHy,66; goto SH_WarpChar;
		case 8: set @SHx,57; set @SHy,35; goto SH_WarpChar;
		case 9: set @SHx,100; set @SHy,35; goto SH_WarpChar;
	}
end;

SH_WarpChar:
	set SHmatchs,SHmatchs+1;
	set @souls,1;
	dispbottom "[TIP] It is recommended that you have your /effect ON.";
	warpchar "2@cata",@SHx,@SHy,getcharid(0);
	if(!$@SHmatch) {
		set $@SHmatch,1;
	}
	end;
}

2@cata,1,1,1	script	SH_GameStart	-1,{
end;

OnStart1:
	set $@SH_active_hill,1;
	initnpctimer "SOULHUNTERS_TIMR1";
	initnpctimer "SH_CHECKWINNER1";
	initnpctimer "SH_HILL_TIME";
	end;

OnPCLoadMapEvent:	//will run on 3vs3 and CTF as well
	sc_end SC_ALL;
	percentheal 100,100;
	end;

OnPCLogoutEvent:
	for ( set .@i,0; .@i < $sh_max_players; set .@i, .@i+1 )
	{
		if(getd("$@sh_user_"+.@i) == getcharid(0)) { setd "$@sh_user_"+.@i,0; }
	}
	end;

OnPCKillEvent:
	getmapxy(.@mapname$, .@x, .@y, 0);
	if(.@mapname$=="2@cata") {
	set @souls,@souls+1;
	message strcharinfo(0),"(+1) Soul";
	mapannounce "force_1-1", "~ ("+shtag$+") "+strcharinfo(0)+" has ["+@souls+"] Souls ~", 1;
	mapannounce "arena_room", "~ ("+shtag$+") "+strcharinfo(0)+" has ["+@souls+"] Souls ~", 1;
	mapannounce "2@cata", "~ ("+shtag$+") "+strcharinfo(0)+" has ["+@souls+"] Souls ~", 1;
	specialeffect2 699;
}
	end;
	
OnPCDieEvent:	
	getmapxy(.@mapname$, .@x, .@y, 0);
	if(.@mapname$=="2@cata") {
	set @souls,@souls-1;
	if(@souls < 1) { set @souls,1; }
	message strcharinfo(0),"(-1) Soul";
	switch(rand(9)) { // SPAWNS
		case 0: set @SHx,61; set @SHy,35; goto SH_OnCharDie; end;
		case 1: set @SHx,97; set @SHy,35; goto SH_OnCharDie; end;
		case 2: set @SHx,93; set @SHy,46; goto SH_OnCharDie; end;
		case 3: set @SHx,66; set @SHy,46; goto SH_OnCharDie; end;
		case 4: set @SHx,66; set @SHy,85; goto SH_OnCharDie; end;
		case 5: set @SHx,93; set @SHy,85; goto SH_OnCharDie; end;
		case 6: set @SHx,110; set @SHy,66; goto SH_OnCharDie; end;
		case 7: set @SHx,49; set @SHy,66; goto SH_OnCharDie; end;
		case 8: set @SHx,57; set @SHy,35; goto SH_OnCharDie; end;
		case 9: set @SHx,100; set @SHy,35; goto SH_OnCharDie; end;
	}
end;
SH_OnCharDie:
	sleep2 1000;
	message strcharinfo(0),"Wait 4 Seconds to respawn...";
	sleep2 1000;
	message strcharinfo(0),"Wait 3 Seconds to respawn...";
	sleep2 1000;
	message strcharinfo(0),"Wait 2 Seconds to respawn...";
	sleep2 1000;
	message strcharinfo(0),"Wait 1 Seconds to respawn...";
	sleep2 1000;
	if($@SHmatch==0) { end; }
	atcommand "@alive";
	sc_end SC_ALL;
	warpchar "2@cata",@SHx,@SHy,getcharid(0);
}
end;
}

2@cata,1,1,1	script	SOULHUNTERS_TIMR1	-1,{
end;

//3 minutes
OnTimer180000:
	mapannounce "2@cata", "Everyone, you have one minute to finish this fight!!", 1;
	mapannounce "force_1-1", "Everyone, you have one minute to finish this fight!!", 1;
	end;

//4.75 minutes
OnTimer285000:
	mapannounce "2@cata", "Attention! The round is over in 15 seconds!!", 1;
	mapannounce "force_1-1", "Attention! The round is over in 15 seconds!!", 1;
	end;

//5 minutes - Time's up (no winner)
OnTimer300000:
if($@SH_score1 > $@SH_score2 && $@SH_score1 > $@SH_score3 && $@SH_score1 > $@SH_score4 && $@SH_score1 > $@SH_score5 && $@SH_score1 > $@SH_score6 && $@SH_score1 > $@SH_score7 && $@SH_score1 > $@SH_score8) 
{ set $@SHwinner,$@sh_user_1; donpcevent "SH_WINNER::OnWinner"; end; }

if($@SH_score2 > $@SH_score1 && $@SH_score2 > $@SH_score3 && $@SH_score2 > $@SH_score4 && $@SH_score2 > $@SH_score5 && $@SH_score2 > $@SH_score6 && $@SH_score2 > $@SH_score7 && $@SH_score2 > $@SH_score8) 
{ set $@SHwinner,$@sh_user_2; donpcevent "SH_WINNER::OnWinner"; end; }

if($@SH_score3 > $@SH_score1 && $@SH_score3 > $@SH_score2 && $@SH_score3 > $@SH_score4 && $@SH_score3 > $@SH_score5 && $@SH_score3 > $@SH_score6 && $@SH_score3 > $@SH_score7 && $@SH_score3 > $@SH_score8) 
{ set $@SHwinner,$@sh_user_3; donpcevent "SH_WINNER::OnWinner"; end; }

if($@SH_score4 > $@SH_score1 && $@SH_score4 > $@SH_score2 && $@SH_score4 > $@SH_score3 && $@SH_score4 > $@SH_score5 && $@SH_score4 > $@SH_score6 && $@SH_score4 > $@SH_score7 && $@SH_score4 > $@SH_score8) 
{ set $@SHwinner,$@sh_user_4; donpcevent "SH_WINNER::OnWinner"; end; }

if($@SH_score5 > $@SH_score1 && $@SH_score5 > $@SH_score2 && $@SH_score5 > $@SH_score3 && $@SH_score5 > $@SH_score4 && $@SH_score5 > $@SH_score6 && $@SH_score5 > $@SH_score7 && $@SH_score5 > $@SH_score8) 
{ set $@SHwinner,$@sh_user_5; donpcevent "SH_WINNER::OnWinner"; end; }

if($@SH_score6 > $@SH_score1 && $@SH_score6 > $@SH_score2 && $@SH_score6 > $@SH_score3 && $@SH_score6 > $@SH_score4 && $@SH_score6 > $@SH_score5 && $@SH_score6 > $@SH_score7 && $@SH_score6 > $@SH_score8) 
{ set $@SHwinner,$@sh_user_6; donpcevent "SH_WINNER::OnWinner"; end; }

if($@SH_score7 > $@SH_score1 && $@SH_score7 > $@SH_score2 && $@SH_score7 > $@SH_score3 && $@SH_score7 > $@SH_score4 && $@SH_score7 > $@SH_score5 && $@SH_score7 > $@SH_score6 && $@SH_score7 > $@SH_score8) 
{ set $@SHwinner,$@sh_user_7; donpcevent "SH_WINNER::OnWinner"; end; }

if($@SH_score8 > $@SH_score1 && $@SH_score8 > $@SH_score2 && $@SH_score8 > $@SH_score3 && $@SH_score8 > $@SH_score4 && $@SH_score8 > $@SH_score5 && $@SH_score8 > $@SH_score6 && $@SH_score8 > $@SH_score7) 
{ set $@SHwinner,$@sh_user_8; donpcevent "SH_WINNER::OnWinner"; end; }

	mapannounce "2@cata", "There's a TIE in Soul Hunters, no winner  !!", 1;
	mapannounce "force_1-1", "There's a TIE in Soul Hunters, no winner  !!", 1;
	end;

//5 minutes
OnTimer303000:
	stopnpctimer;
	stopnpctimer "SH_CHECKWINNER1";
	sleep 5000;
	mapannounce "arena_room", "The Soul Hunter's fight just ended without a winner!! :(",bc_blue;
	sleep 2000;
	donpcevent "SH_WINNER::OnWinner";
	end;

}

2@cata,1,1,1	script	SH_WINNER	-1,{
end;

OnWinner:
	stopnpctimer "SH_CHECKWINNER1";
	stopnpctimer "SH_HILL_TIME";
	stopnpctimer "SOULHUNTERS_TIMR1";
	warpchar "lhz_cube",10,74,$@SHwinner;
	sleep2 1501;
	mapwarp "2@cata","arena_room",100,88;
	
	// Reset Variables
	for ( set .@i,0; .@i < $sh_max_players; set .@i, .@i+1 ) { 
		setd "$@sh_user_"+.@i,0;
		setd "$@SH_score"+.@i,0;
	}
	set $@SHwinner,0;
	set $@SHmatch,0;
	set $@SH_active_hill,0;
	set $@SH_temphill,0;
	end;
}

function	script	SH_AutoWin	{
	for ( set .@i,0; .@i < $sh_max_players; set .@i, .@i+1 )
	{
		if(getd("$@sh_user_"+.@i) == getcharid(0)) { set $@SHwinner,getd("$@sh_user_"+.@i); }
	}
	return;
}

2@cata,1,1,1	script	SH_HILL_TIME	-1,{
end;

//30 seconds
OnTimer30001:
L_HillHere:
	set $@SH_temphill,rand(1,8);
		if($@SH_active_hill != $@SH_temphill) 
		{	
			set $@SH_active_hill,$@SH_temphill;
			mapannounce "2@cata","Hill Moved ~ [ "+$@SH_active_hill+" ].",bc_blue;
		} else { goto L_HillHere; }
		initnpctimer;
		end;
}

//====== Hills  =============================================================================
2@cata,79,66,1	script	Hill#1	723,3,3,{
end;

OnTouch:
	set .@hillname,strnpcinfo(2);
	if($@SH_active_hill != .@hillname || @souls < 2) { end; }
		for ( set .@i,0; .@i <= $sh_max_players; set .@i, .@i+1 )
		{
			if(getd("$@sh_user_"+.@i) == getcharid(0)) {
			if(@souls >= $sh_autowin_score) { callfunc "SH_AutoWin"; } //when scoring X Souls in a row Automatic Winner
			setd "$@SH_score"+.@i,getd("$@SH_score"+.@i)+@souls;
			mapannounce "2@cata","~ ("+shtag$+") "+strcharinfo(0)+" has SCORED ["+@souls+"] Souls (Total: "+getd("$@SH_score"+.@i)+") ~",bc_yellow;
			mapannounce "arena_room","~ ("+shtag$+") "+strcharinfo(0)+" has SCORED ["+@souls+"] Souls (Total: "+getd("$@SH_score"+.@i)+") ~",bc_yellow; 
			mapannounce "prt_are01","~ ("+shtag$+") "+strcharinfo(0)+" has SCORED ["+@souls+"] Souls (Total: "+getd("$@SH_score"+.@i)+") ~",bc_yellow; 
			mapannounce "force_1-1","~ ("+shtag$+") "+strcharinfo(0)+" has SCORED ["+@souls+"] Souls (Total: "+getd("$@SH_score"+.@i)+") ~",bc_yellow; 
			set @souls,1; specialeffect2 882; }
		}
	end;
	
OnTimer2501:
specialeffect 840,AREA,"Hill#"+$@SH_active_hill+"";	
initnpctimer;
end;

OnInit:
	initnpctimer;
	end;
}

2@cata,36,109,1	duplicate(Hill#1)	Hill#2	723,3,3
2@cata,123,109,1	duplicate(Hill#1)	Hill#3	723,3,3
2@cata,36,22,1	duplicate(Hill#1)	Hill#4	723,3,3
2@cata,123,22,1	duplicate(Hill#1)	Hill#5	723,3,3
2@cata,79,35,1	duplicate(Hill#1)	Hill#6	723,3,3
2@cata,80,98,1	duplicate(Hill#1)	Hill#7	723,3,3
2@cata,80,140,1	duplicate(Hill#1)	Hill#8	723,3,3

//====== ViewPoints Hills  =====================================================================
2@cata,79,65,1	script	ViewPoint_Hill#1	-1,8,8,{
end;

OnTouch:
OnTimer3001:
	viewpoint 2,79,66,1,0xFF0000; viewpoint 2,36,109,2,0xFF0000; viewpoint 2,123,109,3,0xFF0000;
	viewpoint 2,36,22,4,0xFF0000; viewpoint 2,123,22,5,0xFF0000; viewpoint 2,79,35,6,0xFF0000; 
	viewpoint 2,80,98,7,0xFF0000; viewpoint 2,80,140,8,0xFF0000;
	if($@SH_active_hill == 1) { viewpoint 1,79,66,1,0xFF0000; end; }
	if($@SH_active_hill == 2) { viewpoint 1,36,109,2,0xFF0000; end; }
	if($@SH_active_hill == 3) { viewpoint 1,123,109,3,0xFF0000; end; }
	if($@SH_active_hill == 4) { viewpoint 1,36,22,4,0xFF0000; end; }
	if($@SH_active_hill == 5) { viewpoint 1,123,22,5,0xFF0000; end; }
	if($@SH_active_hill == 6) { viewpoint 1,79,35,6,0xFF0000; end; }
	if($@SH_active_hill == 7) { viewpoint 1,80,98,7,0xFF0000; end; }
	if($@SH_active_hill == 8) { viewpoint 1,80,140,8,0xFF0000; end; }
	initnpctimer;
	end;
}

2@cata,80,97,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#2	-1,6,6
2@cata,80,134,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#3	-1,6,6
2@cata,123,107,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#4	-1,6,6
2@cata,34,109,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#5	-1,6,6
2@cata,109,67,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#6	-1,6,6
2@cata,49,66,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#7	-1,6,6
2@cata,37,22,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#8	-1,6,6
2@cata,80,37,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#9	-1,6,6
2@cata,122,23,1	duplicate(ViewPoint_Hill#1)	ViewPoint_Hill#10	-1,6,6

//TRAPS
2@cata,111,39,1	script	Trap#1	1904,1,1,{
end;
OnTouch:
	switch(rand(14)) { //20 Seconds tranps
		case 0: specialeffect2 587; sc_start SC_POISON,30000,0; 		message strcharinfo(0),"aww I don't feel good x.X !!"; 		emotion 23; end;
		case 1: specialeffect2 587; sc_start SC_SILENCE,15000,0;		message strcharinfo(0),"Silent i kill you !!";				emotion 23; end;
		case 2: specialeffect2 587; sc_start SC_CONFUSION,10000,0; 		message strcharinfo(0),"Where am I going ?_? !!"; 			emotion 23; end;
		case 3: specialeffect2 587; sc_start SC_SLEEP,10000,0; 			message strcharinfo(0),"ZzZzzzZZzzZZZ !!"; 					emotion 23; end;
		case 4: specialeffect2 587; sc_start SC_FREEZE,10000,0; 		message strcharinfo(0),"O.O !!"; 							emotion 23; end;
		case 5: specialeffect2 587; sc_start SC_STONE,10000,0; 			message strcharinfo(0),"Oh Potpot<3 !!"; 					emotion 23; end;
		case 6: specialeffect2 587; sc_start SC_BLIND,30000,0; 			message strcharinfo(0),"Waittt I cann't see !!"; 			emotion 23; end;
		case 7: specialeffect2 587; sc_start SC_BLEEDING,20000,0; 		message strcharinfo(0),"aaaarrrgSHSH !!"; 					emotion 23; end;
		case 8: specialeffect2 587; sc_start SC_STUN,8000,0; 			message strcharinfo(0),"Woot !!"; 							emotion 23; end;
		case 9: specialeffect2 587; sc_start SC_STRIPSHIELD,20000,0;	message strcharinfo(0),"Oh Nooes~!! byebyeShield  !!";	emotion 23; end;
		case 10: specialeffect2 587; sc_start SC_QUAGMIRE,20000,0; 		message strcharinfo(0),"Oh Nooes~!! Slowmo !!"; 			emotion 23; end;
		case 11: specialeffect2 587; sc_start SC_ANKLE,10000,0; 		message strcharinfo(0),"Oh Nooes~!! You got trapped !!"; 	emotion 23; end;
		case 12: specialeffect2 587; sc_start SC_CURSE,15000,0; 		message strcharinfo(0),"waSSH x.X !!"; 						emotion 23; end;
		case 13: specialeffect2 848; sc_start SC_BLESSING,30000,10; sc_start SC_INCREASEAGI,30000,10;
		message strcharinfo(0),"You avoided the trap successfully !!";
		emotion 21;
	}
end;

OnTimer30001:
specialeffect 145;
initnpctimer;
end;

OnInit:
	initnpctimer;
	end;
}

2@cata,113,118,1	duplicate(Trap#1)	Trap#2	1904,1,1
2@cata,48,90,1	duplicate(Trap#1)	Trap#3	1904,1,1
2@cata,78,113,1	duplicate(Trap#1)	Trap#4	1904,1,1
2@cata,113,94,1	duplicate(Trap#1)	Trap#5	1904,1,1
2@cata,85,57,1	duplicate(Trap#1)	Trap#6	1904,1,1

lhz_cube,10,74,3	script	SoulHunterPrize	818,2,2,{
OnTouch:
	sc_end SC_ALL;
	mes "[Winner Prize]";
	mes "Congratulations, you're the winner! Here's your prize ~ ";
	next;
	if(strcharinfo(0)!="") {
		mapannounce "arena_room", "And the winner of this Soul Hunter match is: "+strcharinfo(0)+" !!", 1;
		mapannounce "force_1-1", "And the winner of this Soul Hunter match is: "+strcharinfo(0)+" !!", 1;
		mapannounce "prt_are01", "And the winner of this Soul Hunter match is: "+strcharinfo(0)+" !!", 1;
		mapannounce "prontera", "And the winner of this Soul Hunter match is: "+strcharinfo(0)+" !!", 1;
		mapannounce "izlude", "And the winner of this Soul Hunter match is: "+strcharinfo(0)+" !!", 1;
	}
	getitem $sh_prize,$sh_prize_qty;
	set SHwins,SHwins+1;
	set @sh_rrep,rand(1,9);
	set Shrep,Shrep+@sh_rrep;
	dispbottom "You earned "+@sh_rrep+" Soul Hunter's Reputation, keep playing and you'll raise your Rank!!";
	dispbottom "Soul Hunters total REP: "+Shrep+".";
	percentheal 100,100;
	warp "arena_room",100,88;
	end;
}

function	script	repairarena	{

	if(getbrokenid(1)==NULL) {
		end;
	}
	while(getbrokenid(1)!=NULL){
		repair(1);
	}
	end;
}

2@cata,98,100,4	script	Repairman#sh1	86,{
	callfunc "repairarena";
	end;
}

2@cata,61,31,4	duplicate(Repairman#sh1)	Repairman#sh2	86
Edited by Yoona

9 answers to this question

Recommended Posts

Posted (edited)

In line 228 try changing this:

else { cutin "",255; close; }

to this:

else { cutin "",255; break; }

 

 

Thanks! Lil Troll ! and now i got a lot of error :( i guess i cant find a good Event for my server.. by the way thanks again for the response!

Edited by Yoona
Posted

Try reverting it back to close; hmmm, i dont see any improper use of close commands, gonna check the script now.

There has been an update regarding this : http://rathena.org/board/topic/81860-r17280-slight-script-engine-update/

 

@Yoona

Try changing close to end

 

Thanks! but more error's still popping :) haha

 

 

I see the problem now,

in soul hunter NPC change all break; to end;

 

answered by sir patskie. :)

 

thanks to you too :)

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