Jump to content
  • 0

Incorrect use of 'close' command - Gold Room


Qura

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   3
  • Joined:  03/18/16
  • Last Seen:  

Hi rAthena'ian,

 

I have an issue here, I did some searching regarding Incorrect use of 'close' command. Such:

 

1. https://rathena.org/board/topic/84807-how-to-fix-this-2-errors/

2. https://rathena.org/board/topic/87264-warper-healer-got-problem/

3. https://rathena.org/board/tracker/issue-7592-warning-incorrect-use-of-close-command/

4. https://rathena.org/board/topic/87264-warper-healer-got-problem/

 

But, none from Gold Room. I believe this gold room script among the unique one, because who enter that gold room, are being notified about how much Gold they got.

 

Even I used several lots of script regarding Gold Room.txt, and most of them, encountering this "close" command.

 

My sample GoldRoom.txt:


ordeal_1-2.gat	mapflag	nomemo
ordeal_1-2.gat	mapflag	nobranch
ordeal_1-2.gat	mapflag	noexp
ordeal_1-2.gat	mapflag	nodrop
ordeal_1-2.gat	mapflag	nochat
ordeal_1-2.gat	mapflag	novending
ordeal_1-2.gat	mapflag	nowarpto
ordeal_1-2.gat	mapflag	noreturn
ordeal_1-2.gat	mapflag	nosave
//==================================================
//Optional
//==================================================
//ordeal_1-2.gat	mapflag	noloot 
//disable so that after logging in your still in the Gold Room..
//ordeal_1-2.gat	mapflag	nosave	SavePoint

ordeal_1-2,0,0,0	script	Gold Room	-1,{

OnPCDieEvent: 

if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
if (@mapname$ == "ordeal_1-2"){
		dispbottom "Holy Shit you died!";
		dispbottom "All of your gold will gone!";
		set alive, 0;
		set paid, 0;
		set @gold,0;
		end;
}

L_Finish:
close;

OnNPCKillEvent:
if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
if (@mapname$ == "ordeal_1-2"){
	
	set @gold,@gold+1;
		
	dispbottom "-|You got: 1 gold| - |Total: " +@gold+ " gold|-";
	getitem 969,1;
	
	if (gold >= 115 && gold <= 149){
		 sc_start	33,240000,10;
	}else if (gold >= 150 && gold <= 199){
		 sc_start	5,240000,10;
	}else if(gold > 200){
		 percentheal -30,0;
		 heal -50,0;
	}
	if(paid == 0){
		mapannounce "ordeal_1-2"," :"+strcharinfo(0)+" is a cheater!",bc_map;
		dispbottom "Go out you bastard!";
		warp "prontera", 173, 160;
	}
		end;
L_HolyShit:
		dispbottom "Warning! you may die if you exceed.";
		misceffect 368;
		end;

	end;
}

}

//===============================================
//warper
//===============================================
ordeal_1-2,154,156,5	script	Gold Miner	813,{
	mes "[Gold Miner]";
	mes "Want to go now?";
	mes "Your gold is just "+@gold+" you can still get more.";
	next;
	goto wa;
	close2;
	end;
wa:
	mes "Want to go now?";
	 if(select("Yes", "No") == 1) {
		set alive,1;
		set @gold,0;
        		warp "prontera", 170, 155;
    	}
	close;
}

 prontera,164,167,3	script	Gold Room Warperer#pront	813,{
	set @name$,"prontera";
	callfunc "goldmain";
	end;
}

aldebaran,133,116,4	script	Gold Room Warperer#alde	813,{
	set @name$,"aldebaran";
	callfunc "goldmain";
	end;
}

alberta,23,247,4	script	Gold Room Warperer#alb	813,{
	set @name$,"alberta";
	callfunc "goldmain";
	end;
}
payon,151,182,4	script	Gold Room Warperer#pay	813,{
	set @name$,"payon";
	callfunc "goldmain";
	end;
}

geffen,115,74,4	script	Gold Room Warperer#gef	813,{
	set @name$,"geffen";
	callfunc "goldmain";
	end;
}


