Jump to content
  • 0

[Warning] Incorrect use of close command


kyleanthonydizon

Question


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  100
  • Reputation:   0
  • Joined:  10/22/16
  • Last Seen:  

//  _______   __      ____      ____         __    __  ____    __  __    __   __ __      __   __  ____    _      ____      
// /__  __/  / /     / __ \      / __ \    / / / / /__  \  / / /_/ __/ /_ / // /     / /__/ / /__  \  / /__  / __ \  _____
//   / /    / /_    / /_/ /     / / / /   / / / / ____/ / / / __  /_  __// // /     / _  _ / ____/ / / // / / /_/ / / __  \
//  / /    / __ \  / ____/     / / / /   / / / / / __  / / / / /   / /   \_  /     / // /// / __  / /  __/ / ____/ / /  /_/
// / /    / / / / / /__          / /_/ /_  / /_/ / / /_/ / / / / /   / /   __/ /     / // /// / /_/ / / _ \  / /__      / /
///_/    /_/ /_/  \____/      \_______/ \____/  \____/ /_/ /_/   /_/    \__/     /_//_///  \____/ /_/ \_\ \____/ /_/
//=============================================================================
//
//   Gold Room Advance Script - Mining Gold for wealth - Please Leave Credit   \\
//=============================================================================
//POWERED by: rudolp
//[The Quality Maker]
//Time Finished :6:28 PM 6/7/2009
//Please Report any bug and suggestions.
//===== Compatible With: =================================================================
//= Any eAthena Version
//=============Gold Room Settings===================
//This should always be enable for a better Gold Room System.
//==================================================
ordeal_1-2.gat    mapflag    noskill
ordeal_1-2.gat    mapflag    nomemo
ordeal_1-2.gat    mapflag    nobranch
ordeal_1-2.gat    mapflag    noloot
ordeal_1-2.gat    mapflag    noexp
ordeal_1-2.gat    mapflag    nodrop
ordeal_1-2.gat    mapflag    novending
ordeal_1-2.gat    mapflag    nowarp
ordeal_1-2.gat    mapflag    nowarpto
ordeal_1-2.gat    mapflag    noreturn
//=================================================

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

OnInit:
//No. of Mine Guardian.
//For golden peko it is default to 100 and 4 seconds~2 seconds spawn rate.
set .guardian,50;

//Type of guardian. 0 = normal 1 = extreme
set .@guardiantype,0;

if(.@guardiantype == 0){
    monster "ordeal_1-2",0,0,"Taga Bantay",2001,.guardian,"";

}else{
    monster "ordeal_1-2",0,0,"Taga Bantay",2002,.guardian,"";
}
end;
OnNPCKillEvent:
//===== Configurations: ========================================================================

//Max gold can a player get after killing 1 golden peko (default 5 note:this will increase if luk bonus is enable).
set .@maxgaingold,5;

//Apply gold penalty. 0 = no 1 = yes
set .@penalty1,0;

//The Maximum no. of gold Penalty.
set .@maxpenalty1,3;

//Apply speed & HP penalty. 0 = no 1 = yes
set .@penalty2,1;

//Gold limitation penalty must be enable
set .@maxgold,200;

//The maximum no. of hp penalty by %.
set .@maxpenalty2,10;

//Enable luk bonus. 0=no 1=yes
set .@lukbonus,0;

//If luk Bonus is enable,luk divider default 49 w/ 99 max parameter. Note: the quotient of your max parameter and .@lukdiv must not grater than 5 to avoid over mining.
set .@lukdiv,49;

//Show Server Name. 0=no 1=yes
set .@showservername,1;

//Name of your Server
set .@servername$,"[ Peculiar RO ]";

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


