Jump to content
  • 0

H> Gold Room Points


GM Winter

Question


  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

hello guys how can i set a fix point in this gold room script example sure 1 point every kill not randam points 

Quote

prontera,155,181,5 script Gold Room#goldroom 4_F_KAFRA1,{
    doevent "gold_room_main::OnTalk";
}
// warp portal back prontera
ordeal_3-2,123,123,0    warp    gold_room_back_prt    1,1,prontera,155,181

// peco peco summon
ordeal_3-2,0,0,0,0    monster    Peco Peco    1019,200,60000,0,"gold_room_main::OnKill"

-    script    gold_room_main    -1,{
    
    OnInit:
        // gold room map
        .map$ = "ordeal_3-2";
        // entrance fee
        .zeny_cost = 200000;
        // rate to get gold
        .rate = 100;
        // gold random amount
        setarray .gold_amount,1,5;
        
        setmapflag .map$,mf_noteleport;
        setmapflag .map$,mf_pvp;
        setmapflag .map$,mf_pvp_noguild;
        setmapflag .map$,mf_pvp_noparty;
        setmapflag .map$,mf_nobranch;
        setmapflag .map$,mf_nosave;
        setmapflag .map$,mf_nomemo;
        setmapflag .map$,mf_noreturn;
        setmapflag .map$,mf_nowarp;
        setmapflag .map$,mf_nowarpto;
        end;
    
    OnTalk:
        mes "Enter Gold Room ?";
        if ( .zeny_cost ) 
            mes F_InsertComma( .zeny_cost ) + " Zeny";
        switch ( select( 
            "Enter Gold Room",
            "Exchange Gold Point",
            "Cancel"
        )) {
            case 1:
                if ( Zeny < .zeny_cost ) {
                    mes "Not enough Zeny.";
                }
                else {
                    Zeny -= .zeny_cost;
                    warp .map$,0,0;
                }
                break;
            case 2:    
                mes "You got "+F_InsertComma( #GOLDPOINTS )+" Points";
                input .@value,0,#GOLDPOINTS;
                if (.@value == 0) {
                    mes "Exchange canceled.";
                close;
                }
                if ( checkweight( 969, .@value ) ) {
                    #GOLDPOINTS -= .@value;
                    getitem 969,.@value;
                    mes "Gained "+.@value+" Gold.";
                }
                else {
                    mes "You are overweight.";
                }
            default:
                break;
        }
        close;
        
    OnKill:    
        if ( .rate > rand( .50 ) ) {
            .@point = rand( .gold_amount[0],.gold_amount[1] );
            #GOLDPOINTS += .@point;
            dispbottom "Gained "+.@point+" Point. You got "+F_InsertComma( #GOLDPOINTS )+" Points now.";
        }
        end;

    OnPCDieEvent:
        .@killerrid = killerrid;
        if ( strcharinfo(3) == .map$ && .@killerrid != getcharid(3) && getmonsterinfo( .@killerrid,MOB_NAME ) != "null" ) {
            #GOLDPOINTS = 0;
            dispbottom "You died, you lost all the point.";
        }
        end;
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  19
  • Topics Per Day:  0.00
  • Content Count:  292
  • Reputation:   46
  • Joined:  10/30/12
  • Last Seen:  

try change this..

 .@point = rand( .gold_amount[0],.gold_amount[1] );

to

 .@point = 1;

 

  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  176
  • Topics Per Day:  0.14
  • Content Count:  666
  • Reputation:   9
  • Joined:  12/04/20
  • Last Seen:  

2 hours ago, mrfizi said:

try change this..

 .@point = rand( .gold_amount[0],.gold_amount[1] );

to

 .@point = 1;

 

thanks

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