function	script	goldmain	{
	if ( alive == 0){
		set @gold,0;
	}
	cutin "fey_fun",2;
	mes "[Gold Room Warperer]";
	mes "What do you want?";
	next;
	menu "To the Gold Room("+getmapusers("ordeal_1-2")+")",-,"Nothing",C_s;
	mes "[Gold Room Warperer]";
	mes "Hmm..";
    	mes "Would you like to go now to the gold room?";
    	if(select("Yes", "No") == 1) {
		if(@name$ == "prontera") savepoint "prontera",160,180;
		if(@name$ == "aldebaran") savepoint "aldebaran",166, 163;
		if(@name$ == "alberta") savepoint "alberta",16, 246;
		if(@name$ == "payon") savepoint "payon",160, 179;
		if(@name$ == "geffen") savepoint "geffen",124, 85;
		set alive, 1;
		set paid, 1;
		set @gold,0;
        		warp "ordeal_1-2", 156, 155;
		
    	}
    	close;
nomoney:
	mes "[Gold Room Warperer]";
	mes "Sorry insufficient balance";
	close;
exchange:
	mes "[Gold Room Warperer]";
	mes "Hmm...let me see";
	mes "You have " +@gold+ ".";
	if (gold == 0) goto nogold; 
	mes "Ok get this.";
	next;
        if (checkweight(969,gold) == 0) goto L_OverWeight;
	getitem 969, gold;
	set gold, 0;
	emotion e_gg;
	close;
L_OverWeight:
	mes "[Gold Room Warperer]";
	mes "Sorry your overweight";
	close;
nogold:
	close;
C_s:
	close2;
	cutin "",255;
	end;
}




//========================================
//warps you may edit this one for your convenience
//========================================
ordeal_1-2,73,265,0	warp	ord500	1,1,prontera,173,160
ordeal_1-2,129,194,0	warp	ord501	1,1,prontera,173,160
ordeal_1-2,130,194,0	warp	ord502	1,1,prontera,173,160
ordeal_1-2,178,193,0	warp	ord503	1,1,prontera,173,160
ordeal_1-2,290,130,0	warp	ord504	1,1,prontera,173,160
ordeal_1-2,241,281,0	warp	ord505	1,1,prontera,173,160
ordeal_1-2,66,25,0 	warp	ord506	1,1,prontera,173,160
ordeal_1-2,290,229,0	warp	ord507	1,1,prontera,173,160
ordeal_1-2,179,94,0	warp	ord5s08	1,1,prontera,173,160
//======================================
//mobs you may edit this as you want but don't change the mobs
//=====================================

ordeal_1-2,0,0,0,0	monster	Hunt For Gold	1078,800,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,100,40000,20000,0

/*
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,10,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,10,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0

ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,10,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,10,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0

ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,10,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,10,40000,20000,0
ordeal_1-2,0,0,0,0	monster	Hunt For Gold	2074,20,40000,20000,0
*/
//======================================

ordeal_1-2	mapflag	noskill
ordeal_1-2	mapflag	noteleport
ordeal_1-2	mapflag	novending
ordeal_1-2	mapflag	noicewall
ordeal_1-2	mapflag	nopenalty
ordeal_1-2	mapflag	nobranch
ordeal_1-2	mapflag	noexp

My issue is, this Incorrect use of 'close' command appeared when a char died outside that "GOLD ROOM" (eg: town, field, dungeon, etc). Or/And, my assumption is, they use @warp or @go command to get out from Gold Room and got killed somewhere (outside Gold Room).

 

post-37962-0-60929100-1461709857_thumb.jpg

 

Hence, I'm not a good scripter to realize which close command that causes this error. And I believe most of us who uses any Gold Room (from download section) in their RO, could encounter this error.

 

Thus, can anyone help us to resolve this issue?

Your supports are much appreciated.  :meow:

post-37962-0-60929100-1461709857_thumb.jpg

Edited by Qura
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  40
  • Reputation:   4
  • Joined:  01/13/13
  • Last Seen:  

OnNPCKillEvent:
if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;


​L_Finish:
close;

change to end; instead close;

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  21
  • Reputation:   3
  • Joined:  03/18/16
  • Last Seen:  

 

OnNPCKillEvent:
if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;


​L_Finish:
close;

change to end; instead close;

 

 

Thank you Juanfu! It's worked! Hehe, I never thought that it would be that line.

Thank you so much!  :meow:

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