if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
if (@mapname$ == "ordeal_1-2"){
set @bonus,0;
set @deduction,0;
set @gain,rand (.@maxgaingold);

//Luk bonus
if (.@lukbonus != 0){
    set @bonus,readparam(bLuk)/.@lukdiv;
}

//Gold Penalty
if (.@penalty1 != 0){
    set @deduction,rand(.@maxpenalty1);
    if(@deduction == 0) set @deduction,1;    
}

set @gain, @gain + @bonus - @deduction;
set gold, gold + @gain ;

//Displaying Gained Gold
if(.@showservername != 0){
    if(gold%5 == 0){ //Show Server Name every 10 gold gain.
        dispbottom "===============Brought to you by===============";
        dispbottom "==============" + .@servername$ +"==============";
    }
}

if(@gain){
     dispbottom "You got: " +@gain+ " gold | Total: " +gold+ " gold";

}else{
    dispbottom "You got: NOTHING!";
}

if (.@penalty2 != 0){
    if (gold >= .@maxgold/2 && gold <=.@maxgold/2+20){
         sc_start    SC_DECREASEAGI,240000,10;        
    }else if(gold >.@maxgold){
        sc_start    SC_CURSE,240000,10;
         percentheal (.@maxpenalty2*-1),(.@maxpenalty2*-1);
         heal -50,0; //For him to die
    }
}

if(paid == 0){
    mapannounce "ordeal_1-2"," x( "+strcharinfo(0)+" is a cheater!",bc_map;
    dispbottom "Go out you bastard!";
    set gold,0;
    warp "prontera", 173, 160;
}
    end;
}


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;
    end;
}

L_Finish:
close;
}

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

prontera,164,166,3    script    Gold Room Warper#pront    813,{
set @name$,"prontera";
callfunc "goldmain";
OnInit:
    waitingroom "Gold Room Warper",0;
    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 (getgmlevel() >= 90){
    mes "[Gold Room Warper]";
if(sex != 0){
    mes "Hello Sir what can I do for you?";
}else{
    mes "Hello Maam what can I do for you?";
}

next;
menu "Enter Mining Site",start,"Please close the mine site. Now!",-,"Please open the mine site. Now!",G_open,"Nothing",C_s;
next;
mes "[Gold Room Warperer]";
mapannounce "ordeal_1-2","Excuse me Miners.",bc_map;
mes "Ok.";
next;
mapannounce "ordeal_1-2",strcharinfo(0) +" wants to close the Gold Room for a while",bc_map;
mes "Just a second I will just ask them to";
mes "go out in the mining site";
next;
mapannounce "ordeal_1-2","Please settle your things and move quietly",bc_map;
mes "[Gold Room Warper]";
mes ".............";
mes "........";
next;
mes "[Gold Room Warperer]";
mes "Ok your done";
set .opengoldroom,1;
areawarp "ordeal_1-2",21,286,286,22,"prontera", 173, 160;
close;
}

if(.opengoldroom == 0){
    goto start;
}else{
    mes "[Gold Room Warperer]";
    mes "Sorry!";
    mes "The Mining Site is closed.";
    close;
}
G_open:
mes "[Gold Room Warperer]";
mes "Ok.";
mes "Mining Site is Already Available.";
announce " Gold Room is open for public!",bc_map;
set .opengoldroom,0;
close;

start:
if ( alive == 0){
    set gold,0;
}
mes "[Gold Room Warperer]";
mes "What do you want?";
next;
menu "To the Gold Room",-,"Exchange Gold",exchange,"Nothing",C_s;
mes "[Gold Room Warperer]";
mes "Hmm..";
mes "It cost 100,000z";
    mes "Would you like to go now to the gold room?";
    if(select("Yes", "No") == 1) {
    if(@name$ == "prontera") savepoint "prontera", 173, 160;
    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;
    if (Zeny < 100000) goto nomoney;
    set Zeny, Zeny - 100000;
    set alive, 1;
    set paid, 1;
            warp "ordeal_1-2", 156, 155;

    }
    close;
nomoney:
mes "[Gold Room Warper]";
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 Warper]";
mes "Sorry your overweight";
close;
nogold:
close;
C_s:
close;
}


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

//===========================================================
//========================================
//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,202,129,0    warp    ord509    1,1,prontera,173,160
ordeal_1-2,105,154,0    warp    ord510    1,1,prontera,173,160

//============Spawns=================

//ordeal_1-2,0,0,0,0    monster    GM Luki    2001,100,40000,20000,0
//ordeal_1-2,0,0,0,0    monster    GM Zhen    2000,100,40000,20000,0
ordeal_1-2,0,0,0,0    monster    Golden Pecopeco    1369,100,40000,20000,0

