Jump to content
  • 0

Looking for help with Goldroom Script


Mythryx

Question


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  9
  • Reputation:   0
  • Joined:  10/23/19
  • Last Seen:  

Im trying to get this to work. When you get killed you will lose all the gold points you have.

prontera,164,146,3    script    Gold Room Assistant#goldroom    4_F_KAFRA1,{
    doevent "gold_room_main::OnTalk";

OnInit:
delwaitingroom;
waitingroom "  Gold Room",0;


end;


}

// 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 Gold    1369,600,0,0,"gold_room_main::OnKill"


-    script    gold_room_main    -1,{
    
    OnInit:
        // gold room map
        .map$ = "ordeal_3-2";
        // entrance fee
        .zeny_cost = 250000;
        // rate to get gold
        .rate = 50;
        // gold random amount
        setarray .gold_amount,1,3;
        

        setmapflag .Map$,mf_nogo;
        setmapflag .map$,mf_nobranch;
        setmapflag .map$,mf_nosave;
        setmapflag .map$,mf_nomemo;
        setmapflag .map$,mf_noreturn;
        setmapflag .map$,mf_nowarp;
        setmapflag .map$,mf_nowarpto;
        setmapflag .map$,mf_noskill;
        setmapflag .Map$,mf_noloot;


        end;
    
    OnTalk:
        mes "Wasup, Low Class People! I know you want to become rich!";
        mes "Well i have a place where you can find a very rare Birds.";
    next;
        mes "And if you kill those birthds you will gain a random amount of GOLD";
        mes "Points or GP and you can ^FF0000TRADE^000000 it into real GOLD!";
    next;
        mes "But there is something you should know...";
        mes "There are guardians that lurking around the map and they are strong!!!";
    next;
        mes "^FF0000All of your points will lose when you die!^000000 ";
    next;
        mes "I need";
        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$,153,153;
                }
                break;
            case 2:    
                mes "You got "+F_InsertComma( #GOLDPOINTS )+" Points";
                input .@value,0,#GOLDPOINTS;
                if ( checkweight( 969, .@value ) ) {
                    #GOLDPOINTS -= .@value;
                    getitem 969,.@value;
                    mes "Gained "+.@value+" Gold.";
                }
                else {
                    mes "You overweight.";
                }
            default:
                break;
        }
        close;
        
    OnKill:
        if ( .rate < rand( 100 ) ) {
            .@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;
}

Im not really sure on why its not working.

Abit of help would be much appreciated. 

Thanks!

Edited by Emistry
Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

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

try this

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

On 4/9/2020 at 8:16 AM, Emistry said:

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

try this

@Emistry thanks for this.  can you add if you killed someone inside the gold room you'll get their points? thanks

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

	OnPCDieEvent:
		.@killerrid = killerrid;
		if (strcharinfo(3) == .map$ && .@killerrid != getcharid(3)) {
			.@total_gold_point = #GOLDPOINTS;
			#GOLDPOINTS = 0;
			dispbottom "You died, you lost all the points.";
			
			if (attachrid(.@killerrid)) {
				#GOLDPOINTS += .@total_gold_point;
				dispbottom "You gained "+.@total_gold_point+" gold points.";
			}
		}
		end;

 

Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  92
  • Reputation:   2
  • Joined:  01/04/15
  • Last Seen:  

17 hours ago, Emistry said:

	OnPCDieEvent:
		.@killerrid = killerrid;
		if (strcharinfo(3) == .map$ && .@killerrid != getcharid(3)) {
			.@total_gold_point = #GOLDPOINTS;
			#GOLDPOINTS = 0;
			dispbottom "You died, you lost all the points.";
			
			if (attachrid(.@killerrid)) {
				#GOLDPOINTS += .@total_gold_point;
				dispbottom "You gained "+.@total_gold_point+" gold points.";
			}
		}
		end;

 

thank you so much, works perfect!

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