Jump to content
  • 0

[SOLVED]input script problem(GOLD ROOM)


jadedlight

Question


  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

would like to ask about this one since im getting confused on how to make this work..

hope someone can enlighten me..

Quote

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;
    input .@gain;
    if (.@gain == 0) close;
    getitem 969,.@gain*0;
//    getitem 969, gold;
//    set gold, 0;
    emotion e_gg;
    end;

my problem is.. i dont know what to put on the code to give out the gold and minus that gold to the total gold you have..

hope someone can help me out.. thank you..

Edited by jadedlight
Link to comment
Share on other sites

11 answers to this question

Recommended Posts

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

can you explain how you want your script to work ?

what is (gold) ? i see it here it's var (it's not item it's variable)

and why the *0 in (.@gain*0)

if you can let us see the full script it would be better

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

41 minutes ago, jadedlight said:

would like to ask about this one since im getting confused on how to make this work..

hope someone can enlighten me..

my problem is.. i dont know what to put on the code to give out the gold and minus that gold to the total gold you have..

hope someone can help me out.. thank you..

add more information i cant point out what you need exactly :))

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

Quote

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,"Guard Pacific",1369,.guardian,"";    
    }else{
        monster "ordeal_1-2",0,0,"Guard Pacific",1369,.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,0;

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

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

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

//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$,"[SweetKiss]";

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


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){
             percentheal (.@maxpenalty2*-1),(.@maxpenalty2*-1);
             heal 0,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 be 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.";
    end;
wa:
    mes "Want to go now?";
     if(select("Yes", "No") == 1) {
        set alive,1;
                warp "prontera", 156, 188;
        }
    end;
}

prontera,132,168,4    script    Gold Room#pront    556,{
    set @name$,"prontera";
    callfunc "goldmain";
}

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

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

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

function    script    goldmain    {
    if (getgmlevel() >= 90){
        mes "[Gold Room Warperer]";
    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 end 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 end 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 quitely",bc_map;
    mes "[Gold Room Warperer]";
    mes ".............";
    mes "........";
    next;
    mes "[Gold Room Warperer]";
    mes "Ok your done";
    set .opengoldroom,1;
    areawarp "ordeal_1-2",21,286,286,22,"prontera", 156, 105;
OnInit:
    waitingroom "Hunting Gold Room",0;
    end;
    }

    if(.opengoldroom == 0){
        goto start;
    }else{
        mes "[Gold Room Warperer]";
        mes "Sorry!";
        mes "The Mining Site is endd.";
        end;
    }
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;
end;

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;
nomoney:
    mes "[Gold Room Warperer]";
    mes "Sorry insufficient balance";
    end;
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;
    input .@gain;
    if (.@gain == 0) close;
    getitem 969,.+gold+*0;
//    getitem 969, gold;
//    set gold, 0;
    emotion e_gg;
    end;
L_OverWeight:
    mes "[Gold Room Warperer]";
    mes "Sorry your overweight";
    end;
nogold:
    end;
C_s:
    end;
}
 

that's the script.. i wanted to have like a input command for how many gold you want to get out.. since the max number of gold on my server can only stack 30k pcs.. for example i have 30k gold and i want to get like only 20k then i will have a left over gold of 10k..

Edited by jadedlight
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

so you want from the npc to turn gold(the variable) to gold(the item) ?

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

i just wanted to get the gold using the input command on the amount you have..

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

getitem 969,.@gain; >>> this would give the player the amount he typed as item 

but you will need to check if the player have the variable gold or not

so it's like that

input .@gain;
    if (.@gain > gold){                                   // check if the player have the amount he want
    mes "you don't have that much";
    close;
    }else{
    getitem 969,.@gain;                                //give the player the item gold (the same amount as the input)
    gold = gold -.@gain;                                //take from the player the variable gold the same amount as the item gold
    }

Edited by sader1992
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

will try it out.. i get confused on the codes lol.. 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

working.. thank you

 

NOTE: remove 
     if (checkweight(969,gold) == 0) goto L_OverWeight;

or you will not get the gold with 30k++ pcs..

Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  55
  • Topics Per Day:  0.02
  • Content Count:  1676
  • Reputation:   702
  • Joined:  12/21/14
  • Last Seen:  

yes you have to think where you want to put it and 

checkweight(969,.@gain)

so it would be like this>>

	input .@gain;
    if (.@gain > gold){                                   // check if the player have the amount he want
    mes "you don't have that much";
    close;
    }else if(checkweight(969,.@gain)){
    getitem 969,.@gain;                                //give the player the item gold (the same amount as the input)
    gold = gold -.@gain;                                //take from the player the variable gold the same amount as the item gold
    }else{ goto L_OverWeight;}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  17
  • Topics Per Day:  0.01
  • Content Count:  53
  • Reputation:   0
  • Joined:  08/14/15
  • Last Seen:  

3 hours ago, sader1992 said:

yes you have to think where you want to put it and 

checkweight(969,.@gain)

so it would be like this>>


	input .@gain;
    if (.@gain > gold){                                   // check if the player have the amount he want
    mes "you don't have that much";
    close;
    }else if(checkweight(969,.@gain)){
    getitem 969,.@gain;                                //give the player the item gold (the same amount as the input)
    gold = gold -.@gain;                                //take from the player the variable gold the same amount as the item gold
    }else{ goto L_OverWeight;}

 

i removed the check weight since max stack on my server is 30k.. going over 30k will not show the input popout..

 

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