Hi guys, I get [warning] invalid use of close command. Please help! :(

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

when you dont use any statements you must use end; instead of close; so Change all your close statements to end; 

 

click here for more details

 

Edited by Cyro
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  61
  • Topics Per Day:  0.02
  • Content Count:  912
  • Reputation:   166
  • Joined:  11/27/14
  • Last Seen:  

Can you provide us map-server.bat Error so we can see the error better ^_^

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  308
  • Reputation:   24
  • Joined:  11/26/12
  • Last Seen:  

2 hours ago, kyleanthonydizon said:

Hi guys, I get [warning] invalid use of close command. Please help! :(

//  _______   __      ____      ____         __    __  ____    __  __    __   __ __      __   __  ____    _      ____      
// /__  __/  / /     / __ \      / __ \    / / / / /__  \  / / /_/ __/ /_ / // /     / /__/ / /__  \  / /__  / __ \  _____
//   / /    / /_    / /_/ /     / / / /   / / / / ____/ / / / __  /_  __// // /     / _  _ / ____/ / / // / / /_/ / / __  \
//  / /    / __ \  / ____/     / / / /   / / / / / __  / / / / /   / /   \_  /     / // /// / __  / /  __/ / ____/ / /  /_/
// / /    / / / / / /__          / /_/ /_  / /_/ / / /_/ / / / / /   / /   __/ /     / // /// / /_/ / / _ \  / /__      / /
///_/    /_/ /_/  \____/      \_______/ \____/  \____/ /_/ /_/   /_/    \__/     /_//_///  \____/ /_/ \_\ \____/ /_/
//=============================================================================
//
//   Gold Room Advance Script - Mining Gold for wealth - Please Leave Credit   \\
//=============================================================================
//POWERED by: rudolp
//[The Quality Maker]
//Time Finished :6:28 PM 6/7/2009
//Please Report any bug and suggestions.
//===== Compatible With: =================================================================
//= Any eAthena Version
//=============Gold Room Settings===================
//This should always be enable for a better Gold Room System.
//==================================================
ordeal_1-2.gat    mapflag    noskill
ordeal_1-2.gat    mapflag    nomemo
ordeal_1-2.gat    mapflag    nobranch
ordeal_1-2.gat    mapflag    noloot
ordeal_1-2.gat    mapflag    noexp
ordeal_1-2.gat    mapflag    nodrop
ordeal_1-2.gat    mapflag    novending
ordeal_1-2.gat    mapflag    nowarp
ordeal_1-2.gat    mapflag    nowarpto
ordeal_1-2.gat    mapflag    noreturn
//=================================================

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

OnInit:
//No. of Mine Guardian.
//For golden peko it is default to 100 and 4 seconds~2 seconds spawn rate.
set .guardian,50;

//Type of guardian. 0 = normal 1 = extreme
set .@guardiantype,0;

if(.@guardiantype == 0){
    monster "ordeal_1-2",0,0,"Taga Bantay",2001,.guardian,"";

}else{
    monster "ordeal_1-2",0,0,"Taga Bantay",2002,.guardian,"";
}
end;
OnNPCKillEvent:
//===== Configurations: ========================================================================

//Max gold can a player get after killing 1 golden peko (default 5 note:this will increase if luk bonus is enable).
set .@maxgaingold,5;

//Apply gold penalty. 0 = no 1 = yes
set .@penalty1,0;

//The Maximum no. of gold Penalty.
set .@maxpenalty1,3;

//Apply speed & HP penalty. 0 = no 1 = yes
set .@penalty2,1;

//Gold limitation penalty must be enable
set .@maxgold,200;

//The maximum no. of hp penalty by %.
set .@maxpenalty2,10;

//Enable luk bonus. 0=no 1=yes
set .@lukbonus,0;

//If luk Bonus is enable,luk divider default 49 w/ 99 max parameter. Note: the quotient of your max parameter and .@lukdiv must not grater than 5 to avoid over mining.
set .@lukdiv,49;

//Show Server Name. 0=no 1=yes
set .@showservername,1;

//Name of your Server
set .@servername$,"[ Peculiar RO ]";

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


if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
if (@mapname$ == "ordeal_1-2"){
set @bonus,0;
set @deduction,0;
set @gain,rand (.@maxgaingold);

//Luk bonus
if (.@lukbonus != 0){
    set @bonus,readparam(bLuk)/.@lukdiv;
}

//Gold Penalty
if (.@penalty1 != 0){
    set @deduction,rand(.@maxpenalty1);
    if(@deduction == 0) set @deduction,1;    
}

set @gain, @gain + @bonus - @deduction;
set gold, gold + @gain ;

//Displaying Gained Gold
if(.@showservername != 0){
    if(gold%5 == 0){ //Show Server Name every 10 gold gain.
        dispbottom "===============Brought to you by===============";
        dispbottom "==============" + .@servername$ +"==============";
    }
}

if(@gain){
     dispbottom "You got: " +@gain+ " gold | Total: " +gold+ " gold";

}else{
    dispbottom "You got: NOTHING!";
}

if (.@penalty2 != 0){
    if (gold >= .@maxgold/2 && gold <=.@maxgold/2+20){
         sc_start    SC_DECREASEAGI,240000,10;        
    }else if(gold >.@maxgold){
        sc_start    SC_CURSE,240000,10;
         percentheal (.@maxpenalty2*-1),(.@maxpenalty2*-1);
         heal -50,0; //For him to die
    }
}

if(paid == 0){
    mapannounce "ordeal_1-2"," x( "+strcharinfo(0)+" is a cheater!",bc_map;
    dispbottom "Go out you bastard!";
    set gold,0;
    warp "prontera", 173, 160;
}
    end;
}


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;
    end;
}

L_Finish:
end;
}

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

