Jump to content

tokenacc001

Members
  • Posts

    35
  • Joined

  • Last visited

Posts posted by tokenacc001

  1. hello masters!

    saw this script on a forum, but it only works until waiting for player, after the game start, it stuck.


    can anyone fix this script?

     

    thanks in advance!!



     

    Quote
    
    prontera,150,150,5	script	Texas Hold'em	817,{
    	// Options
    	set @currency,0;	// 0 - points, 1 - zeny, 2 - item
    	set @max,250;	// Maximum bet
    	set @min,1;		// Minumum bet
    	set @ante,1;	// Ante
    	set @itemid,0;		// Item ID if credits
    
    	// No game in progress
    	if ($@tex_status == 0) {
    		mes "[Texas Hold'em]";
    		mes "Hello, would you like to start a game?";
    		next;
    		menu "Start New Game",-,"Cancel",T_Exit;
    		
    		if ($@tex_status == 0) {
    			set $@tex_status,1;
    			set $@tex_players,1;
    			set $@tex_player$[1],strcharinfo(0);
    			set @tex_player,$@tex_players;
    			
    			announce strcharinfo(0) + ": I've started a game of Texas Hold'em",2;
    			
    			mes "[Texas Hold'em]";
    			mes "Waiting for players...";
    			mes "Please speak with me again once at least 1 other player has joined and you are ready to begin.";
    			close;
    		}
    		if ($@tex_status != 0) {
    			mes "[Texas Hold'em]";
    			mes "Somebody has started the game before you. Try joining.";
    			close;
    		}
    	}
    
    	// Waiting for players
    	if ($@tex_status == 1) {
    		if (strcharinfo(0) == $@tex_player$[1]) {
    			if ($@tex_players < 2) {
    				mes "[Texas Hold'em]";
    				mes "Cannot start a game with only 1 player.";
    				mes "Please wait for more players to join or cancel the game.";
    				menu "Cancel Game",-,"Wait",T_Exit;
    
    				T_CancelGame:
    				callfunc "tex_reset";
    				mes "Game has been reset.";
    				
    				announce strcharinfo(0)+": I've cancelled the game",2;
    				close;
    			}
    			if ($@tex_players > 1) {
    				mes "[Texas Hold'em]";
    				mes "There are currently " + $@tex_players + " waiting.";
    				mes "Start the game?";
    				next;
    				menu "Start Game",-,"Wait Longer",T_Exit,"Cancel Game",T_CancelGame;
    				
    				T_StartGame:
    				set $@tex_status,2;
    				set $@tex_maxbid,@ante;
    				callfunc "tex_deck_reset";
    				callfunc "tex_deal";
    				
    				if ($@tex_hand$[1] == "") {
    					callfunc "tex_const";
    				}
    
    				mes "[Texas Hold'em]";
    				mes "Game is commencing...";
    				Announce "Texas Hold'em: Game is commencing... Please speak to me to receive your hands.",2;
    				close;
    			}
    		} else {
    			if ($@tex_player$[@tex_player] != strcharinfo(0)) {
    				mes "[Texas Hold'em]";
    				mes "This game has been started by " + $@tex_player$[1] + ". Would you like to join?";
    				next;
    				menu "Join Game",-,"Cancel",T_Exit;
    				
    				set $@tex_players,$@tex_players+1;
    				set $@tex_player$[$@tex_players],strcharinfo(0);
    				set $@tex_ready[$@tex_players],1;
    				set @tex_player,$@tex_players;
    				announce strcharinfo(0)+": I'm in. Game now has " + $@tex_players + "/5 players.",2;
    				
    				if ($@tex_players >= 5) goto T_StartGame;
    				
    				mes "[Texas Hold'em]";
    				mes "Welcome to the game. Please wait for " + $@tex_player$[1] + " to begin the game.";
    				close;
    			} else {
    				mes "[Texas Hold'em]";
    				mes "You are already part of this game.";
    				mes "Please wait for it to begin.";
    				close;
    			}
    		}
    	}
    	// Game has begun
    	if ($@tex_status >= 2) {
    		if ($@tex_player$[@tex_player] == strcharinfo(0)) {
    			set @playernum,callfunc("tex_playernum");
    			// Take ante
    			if ($@tex_bet[@playernum] < @ante) {
    				set $@tex_bet[@playernum],@ante;
    			}
    		
    			T_Disp:
    			// Check if all players are ready
    			set @i,0;
    			while (@i < $@tex_players) {
    				set @i,@i+1;
    				if ($@tex_ready[@i] == 0) goto T_Disp_Cont;
    			}
    			// All players are ready
    			callfunc "tex_unready",0;
    			
    			// Found the winner
    			// Everybody folded except invoking character
    			if ($@tex_folded == 4 && $@tex_ready[@playernum] != 2) {
    				set $@tex_status,5;
    				set $@tex_winner,@playernum;
    			}
    			if ($@tex_status == 5) {
    				if ($@tex_player$[$@tex_winner] == strcharinfo(0)) {
    					set @prize,$@tex_bet[1]+$@tex_bet[2]+$@tex_bet[3]+$@tex_bet[4]+$@tex_bet[5];
    					mes "[Texas Hold'em]";
    					mes "Congratulations, you have won " + @prize + ".";
    					close;
    				} else {
    					if ($@folded < 4) {
    						mes "[Texas Hold'em]";
    						mes "The winner is " + $@tex_player$[$@tex_winner] + " with a " + $@tex_hand$[$@tex_winning] + ".";
    						announce "The winner is " + $@tex_player$[$@tex_winner] + " with a " + $@tex_hand$[$@tex_winning] + ".",2;
    						close;
    					} else {
    						mes "[Texas Hold'em]";
    						mes "The winner is " + $@tex_player$[$@tex_winner];
    						announce "The winner is " + $@tex_player$[$@tex_winner],2;
    						close;
    					}
    				}
    			}
    			
    			// Deal the cards
    			if ($@tex_status == 4) {
    				set $@tex_public[5],callfunc("tex_getcard");
    				set $@tex_status,5;
    				announce "Texas Hold'em: I've just dealt the RIVER",2;
    			}
    			if ($@tex_status == 3) {
    				set $@tex_public[4],callfunc("tex_getcard");
    				set $@tex_status,4;
    				announce "Texas Hold'em: I've just dealt the TURN",2;
    			}
    			if ($@tex_status == 2) {
    				set $@tex_public[1],callfunc("tex_getcard");
    				set $@tex_public[2],callfunc("tex_getcard");
    				set $@tex_public[3],callfunc("tex_getcard");
    				set $@tex_status,3;
    				announce "Texas Hold'em: I've just dealt the FLOP",2;
    			}
    			
    			T_Disp_Cont:
    			
    			//mes "[Texas Hold'em]";
    			mes "Status: " + $@tex_status$[$@tex_ready[@playernum]];
    			mes "Your Cards:";
    			mes $@tex_card_name$[$@tex_card_1[@playernum]] + " & " + $@tex_card_name$[$@tex_card_2[@playernum]];
    			set @hand,callfunc("tex_hand");
    			
    			// Change player's hand to current winning hand
    			if ($@tex_winning > @hand) {
    				set $@tex_winning,@hand;
    				set $@tex_winner,@playernum;
    			}
    			mes $@tex_hand$[@hand];
    			mes "Public Cards:";
    
    			/// Nothing
    			if ($@tex_status == 2) {
    				mes "None";
    			}
    			/// The FLOP
    			if ($@tex_status >= 3) {
    				mes $@tex_card_name$[$@tex_public[1]];
    				mes $@tex_card_name$[$@tex_public[2]];
    				mes $@tex_card_name$[$@tex_public[3]];
    			}
    			/// The TURN
    			if ($@tex_status >= 4) {
    				mes $@tex_card_name$[$@tex_public[4]];
    			}
    			/// The RIVER
    			if ($@tex_status >= 5) {
    				mes $@tex_card_name$[$@tex_public[5]];
    			}
    			
    			next;
    			if ($@tex_status[@playernum] != 2) {
    				menu "Refresh",T_Disp,"Raise/Call",T_RaiseCall,"Check",T_Check,"Fold",T_Fold;
    			} else {
    				menu "Refresh",T_Disp,"Exit",T_Exit;
    			}
    
    			// Raise or Call current bet
    			T_RaiseCall:
    				mes "[Texas Hold'em]";
    				mes "How much to put into the pot?";
    				mes "Amount needed to call: " + ($@tex_maxbid - @tex_bet[@playernum]);
    				mes "^606060Enter exact amount to call or higher to raise.^000000";
    				next;
    				input @bet;
    				// Not within allowed bet range
    				if (@bet > @max || @bet < @min) {
    					mes "[Texas Hold'em]";
    					mes "The maximum bet is " + @max + " and the minimum bet is " + @min + ". Your bet was " + @bet + ".";
    					mes "Please try again.";
    					next;
    					goto T_Disp;
    				}
    				// Player tried to raise again
    				if ($@tex_maxbidder == @playernum) {
    					mes "[Texas Hold'em]";
    					mes "You were the last to raise. Please wait for other players to re-raise before raising again.";
    					goto T_Disp;
    				}
    				// Player's raise is not enough to call
    				if ($@tex_bet[@playernum]+@bet < $@tex_maxbid) {
    					mes "[Texas Hold'em]";
    					mes "You must enter at least " + ($@tex_maxbid - @tex_bet[@playernum]) + " to stay in the game.";
    					goto T_Disp;
    				}
    				
    				set $@tex_bet[@playernum],$@tex_bet[@playernum]+@bet;
    				set @raise,$@tex_bet[@playernum] - $@tex_maxbid;
    				
    				mes "[Texas Hold'em]";
    				mes "Your bet is now " + $@tex_bet[@playernum] + ".";
    				set $@tex_ready[@playernum],1;
    				
    				// Player RAISED
    				if ($@tex_bet[@playernum] > $@tex_maxbid) {
    					set $@tex_maxbid,$@tex_bet[@playernum];
    					set $@tex_maxbidder,@playernum;
    					mes "You now have the highest bet.";
    					callfunc "tex_unready",@playernum;
    					
    					announce strcharinfo(0) + ": Raise " + @raise,2;
    				} else {
    					announce strcharinfo(0) + ": Call",2;
    				}
    				goto T_Disp;
    			
    			T_Check:
    				// Check successful
    				if ($@tex_bet[@playernum] == $@tex_maxbid) {
    					set $@tex_ready[@playernum],1;
    					mes "[Texas Hold'em]";
    					mes "You checked.";
    					goto T_Disp;
    				} else {
    					mes "[Texas Hold'em]";
    					mes "Somebody raised. You are unable to check.";
    					goto T_Disp;
    				}
    
    			T_Fold:
    				mes "[Texas Hold'em]";
    				mes "Are you sure you want to fold?";
    				next;
    				menu "Yes",-,"No",T_Disp;
    
    				announce strcharinfo(0)+": I fold",2;
    				mes "[Texas Hold'em]";
    				mes "You are now out of the round.";
    				
    				set $@tex_ready[@playernum],2;
    				set $@tex_folded,$@tex_folded+1;
    				
    				close;
    
    		}
    		if ($@tex_player$[@tex_player] != strcharinfo(0)) {
    			mes "[Texas Hold'em]";
    			mes "Sorry, you are not part of this game. Please wait for the game to end to participate in the next game.";
    			close;
    		}
    	}
    	close2;
    	end;
    	
    	// Responses
    	T_Exit:
    		mes "[Texas Hold'em]";
    		mes "As you wish.";
    		close;
    
    // Define constants
    OnInit:
    	callfunc "tex_const";
    	end;
    }
    
    
    
    // Function: Set all players to not ready
    // Syntax: callfunc("tex_unready"{,player to not unready});
    function	script	tex_unready	{
    	//cleararray $@tex_ready[1],0,5;
    	set $@tex_ready[1],$@tex_fold[1];
    	set $@tex_ready[2],$@tex_fold[2];
    	set $@tex_ready[3],$@tex_fold[3];
    	set $@tex_ready[4],$@tex_fold[4];
    	set $@tex_ready[5],$@tex_fold[5];
    	if (getarg(0) != 0) set $@tex_ready[getarg(0)],1;
    	return();
    }
    
    // Function: Get a card from the deck
    function	script	tex_getcard	{
    	set $@tex_dealt,0;
    	while ($@tex_dealt != 1) {
    		set $@randcard,rand(1,52);
    		if ($@tex_deck[$@randcard] == 1) {
    			set $@tex_deck[$@randcard],0;
    			set $@tex_dealt,1;
    		}
    	}
    	return($@randcard);
    }
    
    // Function: Deal cards
    function	script	tex_deal	{
    	// Everyone gets 1st card
    	set @i,0;
    	while (@i < $@tex_players) {
    		set @i,@i+1;
    		set $@tex_card_1[@i],(callfunc("tex_getcard"));
    	}
    	// Everyone gets 2nd card
    	set @i,0;
    	while (@i < $@tex_players) {
    		set @i,@i+1;
    		set $@tex_card_2[@i],(callfunc("tex_getcard"));
    	}
    	return();
    }
    
    // Function: Return player's number
    function	script	tex_playernum	{
    	set @i,0;
    	set @num,0;
    	while (@i < $@tex_players) {
    		set @i,@i+1;
    		if (strcharinfo(0) == $@tex_player$[@i]) {
    			set @num,@i;
    		}
    	}
    	return(@num);
    }
    
    // Function: Reset the Deck (Make all cards available)
    function	script	tex_deck_reset	{
    	cleararray $@tex_deck[1],1,52;
    	return();
    }
    
    // Function: Reset Game. Clear all variables
    function	script	tex_reset	{
    	set $@tex_status,0;
    	set $@tex_players,0;
    	set $@tex_maxbidder,0;
    	set $@tex_maxbid,0;
    	set $@tex_folded,0;
    	cleararray $@tex_player$[1],"",5;
    	cleararray $@tex_card_1[1],0,5;
    	cleararray $@tex_card_2[1],0,5;
    	cleararray $@tex_bet[1],0,5;
    	cleararray $@tex_ready[1],0,5;
    	cleararray $@tex_fold[1],0,5;
    	cleararray $@tex_public[1],0,5;
    	return();
    }
    
    // Function: Check if player is already part of game
    // Syntax: if (callfunc("tex_playercheck")) mes "Player is part of game";
    function	script	tex_playercheck	{
    		set @i,0;
    		while (@i < $@tex_players) {
    			if ($@tex_player$[@i] == strcharinfo(0)) {
    				goto T_TRUE;
    			}
    		set @i,@i+1;
    		}
    		return(0);
    	T_TRUE:
    		return(1);
    }
    
    // Function: Checks all cards for like numbers
    function	script	tex_combo_like	{
    	// Linear Comparison
    	set @i,0;
    	while (@i < 13) {
    		set @i,@i+1;
    		if ($@tex_card_num[$@tex_public[1]] == @i && $@tex_public[1] != 0) set @combo_like,@combo_like+1;
    		if ($@tex_card_num[$@tex_public[2]] == @i && $@tex_public[2] != 0) set @combo_like,@combo_like+1;
    		if ($@tex_card_num[$@tex_public[3]] == @i && $@tex_public[3] != 0) set @combo_like,@combo_like+1;
    		if ($@tex_card_num[$@tex_public[4]] == @i && $@tex_public[4] != 0) set @combo_like,@combo_like+1;
    		if ($@tex_card_num[$@tex_public[5]] == @i && $@tex_public[5] != 0) set @combo_like,@combo_like+1;
    		if ($@tex_card_num[$@tex_card_1[@playernum]] == @i) set @combo_like,@combo_like+1;
    		if ($@tex_card_num[$@tex_card_2[@playernum]] == @i) set @combo_like,@combo_like+1;
    		if (@combo_like == getarg(0)) {
    			set @num,@num+1;
    		}
    		set @combo_like,0;
    	}
    	return(@num);
    }
    
    // Function: Checks for cards with the same suit
    function	script	tex_combo_suit	{
    	// Linear Comparison
    	set @i,0;
    	while (@i < 4) {
    		set @i,@i+1;
    		if ($@tex_card_suit[$@tex_public[1]] == @i && $@tex_public[1] != 0) set @combo_suit,@combo_suit+1;
    		if ($@tex_card_suit[$@tex_public[2]] == @i && $@tex_public[2] != 0) set @combo_suit,@combo_suit+1;
    		if ($@tex_card_suit[$@tex_public[3]] == @i && $@tex_public[3] != 0) set @combo_suit,@combo_suit+1;
    		if ($@tex_card_suit[$@tex_public[4]] == @i && $@tex_public[4] != 0) set @combo_suit,@combo_suit+1;
    
    		if ($@tex_card_suit[$@tex_public[5]] == @i && $@tex_public[5] != 0) set @combo_suit,@combo_suit+1;
    		if ($@tex_card_suit[$@tex_card_1[@playernum]] == @i) set @combo_like,@combo_like+1;
    		if ($@tex_card_suit[$@tex_card_2[@playernum]] == @i) set @combo_like,@combo_like+1;
    		if (@combo_like >= getarg(0)) {
    			return(1);
    		}
    		set @combo_like,0;
    	}
    	return();
    }
    
    // Function: Selection sort: Highest to Lowest
    // Returns the highest card #
    function	script	tex_sort	{
    	// First do a selection sort
    	set @i,8;
    	setarray @card[1],$@tex_card_num[$@tex_public[1]],$@tex_card_num[$@tex_public[2]],$@tex_card_num[$@tex_public[3]],$@tex_card_num[$@tex_public[4]],$@tex_card_num[$@tex_public[5]],$@tex_card_num[$@tex_card_1[@playernum]],$@tex_card_num[$@tex_card_2[@playernum]];
    	set @max_n,0;
    	while (@i > 0) {
    		set @c,0;
    		while (@c < @i) {
    			set @c,@c+1;
    			if (@card[@c] > @max_n) set @max_n,@c;
    		}
    		set @i,@i-1;
    		set $@card_sorted[@i],@max_n;
    	}
    	// Return highest card
    	return(@card_sorted[7]);
    }
    
    // Function: Checks for consecutive cards
    function	script	tex_combo_cons	{
    	callfunc "tex_sort";
    	
    	// Now check for consecutive numbers
    	set @i,0;
    	while (@i < 7) {
    		set @i,@i+1;
    		if ($@card_sorted[@i] == ($@card_sorted[@i+1] + 1)) {
    			set @combo_cons,@combo_cons+1;
    			if (@combo_cons >= getarg(0)-1) return(1);
    		} else {
    			if ($@card_sorted[@i] != ($@card_sorted[@i+1])) {
    				set @combo_cons,0;
    			}
    		}
    	}
    	return(0);
    }
    
    // Function: Displays the rank of the current player's hand
    function	script	tex_hand	{
    
    	// Straight Flush
    	if (callfunc("tex_combo_suit",5) == 1 && callfunc("tex_combo_cons",5) == 1) {
    		set @combo,2;
    		goto TH_End;
    	}
    
    	// Four of a Kind
    	if (callfunc("tex_combo_like",4) >= 1) {
    		set @combo,3;
    		goto TH_End;
    	}
    	
    	// Full House
    	if ((callfunc("tex_combo_like",3) == 1 && callfunc("tex_combo_like",2)) || callfunc("tex_combo_like",3) >= 2) {
    		set @combo,4;
    		goto TH_End;
    	}
    	
    	// Flush
    	if (callfunc("tex_combo_suit",5) == 1) {
    		set @combo,5;
    		goto TH_End;
    	}
    	
    	// Straight
    	if (callfunc("tex_combo_cons",5) == 1) {
    		set @combo,6;
    		goto TH_End;
    	}
    	
    	// Three of a Kind
    	if (callfunc("tex_combo_like",3) == 1) {
    		set @combo,7;
    		goto TH_End;
    	}
    	
    	// Two Pair
    	if (callfunc("tex_combo_like",2) == 2) {
    		set @combo,8;
    		goto TH_End;
    	}
    	
    	// One Pair
    	if (callfunc("tex_combo_like",2) == 1) {
    		set @combo,9;
    		goto TH_End;
    	}
    	
    	// High Card
    	set @combo,10;
    	set @highest,callfunc("tex_sort");
    	
    	TH_End:
    		return(@combo);
    }
    
    // Function: Define constants
    function	script	tex_const	{
    	set $@tex_status$[0],"^FF0000Pending Action...^000000";
    	set $@tex_status$[1],"^00FF00Ready^000000";
    	set $@tex_status$[2],"^606060Folded^000000";
    
    	set $@tex_hand$[1],"Royal Straight Flush";
    	set $@tex_hand$[2],"Straight Flush";
    	set $@tex_hand$[3],"Four of a Kind";
    	set $@tex_hand$[4],"Full House";
    	set $@tex_hand$[5],"Flush";
    	set $@tex_hand$[6],"Straight";
    	set $@tex_hand$[7],"Three of a Kind";
    	set $@tex_hand$[8],"Two Pair";
    	set $@tex_hand$[9],"One Pair";
    	set $@tex_hand$[10],"High Card";
    	
    	set $@tex_card_num[1],1;
    	set $@tex_card_num[2],2;
    	set $@tex_card_num[3],3;
    	set $@tex_card_num[4],4;
    	set $@tex_card_num[5],5;
    	set $@tex_card_num[6],6;
    	set $@tex_card_num[7],7;
    	set $@tex_card_num[8],8;
    	set $@tex_card_num[9],9;
    	set $@tex_card_num[10],10;
    	set $@tex_card_num[11],11;
    	set $@tex_card_num[12],12;
    	set $@tex_card_num[13],13;
    	set $@tex_card_num[14],1;
    	set $@tex_card_num[15],2;
    	set $@tex_card_num[16],3;
    	set $@tex_card_num[17],4;
    	set $@tex_card_num[18],5;
    	set $@tex_card_num[19],6;
    	set $@tex_card_num[20],7;
    	set $@tex_card_num[21],8;
    	set $@tex_card_num[22],9;
    	set $@tex_card_num[23],10;
    	set $@tex_card_num[24],11;
    	set $@tex_card_num[25],12;
    	set $@tex_card_num[26],13;
    	set $@tex_card_num[27],1;
    	set $@tex_card_num[28],2;
    	set $@tex_card_num[29],3;
    	set $@tex_card_num[30],4;
    	set $@tex_card_num[31],5;
    	set $@tex_card_num[32],6;
    	set $@tex_card_num[33],7;
    	set $@tex_card_num[34],8;
    	set $@tex_card_num[35],9;
    	set $@tex_card_num[36],10;
    	set $@tex_card_num[37],11;
    	set $@tex_card_num[38],12;
    	set $@tex_card_num[39],13;
    	set $@tex_card_num[40],1;
    	set $@tex_card_num[41],2;
    	set $@tex_card_num[42],3;
    	set $@tex_card_num[43],4;
    	set $@tex_card_num[44],5;
    	set $@tex_card_num[45],6;
    	set $@tex_card_num[46],7;
    	set $@tex_card_num[47],8;
    	set $@tex_card_num[48],9;
    	set $@tex_card_num[49],10;
    	set $@tex_card_num[50],11;
    	set $@tex_card_num[51],12;
    	set $@tex_card_num[52],13;
    	
    	set $@tex_card_suit[1],1;
    	set $@tex_card_suit[2],1;
    	set $@tex_card_suit[3],1;
    	set $@tex_card_suit[4],1;
    	set $@tex_card_suit[5],1;
    	set $@tex_card_suit[6],1;
    	set $@tex_card_suit[7],1;
    	set $@tex_card_suit[8],1;
    	set $@tex_card_suit[9],1;
    	set $@tex_card_suit[10],1;
    	set $@tex_card_suit[11],1;
    	set $@tex_card_suit[12],1;
    	set $@tex_card_suit[13],1;
    	set $@tex_card_suit[14],2;
    	set $@tex_card_suit[15],2;
    	set $@tex_card_suit[16],2;
    	set $@tex_card_suit[17],2;
    	set $@tex_card_suit[18],2;
    	set $@tex_card_suit[19],2;
    	set $@tex_card_suit[20],2;
    	set $@tex_card_suit[21],2;
    	set $@tex_card_suit[22],2;
    	set $@tex_card_suit[23],2;
    	set $@tex_card_suit[24],2;
    	set $@tex_card_suit[25],2;
    	set $@tex_card_suit[26],2;
    	set $@tex_card_suit[27],3;
    	set $@tex_card_suit[28],3;
    	set $@tex_card_suit[29],3;
    	set $@tex_card_suit[30],3;
    	set $@tex_card_suit[31],3;
    	set $@tex_card_suit[32],3;
    	set $@tex_card_suit[33],3;
    	set $@tex_card_suit[34],3;
    	set $@tex_card_suit[35],3;
    	set $@tex_card_suit[36],3;
    	set $@tex_card_suit[37],3;
    	set $@tex_card_suit[38],3;
    	set $@tex_card_suit[39],3;
    	set $@tex_card_suit[40],4;
    	set $@tex_card_suit[41],4;
    	set $@tex_card_suit[42],4;
    	set $@tex_card_suit[43],4;
    	set $@tex_card_suit[44],4;
    	set $@tex_card_suit[45],4;
    	set $@tex_card_suit[46],4;
    	set $@tex_card_suit[47],4;
    	set $@tex_card_suit[48],4;
    	set $@tex_card_suit[49],4;
    	set $@tex_card_suit[50],4;
    	set $@tex_card_suit[51],4;
    	set $@tex_card_suit[52],4;
    	
    	set $@tex_card_name$[1],"A of SPADES";
    	set $@tex_card_name$[2],"2 of SPADES";
    	set $@tex_card_name$[3],"3 of SPADES";
    	set $@tex_card_name$[4],"4 of SPADES";
    	set $@tex_card_name$[5],"5 of SPADES";
    	set $@tex_card_name$[6],"6 of SPADES";
    	set $@tex_card_name$[7],"7 of SPADES";
    	set $@tex_card_name$[8],"8 of SPADES";
    	set $@tex_card_name$[9],"9 of SPADES";
    	set $@tex_card_name$[10],"10 of SPADES";
    	set $@tex_card_name$[11],"J of SPADES";
    	set $@tex_card_name$[12],"Q of SPADES";
    	set $@tex_card_name$[13],"K of SPADES";
    	set $@tex_card_name$[14],"^FF0000A of HEARTS^000000";
    	set $@tex_card_name$[15],"^FF00002 of HEARTS^000000";
    	set $@tex_card_name$[16],"^FF00003 of HEARTS^000000";
    	set $@tex_card_name$[17],"^FF00004 of HEARTS^000000";
    	set $@tex_card_name$[18],"^FF00005 of HEARTS^000000";
    	set $@tex_card_name$[19],"^FF00006 of HEARTS^000000";
    	set $@tex_card_name$[20],"^FF00007 of HEARTS^000000";
    	set $@tex_card_name$[21],"^FF00008 of HEARTS^000000";
    	set $@tex_card_name$[22],"^FF00009 of HEARTS^000000";
    	set $@tex_card_name$[23],"^FF000010 of HEARTS^000000";
    	set $@tex_card_name$[24],"^FF0000J of HEARTS^000000";
    	set $@tex_card_name$[25],"^FF0000Q of HEARTS^000000";
    	set $@tex_card_name$[26],"^FF0000K of HEARTS^000000";
    	set $@tex_card_name$[27],"A of CLUBS";
    	set $@tex_card_name$[28],"2 of CLUBS";
    	set $@tex_card_name$[29],"3 of CLUBS";
    	set $@tex_card_name$[30],"4 of CLUBS";
    	set $@tex_card_name$[31],"5 of CLUBS";
    	set $@tex_card_name$[32],"6 of CLUBS";
    	set $@tex_card_name$[33],"7 of CLUBS";
    	set $@tex_card_name$[34],"8 of CLUBS";
    	set $@tex_card_name$[35],"9 of CLUBS";
    	set $@tex_card_name$[36],"10 of CLUBS";
    	set $@tex_card_name$[37],"J of CLUBS";
    	set $@tex_card_name$[38],"Q of CLUBS";
    	set $@tex_card_name$[39],"K of CLUBS";
    	set $@tex_card_name$[40],"^FF0000A of DIAMONDS^000000";
    	set $@tex_card_name$[41],"^FF00002 of DIAMONDS^000000";
    	set $@tex_card_name$[42],"^FF00003 of DIAMONDS^000000";
    	set $@tex_card_name$[43],"^FF00004 of DIAMONDS^000000";
    	set $@tex_card_name$[44],"^FF00005 of DIAMONDS^000000";
    	set $@tex_card_name$[45],"^FF00006 of DIAMONDS^000000";
    	set $@tex_card_name$[46],"^FF00007 of DIAMONDS^000000";
    	set $@tex_card_name$[47],"^FF00008 of DIAMONDS^000000";
    	set $@tex_card_name$[48],"^FF00009 of DIAMONDS^000000";
    	set $@tex_card_name$[49],"^FF000010 of DIAMONDS^000000";
    	set $@tex_card_name$[50],"^FF0000J of DIAMONDS^000000";
    	set $@tex_card_name$[51],"^FF0000Q of DIAMONDS^000000";
    	set $@tex_card_name$[52],"^FF0000K of DIAMONDS^000000";
    	return();
    }

     

     

  2. Just now, Patskie said:

    You have to used another way to store your bet amount. It's up to you to find out. I gave most of the mechanics already, besides you should detailed out your topic to prevent "1 question, last question" replies.

    oh, i see, thanks a lot!!

    sorry for the asking one question after another, i just happen to bump to it unexpectedly because I use the same .@ variable on another script and it's working...

    thanks a lot!! it's working now!!!

  3. On 8/25/2020 at 6:11 PM, Patskie said:

    Does not from my local server. Are you using latest rAthena?

    yea, it's the latest.

    weird, it worked now without crashing hahaha, thanks!!!!!!!!!!!!!!!!!!!!

     

    On 8/25/2020 at 2:51 PM, Patskie said:

    Try below script. I didn't test it too much

    
    -	script	MVP_vs_MVP	FAKE_NPC,{
    	
    	OnMinute00:
    		if (gettime(DT_HOUR) % 2 || .start) end;
    		goto OnStart;
    		end;
    	
    	OnStart:
    		mapwarp "1@dth3", "prontera", 150, 150;
    		killmonster "1@dth3", "All";
    		.start = 1;
    		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
    		sleep 7000;
    		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
    		sleep 7000;
    		announce .npc$ + " We will start the event after 1 minute", bc_all;
    		sleep 60000;
    		announce .npc$ + " The entry to the event is now closed", bc_all;
    		.start = 2;
    		sleep 7000;
    		
    		if (getmapusers("1@dth3") < 1) {
    			announce .npc$ + " Not enough participants to continue the event", 0;
    			.start = 0;
    			end;
    		}
    		
    		mapannounce "1@dth3", .npc$ + " The rules for this event is simple", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " All good?? Let's start betting !!!", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
    		
    		.start = 3;
    		sleep 55000;
    		mapannounce "1@dth3", .npc$ + " Betting will close in 5...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 4...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 3...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 2...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 1...", bc_map;
    		sleep 1000;
    		.start = 4;
    		mapannounce "1@dth3", .npc$ + " Betting is now closed !!!", bc_map;
    		
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
    		
    		.@mid = .MVP[rand(.size)];
    		monster "1@dth3", 68, 68, "MVP A", .@mid, 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
    		.ma = $@mobid;
    		monster "1@dth3", 71, 68, "MVP B", .@mid, 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
    		.mb = $@mobid;
    		end;
    		
    	OnDie1:
    		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
    		sleep 7000;
    		killmonster "1@dth3", "All";
    		.start = 0;
    		addrid(5, 0, "1@dth3");
    		
    		if (2 == @mvp_bet) {
    			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
    			Zeny += .bet_rewd;
    		}
    		
    		@mvp_bet = 0;
    		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
    		warp "SavePoint", 0, 0;
    		end;
    		
    	OnDie2:
    		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
    		sleep 7000;
    		killmonster "1@dth3", "All";
    		.start = 0;
    		addrid(5, 0, "1@dth3");
    		
    		if (1 == @mvp_bet) {
    			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
    			Zeny += .bet_rewd;
    		}
    		
    		@mvp_bet = 0;
    		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
    		warp "SavePoint", 0, 0;
    		end;
    	
    	OnEventBet:
    		mes .npc$;
    		if (!.start)
    			mes "The event is not active.";
    		else if (.start != 3)
    			mes "The event cannot accept bets at the moment.";
    		else if (Zeny < .bet_cost)
    			mes "You don't have enough zeny to make a bet.";
    		else if (@mvp_bet)
    			mes "You already placed your bet.";
    		else if (strcharinfo(3) != "1@dth3")
    			mes "Hmm~";
    		else {
    			mes "Which mvp will you bet on this match???";
    			next;
    			.@s = select("MVP A:MVP B");
    			mes .npc$;
    			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + (.@s == 1 ? "MVP A" : "MVP B") + "?";
    			next;
    			if (select("Yes:No") & 2) end;
    			if (.start != 3) { // in case they delay the select ???
    				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
    				warp "SavePoint", 0, 0;
    				end;
    			}
    			mes .npc$;
    			mes "Good luck and have fun!";
    			Zeny -= .bet_cost;
    			@mvp_bet = .@s;
    		}
    		end;
    	
    	OnEventJoin:
    		if (!.start)
    			message strcharinfo(0), "The event is not active.";
    		else if (.start != 1)
    			message strcharinfo(0), "The event is not yet allowing participants to enter.";
    		else {
    			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
    			switch (rand(1,4)) {
    				case 1:
    					warp "1@dth3", 49, 50;
    					break;
    				case 2:
    					warp "1@dth3", 49, 88;
    					break;
    				case 3:
    					warp "1@dth3", 89, 88;
    					break;
    				case 4:
    					warp "1@dth3", 89, 50;
    					break;
    			}
    		}
    		end;
    	
    	OnInit:
    		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
    		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
    		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
    		
    		// List of MVP's
    		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
    		.size = getarraysize(.MVP);
    	
    		.npc$ = "[MVP vs MVP Event]";
    		
    		.bet_cost = 5000; // 5,000z to bet in the event
    		.bet_rewd = 1000000; // 1,000,000z if bet wins
    		
    		end;
    }
    
    1@dth3	mapflag	monster_noteleport
    1@dth3	mapflag	noskill
    1@dth3	mapflag	noloot
    1@dth3	mapflag	noitemconsumption
    1@dth3	mapflag	nomemo
    1@dth3	mapflag	nosave	SavePoint
    1@dth3	mapflag	nowarpto
    1@dth3	mapflag	nowarp
    1@dth3	mapflag	noteleport

     

    uhm, 1 question pls, i changed the mob to non-agresive, how can I make them fight each other?

     

    On 8/25/2020 at 7:26 PM, Patskie said:
    
    -	script	MVP_vs_MVP	FAKE_NPC,{
    	
    	OnMinute00:
    		if (gettime(DT_HOUR) % 2 || .start) end;
    		goto OnStart;
    		end;
    	
    	OnStart:
    		mapwarp "1@dth3", "prontera", 150, 150;
    		killmonster "1@dth3", "All";
    		.start = 1;
    		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
    		sleep 7000;
    		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
    		sleep 7000;
    		announce .npc$ + " We will start the event after 1 minute", bc_all;
    		sleep 60000;
    		announce .npc$ + " The entry to the event is now closed", bc_all;
    		.start = 2;
    		sleep 7000;
    		
    		if (getmapusers("1@dth3") < 1) {
    			announce .npc$ + " Not enough participants to continue the event", 0;
    			.start = 0;
    			end;
    		}
    		
    		mapannounce "1@dth3", .npc$ + " The rules for this event is simple", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " All good?? Let's start betting !!!", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
    		
    		.start = 3;
    		sleep 55000;
    		mapannounce "1@dth3", .npc$ + " Betting will close in 5...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 4...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 3...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 2...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 1...", bc_map;
    		sleep 1000;
    		.start = 4;
    		mapannounce "1@dth3", .npc$ + " Betting is now closed !!!", bc_map;
    		
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
    		
    		.@mid = .MVP[rand(.size)];
    		monster "1@dth3", 68, 68, "MVP A", .@mid, 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
    		.ma = $@mobid;
    		monster "1@dth3", 71, 68, "MVP B", .@mid, 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
    		.mb = $@mobid;
    		
    		unitattack .ma, .mb;
    		unitattack .mb, .ma;
    		
    		end;
    		
    	OnDie1:
    		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
    		sleep 7000;
    		killmonster "1@dth3", "All";
    		.start = 0;
    		addrid(5, 0, "1@dth3");
    		
    		if (2 == @mvp_bet) {
    			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
    			Zeny += .bet_rewd;
    		}
    		
    		@mvp_bet = 0;
    		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
    		warp "SavePoint", 0, 0;
    		end;
    		
    	OnDie2:
    		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
    		sleep 7000;
    		killmonster "1@dth3", "All";
    		.start = 0;
    		addrid(5, 0, "1@dth3");
    		
    		if (1 == @mvp_bet) {
    			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
    			Zeny += .bet_rewd;
    		}
    		
    		@mvp_bet = 0;
    		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
    		warp "SavePoint", 0, 0;
    		end;
    	
    	OnEventBet:
    		mes .npc$;
    		if (!.start)
    			mes "The event is not active.";
    		else if (.start != 3)
    			mes "The event cannot accept bets at the moment.";
    		else if (Zeny < .bet_cost)
    			mes "You don't have enough zeny to make a bet.";
    		else if (@mvp_bet)
    			mes "You already placed your bet.";
    		else if (strcharinfo(3) != "1@dth3")
    			mes "Hmm~";
    		else {
    			mes "Which mvp will you bet on this match???";
    			next;
    			.@s = select("MVP A:MVP B");
    			mes .npc$;
    			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + (.@s == 1 ? "MVP A" : "MVP B") + "?";
    			next;
    			if (select("Yes:No") & 2) end;
    			if (.start != 3) { // in case they delay the select ???
    				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
    				warp "SavePoint", 0, 0;
    				end;
    			}
    			mes .npc$;
    			mes "Good luck and have fun!";
    			Zeny -= .bet_cost;
    			@mvp_bet = .@s;
    		}
    		end;
    	
    	OnEventJoin:
    		if (!.start)
    			message strcharinfo(0), "The event is not active.";
    		else if (.start != 1)
    			message strcharinfo(0), "The event is not yet allowing participants to enter.";
    		else {
    			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
    			switch (rand(1,4)) {
    				case 1:
    					warp "1@dth3", 49, 50;
    					break;
    				case 2:
    					warp "1@dth3", 49, 88;
    					break;
    				case 3:
    					warp "1@dth3", 89, 88;
    					break;
    				case 4:
    					warp "1@dth3", 89, 50;
    					break;
    			}
    		}
    		end;
    	
    	OnInit:
    		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
    		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
    		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
    		
    		// List of MVP's
    		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
    		.size = getarraysize(.MVP);
    	
    		.npc$ = "[MVP vs MVP Event]";
    		
    		.bet_cost = 5000; // 5,000z to bet in the event
    		.bet_rewd = 1000000; // 1,000,000z if bet wins
    		
    		end;
    }
    
    1@dth3	mapflag	monster_noteleport
    1@dth3	mapflag	noskill
    1@dth3	mapflag	noloot
    1@dth3	mapflag	noitemconsumption
    1@dth3	mapflag	nomemo
    1@dth3	mapflag	nosave	SavePoint
    1@dth3	mapflag	nowarpto
    1@dth3	mapflag	nowarp
    1@dth3	mapflag	noteleport

     

    works like a charm! thanks!!
    one last question
    i tried changing the bet and reward into credits which is id 3050,

    i put the bet placement in

    Quote
    
    if (select("Yes:No") & 2) end;
                if (.start != 3) { // in case they delay the select ???
                    setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
                    warp "SavePoint", 0, 0;
                    end;
                }
                mes .npc$;
                mes "How much will you bet? ^FF0000[[Maximum of 300 Credits]^000000";
                input .@betamount;
                if(.@betamount < 1 || .@betamount > countitem(3050))
                    mes "You don't have enough credits!.";
                else if(.@betamount > 300)
                    mes "Max of 300 credits only.";
                    
                mes "Good luck and have fun!";
                delitem 3050,.@betamount;
                @mvp_bet = .@s;

     


    i put the reward under 
     

    Quote
    
          if (1 == @mvp_bet) {
                message strcharinfo(0),"Congratulations! You won the event, Good choice!";
                getitem 3050, 2*.@betamount;
            }
    
         if (2 == @mvp_bet) {
                message strcharinfo(0),"Congratulations! You won the event, Good choice!";
                getitem 3050, 2*.@betamount;
            }

     

    the bet placement is working, where it will deduct the credit from inventory, 
    but the reward when won is not given, can you pinpoint where I did wrong? thanks a lot!!

  4. 3 hours ago, Patskie said:

    Try below script. I didn't test it too much

    
    -	script	MVP_vs_MVP	FAKE_NPC,{
    	
    	OnMinute00:
    		if (gettime(DT_HOUR) % 2 || .start) end;
    		goto OnStart;
    		end;
    	
    	OnStart:
    		mapwarp "1@dth3", "prontera", 150, 150;
    		killmonster "1@dth3", "All";
    		.start = 1;
    		announce .npc$ + " We are going to have a MVP vs MVP Event.", bc_all;
    		sleep 7000;
    		announce .npc$ + " For those who want to join, you can participate by using @mvpjoin", bc_all;
    		sleep 7000;
    		announce .npc$ + " We will start the event after 1 minute", bc_all;
    		sleep 60000;
    		announce .npc$ + " The entry to the event is now closed", bc_all;
    		.start = 2;
    		sleep 7000;
    		
    		if (getmapusers("1@dth3") < 1) {
    			announce .npc$ + " Not enough participants to continue the event", 0;
    			.start = 0;
    			end;
    		}
    		
    		mapannounce "1@dth3", .npc$ + " The rules for this event is simple", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Two MVP's will spawn at the center of the map and will attack each other", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Before these MVP's spawn, I will give you 1 minute to make a bet", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " The bet cost for this event is " + F_InsertComma(.bet_cost) + "z and when your chosen MVP wins you'll get as much as " + F_InsertComma(.bet_rewd) + "z !!!", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " All good?? Let's start betting !!!", bc_map;
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " To make a bet please use @mvpbet command, I will give 1 minute for you guys to make a bet", bc_map;
    		
    		.start = 3;
    		sleep 55000;
    		mapannounce "1@dth3", .npc$ + " Betting will close in 5...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 4...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 3...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 2...", bc_map;
    		sleep 1000;
    		mapannounce "1@dth3", .npc$ + " 1...", bc_map;
    		sleep 1000;
    		.start = 4;
    		mapannounce "1@dth3", .npc$ + " Betting is now closed !!!", bc_map;
    		
    		sleep 7000;
    		mapannounce "1@dth3", .npc$ + " Let's get ready to RUMBLE !!!", bc_map;
    		
    		.@mid = .MVP[rand(.size)];
    		monster "1@dth3", 68, 68, "MVP A", .@mid, 1, strnpcinfo(1) + "::OnDie1", Size_Small, AI_NONE;
    		.ma = $@mobid;
    		monster "1@dth3", 71, 68, "MVP B", .@mid, 1, strnpcinfo(1) + "::OnDie2", Size_Small, AI_ATTACK;
    		.mb = $@mobid;
    		end;
    		
    	OnDie1:
    		unittalk .mb, "[MVP B] Mwahaha!~ Such a weak opponent!";
    		sleep 7000;
    		killmonster "1@dth3", "All";
    		.start = 0;
    		addrid(5, 0, "1@dth3");
    		
    		if (2 == @mvp_bet) {
    			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
    			Zeny += .bet_rewd;
    		}
    		
    		@mvp_bet = 0;
    		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
    		warp "SavePoint", 0, 0;
    		end;
    		
    	OnDie2:
    		unittalk .ma, "[MVP A] Mwahaha!~ Such a weak opponent!";
    		sleep 7000;
    		killmonster "1@dth3", "All";
    		.start = 0;
    		addrid(5, 0, "1@dth3");
    		
    		if (1 == @mvp_bet) {
    			message strcharinfo(0),"Congratulations! You won the event, Good choice!";
    			Zeny += .bet_rewd;
    		}
    		
    		@mvp_bet = 0;
    		setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false; 
    		warp "SavePoint", 0, 0;
    		end;
    	
    	OnEventBet:
    		mes .npc$;
    		if (!.start)
    			mes "The event is not active.";
    		else if (.start != 3)
    			mes "The event cannot accept bets at the moment.";
    		else if (Zeny < .bet_cost)
    			mes "You don't have enough zeny to make a bet.";
    		else if (@mvp_bet)
    			mes "You already placed your bet.";
    		else if (strcharinfo(3) != "1@dth3")
    			mes "Hmm~";
    		else {
    			mes "Which mvp will you bet on this match???";
    			next;
    			.@s = select("MVP A:MVP B");
    			mes .npc$;
    			mes "Are you sure you want to bet " + F_InsertComma(.bet_cost) + " on " + (.@s == 1 ? "MVP A" : "MVP B") + "?";
    			next;
    			if (select("Yes:No") & 2) end;
    			if (.start != 3) { // in case they delay the select ???
    				setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, false;
    				warp "SavePoint", 0, 0;
    				end;
    			}
    			mes .npc$;
    			mes "Good luck and have fun!";
    			Zeny -= .bet_cost;
    			@mvp_bet = .@s;
    		}
    		end;
    	
    	OnEventJoin:
    		if (!.start)
    			message strcharinfo(0), "The event is not active.";
    		else if (.start != 1)
    			message strcharinfo(0), "The event is not yet allowing participants to enter.";
    		else {
    			setpcblock PCBLOCK_ATTACK | PCBLOCK_IMMUNE, true;
    			switch (rand(1,4)) {
    				case 1:
    					warp "1@dth3", 49, 50;
    					break;
    				case 2:
    					warp "1@dth3", 49, 88;
    					break;
    				case 3:
    					warp "1@dth3", 89, 88;
    					break;
    				case 4:
    					warp "1@dth3", 89, 50;
    					break;
    			}
    		}
    		end;
    	
    	OnInit:
    		bindatcmd "mvpjoin", strnpcinfo(1) + "::OnEventJoin";
    		bindatcmd "mvpbet", strnpcinfo(1) + "::OnEventBet";
    		bindatcmd "mvpstart", strnpcinfo(1) + "::OnStart", 99, 99;
    		
    		// List of MVP's
    		setarray .MVP[0], 1112, 1115, 1147, 1150, 1157, 1159;
    		.size = getarraysize(.MVP);
    	
    		.npc$ = "[MVP vs MVP Event]";
    		
    		.bet_cost = 5000; // 5,000z to bet in the event
    		.bet_rewd = 1000000; // 1,000,000z if bet wins
    		
    		end;
    }
    
    1@dth3	mapflag	monster_noteleport
    1@dth3	mapflag	noskill
    1@dth3	mapflag	noloot
    1@dth3	mapflag	noitemconsumption
    1@dth3	mapflag	nomemo
    1@dth3	mapflag	nosave	SavePoint
    1@dth3	mapflag	nowarpto
    1@dth3	mapflag	nowarp
    1@dth3	mapflag	noteleport

     

    during the fight, the map got crashed... 

  5. hello! anyone has a working script of a monster vs monster? 

    i want to make it automated and players can bet on which monster who will win.

    but just a working script of monster vs monster will be much appreciated.

     

    thanks in advance!!

  6. Hello!
    I've a gold room script and I wanted to mark the center of the map in ordeal_3-2 as safe zone from monsters and pvp

    I added this on OnInit:
             setcell "ordeal_3-2",146,146,160,161,cell_basilica,1;


    player's can't attack each other (so it's working fine)
    but the monsters is still following and attacking the player, although it's 100% missing

     

    anyway to stop the monster from attacking?

  7. 1 hour ago, HaARiZz said:

    Hello @tokenacc001

    I can confirm that this is client side problem.

    Did you give lite client or full client to your friend?

    Please ask you friend to use your full client in order to see what you can see.

     

    37 minutes ago, Chaos92 said:

    Should be because of their Full Client files (outdated) or your lite client files (if its custom items).

    fixed, hehe thanks guys!

  8. what could be the possible reason for other players can't see the sprite of headgears when equipped, but I can?

    they don't have any errors, just can't see the headgears

    edit: i gave them the copy of my folder, but still they can't see any of the headgears

  9. hello master scripters!

    can anyone help me make this kind of event?

    when the event start, there will be 5 portals spawned, 1 will proceed to the next round, 4 will warp the player back to save points,
    each correct portal they enter will give the player cash point as reward, the event will continue for 3 rounds.

  10. I've tried this

    but it's always giving me "Nobody is selling it now."

    then I tried this

    https://pastebin.com/5Kwt41h6

    it's working but, I prefer the output is showing ALL available vendors, since sometimes when a vendor reaches maximum credit and his shop still has item, it will be still vending.

    thanks in advance!

    edit: i think i posted in the wrong section.. i'm sorry! how to delete this T_T 

  11. 9 hours ago, Patskie said:

     

    I don't think it will be hard as per your claim ?

    @tokenacc001

    Go to src/map/clif.cpp and change below from

    
    // prevent leaking the presence of GM-hidden objects
    if( sc && sc->option&OPTION_INVISIBLE )
    	target = SELF;

    to

    
    // prevent leaking the presence of GM-hidden objects
    if( (sc && sc->option&OPTION_INVISIBLE) || !val )
    	target = SELF;

    Recompile and re-test the script given by @Poring King . above change will work globally so use at your own risk.

    Photo1.PNG

    Photo2.PNG

    didn't work ?
    it just work like a regular changelook, other players can't see the command user's headgear, and the command user can still see other player's headgear

     

    image.png.029b4077961799fc478b672fd6484dca.png
    image.png.c86a93514662018c89f4ea12fbdf7332.pngimage.png.7d8f1108a679cc4e131bd1468d8c2ea5.png
     

  12. On 9/16/2017 at 3:46 PM, crazyarashi said:
    
    //Simple HG Hiding by crazyarashi
    
    -	script	Invisible	-1,{
    OnAtCommand:
    	.@npc$ = "["+ strnpcinfo(1) +"]";
    	mes .@npc$;
    	mes "Hello, "+strcharinfo(0);
    	mes "Which headgear do you want to hide?";	
    	next;
    	setarray .@hgmenu$, "Top Headgear", "Middle Headgear", "Lower Headgear";
    	.@menu$ = implode(.@hgmenu$, ":");
    		.@i = select( .@menu$ ) - 1;
    				.@equip = getequipid(.location$[.@i]);
    				if( .@equip != getequipid(.location$[.@i])) {
    				mes .@npc$;
    				mes "You're not wearing any headgear";
    				close;
    		} else {
    				atcommand "@"+ .looks$[.@i];
    				dispbottom .@hgmenu$[.@i] +" is now hidden";
    				end;
    				}
    OnInit:
    	setarray .location$, "EQI_HEAD_TOP", "EQI_HEAD_MID", "EQI_HEAD_LOW";
    	setarray .looks$, "changelook 1 0", "changelook 2 0", "changelook 3 0";
    	bindatcmd "hidehg",strnpcinfo(0)+"::OnAtCommand";
    
    }

    Try this i added a menu of what you want to headgear you want to hide and added a bindcommand (change the command if you want) 
    haven't tested it though :))
    probably upon logout the item will show again. 

    hello! using this can it be made into
    all headgear worn by other players will also be hidden in the player who used this command?

  13. 10 hours ago, TheKingDino said:

    This would be a lot of work and unless it's already been done I doubt someone is gonna do it for free. I've looked around a lot for something like this in the past and never found it.

    This would require client-side modification on top of the c++ coding to install the AT command, which is the easier part.

    I know this isn't really helpful. But there is a costume item called Invisible Hat, Invisible Sunglasses, and Invisible Mask(dont remember the real name).
    https://www.divine-pride.net/database/item/31292/unknown-item-31292

    So at the very least you could make an NPC or command that hands these out so a single player has the freedom to hide their own headgears. But it's hardly a solution.

    do you have idea on how to do that? willing to pay... really need this feature.

  14. hello!
    Anyone can help me make a command that will hide all player's headgear (only on the side of player who use the command), but still equipped?

     

    Thanks a lot!!

    Edit: not sure if this is allowed but: willing to pay for it... really need this feature

  15. On 7/12/2013 at 12:16 AM, Stolao said:

    < Stolao's Pvp Ladder>

     

    Features:

    • A Dynamic Pvp Ladder

    Todo:

    • Suggestions?
    • Optimize?

    Changelog:
     

    
    3.00 Overhaul
    3.01 Fixed missing "No" for "No Ygg"
    3.02 Added Show Map Name Option
    3.03 Added Max Players Option
    3.04 Optimized and fixed SQL queries [Secret]
    3.05 Replaced some queries with addrid(0)
    3.06 Updated Rewards to RODEX compatable
    3.07 Fixed all rom referancing room [0] player limit
    3.08 Made Made .MaxPlayers = 0, mean unlimited
    3.09 Removed use of getd
    3.0A Cleaned up some code
    3.0B Moved Menu Generation to fix Map Count not showing
    3.0C Actually Added RoDex Support now
    3.0D Fixed Map Menu Generation
    3.0E Fixed sql query
    3.0F Cleaned Code a bit
    3.10 Did more Cleaned Code a bit
    3.11 Fixed a logic bug in GM reset
    3.12 Added Waiting Room
    3.13 Added Dynamic Waiting Room
    3.14 Moved and added more At_Commands
    3.15 Dynamic Waiting Room (&4096) require Waiting Room (&2048) to work
    3.16 Increased Waiting Room Rotation Time
    3.17 Fixed Typos in Reset PVP Stats
    3.18 Removed unnessisary next, creating hang screens
    3.19 Made compatable with new mail command
    3.1A Reformatted Rewards in conf to support 5 items
     

    Links:

     

    hello! about the Monthly PVP Ladder option in the script...
    i'm getting [-1 kills ] and [0 deaths]

    instead of [0 kills ] and [1 death]

    how to fix this please.
    KDA disabled

  16. anyone know how to fix this?

    [Error]: status_read_soullink_db: Cannot load custom soul link buffs from db/soul_link.yml.
    [Info]: status_read_soullink_db: Done reading 0 custom soul links.

    Edit: Fixed

     

    Uh.. another problem...
    is the autobonus3 not working in the soul_link.yml?

    i got these effect working in the item_db.txt, then move it to the soul_link.yml, but it's not working anymore.

    autobonus3 "{ bonus bStr,10; bonus bDex,10; bonus bFlee,15; }",1000,158400,459,"{ }";
    autobonus3 "{ if(getskilllv(486)==5) { bonus bAtkRate,200; } }",1000,180000,486,"{ }";

    any help on this please.

  17. 14 minutes ago, sotf said:

    Wow hi okay, I made this long ago! Haha anyways, replace all .delay with #delay and try again.

     

    yeah 7 years ago, it's my first time creating a server, and saw this when i'm searching for a broadcast npc. didn't expect you to reply this fast tho. xD

    it worked! thanks a lot man!!

  18. On 12/7/2013 at 8:30 PM, sotf said:

    Hi rAthena! I'm here to share a Broadcast Script that I edited.

     

    ( original thread: http://rathena.org/board/topic/66794-broadcaster/ )

    
    //Broadcast NPC
    prontera,159,181,5	script	Broadcaster	858,{
    
    if (.delay > gettimetick(2)) {
        mes "=============================";
    	mes "Wait for 2 minutes to pass before you can use this service again.";
    	mes "=============================";
        close;
    }
    
    mes "=============================";
    mes "Broadcast Fee:";
    mes "Normal Color(white): 90,000z";
    mes "Custom Color: 150,000z";
    mes "Random Color: 100,000z";
    mes "=============================";
    mes "Cooldown: 2 minutes";
    mes "=============================";
    menu "Broadcast",yes,"Cancel",no;
    
    	yes:
    	if(Zeny < 100000) goto nozeny;
    	next;
    	mes "=============================";
    	mes "Select broadcast type:";
    	mes "=============================";
    	menu "Normal",normal,"Custom Color",custom,"Random Color",random,"Cancel",-;
    	next;
    	mes "=============================";
    	mes "Broadcast Cancelled.";
    	mes "=============================";
    	close;
    
    		normal:
    		next;
    		mes "=============================";
    		mes "Input message:";
    		mes "=============================";
    		input @message$;
    		set Zeny,Zeny-90000;
    		announce "[Shout] "+strcharinfo(0)+": "+@message$+" ",bc_all,0xFFFFFF;
    		set .delay, gettimetick(2) + 120;
    		close;
    		
    		custom:
    		next;
    		mes "=============================";
    		mes "Input Color:";
    		mes "^ffffff.^000000";
    		mes "Format: ^ff0000XX^00ff00YY^0000ffZZ^000000";
    		mes "VALUES MUST BE 0123456789ABCDEF ONLY";
    		mes "=============================";
    		input @color$;
    		if(getstrlen(@color$) == 6) {
    			set @scolor$,substr(""+@color$+"", 0,5);
    			set .z1$,substr(""+@scolor$+"", 0,0);
    			set .z2$,substr(""+@scolor$+"", 1,1);
    			set .z3$,substr(""+@scolor$+"", 2,2);
    			set .z4$,substr(""+@scolor$+"", 3,3);
    			set .z5$,substr(""+@scolor$+"", 4,4);
    			set .z6$,substr(""+@scolor$+"", 5,5);
    			next;
    			if( .z1$ == "1" || .z1$ == "2" || .z1$ == "3" || .z1$ == "4" || .z1$ == "5" || .z1$ == "6" || .z1$ == "7" || .z1$ == "8" || .z1$ == "9" || .z1$ == "0" || .z1$ == "a" || .z1$ == "b" || .z1$ == "c" || .z1$ == "d" || .z1$ == "e" || .z1$ == "f" )
    			
    			{if( .z2$ == "1" || .z2$ == "2" || .z2$ == "3" || .z2$ == "4" || .z2$ == "5" || .z2$ == "6" || .z2$ == "7" || .z2$ == "8" || .z2$ == "9" || .z2$ == "0" || .z2$ == "a" || .z2$ == "b" || .z2$ == "c" || .z2$ == "d" || .z2$ == "e" || .z2$ == "f" )
    			
    			{if( .z3$ == "1" || .z3$ == "2" || .z3$ == "3" || .z3$ == "4" || .z3$ == "5" || .z3$ == "6" || .z3$ == "7" || .z3$ == "8" || .z3$ == "9" || .z3$ == "0" || .z3$ == "a" || .z3$ == "b" || .z3$ == "c" || .z3$ == "d" || .z3$ == "e" || .z3$ == "f" )
    			
    			{if( .z4$ == "1" || .z4$ == "2" || .z4$ == "3" || .z4$ == "4" || .z4$ == "5" || .z4$ == "6" || .z4$ == "7" || .z4$ == "8" || .z4$ == "9" || .z4$ == "0" || .z4$ == "a" || .z4$ == "b" || .z4$ == "c" || .z4$ == "d" || .z4$ == "e" || .z4$ == "f" )
    			
    			{if( .z5$ == "1" || .z5$ == "2" || .z5$ == "3" || .z5$ == "4" || .z5$ == "5" || .z5$ == "6" || .z5$ == "7" || .z5$ == "8" || .z5$ == "9" || .z5$ == "0" || .z5$ == "a" || .z5$ == "b" || .z5$ == "c" || .z5$ == "d" || .z5$ == "e" || .z5$ == "f" )
    			
    			{if( .z6$ == "1" || .z6$ == "2" || .z6$ == "3" || .z6$ == "4" || .z6$ == "5" || .z6$ == "6" || .z6$ == "7" || .z6$ == "8" || .z6$ == "9" || .z6$ == "0" || .z6$ == "a" || .z6$ == "b" || .z6$ == "c" || .z6$ == "d" || .z6$ == "e" || .z6$ == "f" )
    									goto zcustom;} else { goto xcustom; }} else { goto xcustom; }} else { goto xcustom; }} else { goto xcustom; }}
    				
    
    				
    			else { goto xcustom; }
    			
    
    			close; }
    		else { goto xcustom; }
    		close;
    
    		random:
    		next;
    		set .random1, rand(0,15);
    		set .random2, rand(0,15);
    		set .random3, rand(0,15);
    		set .random4, rand(0,15);
    		set .random5, rand(0,15);
    		set .random6, rand(0,15);
    		set .c1$, charat("1234567890abcdef", .random1);
    		set .c2$, charat("1234567890abcdef", .random2);
    		set .c3$, charat("1234567890abcdef", .random3);
    		set .c4$, charat("1234567890abcdef", .random4);
    		set .c5$, charat("1234567890abcdef", .random5);
    		set .c6$, charat("1234567890abcdef", .random6);
    		mes "=============================";
    		mes "Your message will be in RANDOM COLOR";
    		mes "Input message:";
    		mes "=============================";
    		input @message$;
    		set Zeny,Zeny-100000;
    		atcommand "@kamic "+.c1$+""+.c2$+""+.c3$+""+.c4$+""+.c5$+""+.c6$+" [Shout] "+strcharinfo(0)+": "+@message$+" ";
    		set .delay, gettimetick(2) + 120;
    		close;
    
    	no:
    	next;
    	mes "=============================";
    	mes "Broadcast Cancelled";
    	mes "=============================";
    	close;
    	
    	zcustom:
    	next;
    	mes "=============================";
    	mes "Input message:";
    	mes "=============================";
    	input @message$;
    	set Zeny,Zeny-150000;
    	atcommand "@kamic "+@scolor$+" [Shout] "+strcharinfo(0)+": "+@message$+" ";
    	set .delay, gettimetick(2) + 120;
    	close;
    	
    	xcustom:
    	next;
    	mes "=============================";
    	mes "Wrong Format.";
    	mes "=============================";
    	close;
    
    	nozeny:
    	next;
    	mes "=============================";
    	mes "Not enough Zeny";
    	mes "=============================";
    	close;
    
    	end;
    }

    Features:

     

    - 3 types of broadcast:

    • Normal : white color broadcast
    • Custom: you'll have to input the color that you want (RRGGBB format)
    • Random: the NPC will choose a random color for you

    - Delay after another usage (2 minutes)

     

    broadcast will look like this:

     

    The script is quite long due to the fact that I have to restrict the usage of other characters other from 1234567890abcdef because I have to use this:

     

     

    If anyone knows how to minimize that part of the code(the z variables part), it would be great :D

    Please do let me know how can I make this script better.

     

    My edit is a bit amatuer-ish, I know. But I hope you like it :D

     

    broadcastnpc.txt 5 kB · 229 downloads

    thanks for this! it's working quite fine.
    but i have a concern, i think i can't broadcast for 3 minutes using second account after i broadcast using first account.

  19. 4 hours ago, pueblodefairy said:

    emulator/ renewal/ conf / battle / client

    // Save body styles. (Note 1)
    // Note: Don't turn this on unless you know what you are doing.
    // Sprites are not released officially.
    save_body_style: yes

     

    oh thanks! it worked.

×
×
  • Create New...