prontera,164,166,3    script    Gold Room Warper#pront    813,{
set @name$,"prontera";
callfunc "goldmain";
OnInit:
    waitingroom "Gold Room Warper",0;
    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 (getgmlevel() >= 90){
    mes "[Gold Room Warper]";
if(sex != 0){
    mes "Hello Sir what can I do for you?";
}else{
    mes "Hello Maam what can I do for you?";
}

next;
menu "Enter Mining Site",start,"Please close the mine site. Now!",-,"Please open the mine site. Now!",G_open,"Nothing",C_s;
next;
mes "[Gold Room Warperer]";
mapannounce "ordeal_1-2","Excuse me Miners.",bc_map;
mes "Ok.";
next;
mapannounce "ordeal_1-2",strcharinfo(0) +" wants to close the Gold Room for a while",bc_map;
mes "Just a second I will just ask them to";
mes "go out in the mining site";
next;
mapannounce "ordeal_1-2","Please settle your things and move quietly",bc_map;
mes "[Gold Room Warper]";
mes ".............";
mes "........";
next;
mes "[Gold Room Warperer]";
mes "Ok your done";
set .opengoldroom,1;
areawarp "ordeal_1-2",21,286,286,22,"prontera", 173, 160;
end;
}

if(.opengoldroom == 0){
    goto start;
}else{
    mes "[Gold Room Warperer]";
    mes "Sorry!";
    mes "The Mining Site is closed.";
    close;
}
G_open:
mes "[Gold Room Warperer]";
mes "Ok.";
mes "Mining Site is Already Available.";
announce " Gold Room is open for public!",bc_map;
set .opengoldroom,0;
close;

start:
if ( alive == 0){
    set gold,0;
}
mes "[Gold Room Warperer]";
mes "What do you want?";
next;
menu "To the Gold Room",-,"Exchange Gold",exchange,"Nothing",C_s;
mes "[Gold Room Warperer]";
mes "Hmm..";
mes "It cost 100,000z";
    mes "Would you like to go now to the gold room?";
    if(select("Yes", "No") == 1) {
    if(@name$ == "prontera") savepoint "prontera", 173, 160;
    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;
    if (Zeny < 100000) goto nomoney;
    set Zeny, Zeny - 100000;
    set alive, 1;
    set paid, 1;
            warp "ordeal_1-2", 156, 155;
			end;
    }
    close;
nomoney:
mes "[Gold Room Warper]";
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 Warper]";
mes "Sorry your overweight";
close;
nogold:
close;
C_s:
close;
}


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

//===========================================================
//========================================
//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,202,129,0    warp    ord509    1,1,prontera,173,160
ordeal_1-2,105,154,0    warp    ord510    1,1,prontera,173,160

//============Spawns=================

//ordeal_1-2,0,0,0,0    monster    GM Luki    2001,100,40000,20000,0
//ordeal_1-2,0,0,0,0    monster    GM Zhen    2000,100,40000,20000,0
ordeal_1-2,0,0,0,0    monster    Golden Pecopeco    1369,100,40000,20000,0

there you go updated ;)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  100
  • Reputation:   0
  • Joined:  10/22/16
  • Last Seen:  

6 hours ago, chatterboy said:

//  _______   __      ____      ____         __    __  ____    __  __    __   __ __      __   __  ____    _      ____      
// /__  __/  / /     / __ \      / __ \    / / / / /__  \  / / /_/ __/ /_ / // /     / /__/ / /__  \  / /__  / __ \  _____
//   / /    / /_    / /_/ /     / / / /   / / / / ____/ / / / __  /_  __// // /     / _  _ / ____/ / / // / / /_/ / / __  \
//  / /    / __ \  / ____/     / / / /   / / / / / __  / / / / /   / /   \_  /     / // /// / __  / /  __/ / ____/ / /  /_/
// / /    / / / / / /__          / /_/ /_  / /_/ / / /_/ / / / / /   / /   __/ /     / // /// / /_/ / / _ \  / /__      / /
///_/    /_/ /_/  \____/      \_______/ \____/  \____/ /_/ /_/   /_/    \__/     /_//_///  \____/ /_/ \_\ \____/ /_/
//=============================================================================
//
//   Gold Room Advance Script - Mining Gold for wealth - Please Leave Credit   \\
//=============================================================================
//POWERED by: rudolp
//[The Quality Maker]
//Time Finished :6:28 PM 6/7/2009
//Please Report any bug and suggestions.
//===== Compatible With: =================================================================
//= Any eAthena Version
//=============Gold Room Settings===================
//This should always be enable for a better Gold Room System.
//==================================================
ordeal_1-2.gat    mapflag    noskill
ordeal_1-2.gat    mapflag    nomemo
ordeal_1-2.gat    mapflag    nobranch
ordeal_1-2.gat    mapflag    noloot
ordeal_1-2.gat    mapflag    noexp
ordeal_1-2.gat    mapflag    nodrop
ordeal_1-2.gat    mapflag    novending
ordeal_1-2.gat    mapflag    nowarp
ordeal_1-2.gat    mapflag    nowarpto
ordeal_1-2.gat    mapflag    noreturn
//=================================================

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

OnInit:
//No. of Mine Guardian.
//For golden peko it is default to 100 and 4 seconds~2 seconds spawn rate.
set .guardian,50;

//Type of guardian. 0 = normal 1 = extreme
set .@guardiantype,0;

if(.@guardiantype == 0){
    monster "ordeal_1-2",0,0,"Taga Bantay",2001,.guardian,"";

}else{
    monster "ordeal_1-2",0,0,"Taga Bantay",2002,.guardian,"";
}
end;
OnNPCKillEvent:
//===== Configurations: ========================================================================

//Max gold can a player get after killing 1 golden peko (default 5 note:this will increase if luk bonus is enable).
set .@maxgaingold,5;

//Apply gold penalty. 0 = no 1 = yes
set .@penalty1,0;

//The Maximum no. of gold Penalty.
set .@maxpenalty1,3;

//Apply speed & HP penalty. 0 = no 1 = yes
set .@penalty2,1;

//Gold limitation penalty must be enable
set .@maxgold,200;

//The maximum no. of hp penalty by %.
set .@maxpenalty2,10;

//Enable luk bonus. 0=no 1=yes
set .@lukbonus,0;

//If luk Bonus is enable,luk divider default 49 w/ 99 max parameter. Note: the quotient of your max parameter and .@lukdiv must not grater than 5 to avoid over mining.
set .@lukdiv,49;

//Show Server Name. 0=no 1=yes
set .@showservername,1;

//Name of your Server
set .@servername$,"[ Peculiar RO ]";

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


if (getmapxy(@mapname$,@mapx,@mapy,0) == -1) goto L_Finish;
if (@mapname$ == "ordeal_1-2"){
set @bonus,0;
set @deduction,0;
set @gain,rand (.@maxgaingold);

//Luk bonus
if (.@lukbonus != 0){
    set @bonus,readparam(bLuk)/.@lukdiv;
}

//Gold Penalty
if (.@penalty1 != 0){
    set @deduction,rand(.@maxpenalty1);
    if(@deduction == 0) set @deduction,1;    
}

set @gain, @gain + @bonus - @deduction;
set gold, gold + @gain ;

//Displaying Gained Gold
if(.@showservername != 0){
    if(gold%5 == 0){ //Show Server Name every 10 gold gain.
        dispbottom "===============Brought to you by===============";
        dispbottom "==============" + .@servername$ +"==============";
    }
}

if(@gain){
     dispbottom "You got: " +@gain+ " gold | Total: " +gold+ " gold";

}else{
    dispbottom "You got: NOTHING!";
}

if (.@penalty2 != 0){
    if (gold >= .@maxgold/2 && gold <=.@maxgold/2+20){
         sc_start    SC_DECREASEAGI,240000,10;        
    }else if(gold >.@maxgold){
        sc_start    SC_CURSE,240000,10;
         percentheal (.@maxpenalty2*-1),(.@maxpenalty2*-1);
         heal -50,0; //For him to die
    }
}

if(paid == 0){
    mapannounce "ordeal_1-2"," x( "+strcharinfo(0)+" is a cheater!",bc_map;
    dispbottom "Go out you bastard!";
    set gold,0;
    warp "prontera", 173, 160;
}
    end;
}


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;
    end;
}

L_Finish:
end;
}

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

prontera,164,166,3    script    Gold Room Warper#pront    813,{
set @name$,"prontera";
callfunc "goldmain";
OnInit:
    waitingroom "Gold Room Warper",0;
    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 (getgmlevel() >= 90){
    mes "[Gold Room Warper]";
if(sex != 0){
    mes "Hello Sir what can I do for you?";
}else{
    mes "Hello Maam what can I do for you?";
}

next;
menu "Enter Mining Site",start,"Please close the mine site. Now!",-,"Please open the mine site. Now!",G_open,"Nothing",C_s;
next;
mes "[Gold Room Warperer]";
mapannounce "ordeal_1-2","Excuse me Miners.",bc_map;
mes "Ok.";
next;
mapannounce "ordeal_1-2",strcharinfo(0) +" wants to close the Gold Room for a while",bc_map;
mes "Just a second I will just ask them to";
mes "go out in the mining site";
next;
mapannounce "ordeal_1-2","Please settle your things and move quietly",bc_map;
mes "[Gold Room Warper]";
mes ".............";
mes "........";
next;
mes "[Gold Room Warperer]";
mes "Ok your done";
set .opengoldroom,1;
areawarp "ordeal_1-2",21,286,286,22,"prontera", 173, 160;
end;
}

if(.opengoldroom == 0){
    goto start;
}else{
    mes "[Gold Room Warperer]";
    mes "Sorry!";
    mes "The Mining Site is closed.";
    close;
}
G_open:
mes "[Gold Room Warperer]";
mes "Ok.";
mes "Mining Site is Already Available.";
announce " Gold Room is open for public!",bc_map;
set .opengoldroom,0;
close;

start:
if ( alive == 0){
    set gold,0;
}
mes "[Gold Room Warperer]";
mes "What do you want?";
next;
menu "To the Gold Room",-,"Exchange Gold",exchange,"Nothing",C_s;
mes "[Gold Room Warperer]";
mes "Hmm..";
mes "It cost 100,000z";
    mes "Would you like to go now to the gold room?";
    if(select("Yes", "No") == 1) {
    if(@name$ == "prontera") savepoint "prontera", 173, 160;
    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;
    if (Zeny < 100000) goto nomoney;
    set Zeny, Zeny - 100000;
    set alive, 1;
    set paid, 1;
            warp "ordeal_1-2", 156, 155;
			end;
    }
    close;
nomoney:
mes "[Gold Room Warper]";
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 Warper]";
mes "Sorry your overweight";
close;
nogold:
close;
C_s:
close;
}


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

//===========================================================
//========================================
//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,202,129,0    warp    ord509    1,1,prontera,173,160
ordeal_1-2,105,154,0    warp    ord510    1,1,prontera,173,160

//============Spawns=================

//ordeal_1-2,0,0,0,0    monster    GM Luki    2001,100,40000,20000,0
//ordeal_1-2,0,0,0,0    monster    GM Zhen    2000,100,40000,20000,0
ordeal_1-2,0,0,0,0    monster    Golden Pecopeco    1369,100,40000,20000,0

there you go updated ;)

THANK YOU!

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