Jump to content

topechi

Members
  • Posts

    52
  • Joined

  • Last visited

Posts posted by topechi

  1. 12 hours ago, Emistry said:
    
    	announce("Free for all will start in 1 minute.", bc_all, .ANNOUNCE_COLOR$);
    	sleep(60000);

    change to

    
    	for ( .@i = 3; .@i > 0; .@i-- ) {
    		announce("Free for all will start in "+.@i+" minute.", bc_all, .ANNOUNCE_COLOR$);
    		sleep(60000);
    	}

     

    Thanks sir. Ill try it out.

  2. Hello! Can i ask a little help with this Party vs. Party Script please? i wanted to add an announce on it. After the match, i wanted the npc to announce that the match has ended, congratulate the winner then the npc is open for match registration again. Thanks in advance and godbless!

    -	script	init	-1,{
    		
    OnInit:
    
    	//== CONFIG START ==//
    	set $@charsymbol$,"#";									// Set the symbol of your char command ex. #
    	
    	set $@npcname$,"^009966War Organizer^000000";						// Set NPC name
    	set $@party_mem,7;									// Set minimum members per party, if a party has 6 members below including the leader, leader can't register his/her party
    	set $@arena_map$,"guild_vs3";								// Set where you want the players to battle
    	
    	set $@team1_arena_mapX,15;								// Set the starting X position of Team 1
    	set $@team1_arena_mapY,49;								// Set the starting Y position of Team 1
    	
    	set $@team2_arena_mapX,85;								// Set the starting X position of Team 2
    	set $@team2_arena_mapY,49;								// Set the starting Y position of Team 2
    	
    	set $@starting_map$,"quiz_02";								// Set where you want the players to be warped after the player was killed.
    	set $@starting_mapX,350;
    	set $@starting_mapY,379;
    
    	//== Set Winning Party Rewards ==//
    	set $@reward_winitem_qnty,0;								// Important, set to how many reward items you set below for the winning party
    	setarray $@win_itemid[0],0;								// Set the item id of the reward item
    	setarray $@win_itemname$[0],"Red Potion",						// Set the name of the reward item
    								"Orange Potion",
    								"Yellow Potion",
    								"White Potion",
    								"Blue Potion";
    								
    	setarray $@win_itemnum[0],0;								// Set the quantity of the reward
    	
    	//== Set Losing Party Rewards ==//
    	set $@reward_loseitem_qnty,0;								// Important, set to how many reward items you set below for losing party
    	setarray $@lse_itemid[0],0;								// Set the item id of the reward item
    	setarray $@lse_itemname$[0],"Red Potion",						// Set the name of the reward item
    								"Orange Potion";
    	setarray $@lse_itemnum[0],0;								// Set the quantity of the reward
    	
    	//== Set Draw Rewards ==//
    	set $@reward_drawitem_qnty,0;								// Important, set to how many reward items you set below for draw result
    	setarray $@drw_itemid[0],0;								// Set the item id of the reward item
    	setarray $@drw_itemname$[0],"Yellow Potion",						// Set the name of the reward item
    								"White Potion";
    	setarray $@drw_itemnum[0],0;								// Set the quantity of the reward
    	
    	//== CONFIG END ==//
    	
    	// Do not change configs below, this will reset in case the server unexpectedly shuts down
    	set $@Battle_Start,0;
    	set $@party_team,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    
    	    // RWC 3
                enablenpc "WALL#41";
                enablenpc "WALL#42";
                enablenpc "WALL#43";
                enablenpc "WALL#44";
                enablenpc "WALL#45";
                enablenpc "WALL#46";
                enablenpc "WALL#47";
                enablenpc "WALL#48";
                enablenpc "WALL#49";
                enablenpc "WALL#50";
                enablenpc "WALL#51";
                enablenpc "WALL#52";
                enablenpc "WALL#53";
                enablenpc "WALL#54";
                enablenpc "WALL#55";
                enablenpc "WALL#56";
                enablenpc "WALL#57";
                enablenpc "WALL#58";
                enablenpc "WALL#59";
                enablenpc "WALL#60";
                enablenpc "WALL#61";
                enablenpc "WALL#62";
                enablenpc "WALL#63";
                enablenpc "WALL#64";
    
    	// Now let's check if the event is on going or not (checks current server's time)
    	// if the event is on going, Enable NPC and sends a message to the player upon logging in
    	
    	for(set .@q,0; .@q<=22; set .@q,.@q+2) {
    		set .@count,.@count+1;
    		if(gettime(3)>.@q && gettime(3)<=.@count) {
    			set $@evt_start,1;
    			enablenpc "PartyReg";
    		}
    		set .@count,.@count+1;
    	}
    	end;
    }
    
    // Party Registration NPC
    
    quiz_02,350,389,3	script	Party Registration::PartyReg	89,{
    	
    	mes "["+$@npcname$+"]";
    	if(($@Battle_Start && getcharid(1)==$@party_team1) || ($@Battle_Start && getcharid(1)==$@party_team2) ) { mes "Hmm... Too bad for you, you didn't make it to win for your party. Cheer them up instead."; close; }
    	if($@Battle_Start || $@party_team>=2) {
    		mes "Battle is currently on";
    		mes "going. Party registration is";
    		mes "close during this time.";
    		next;
    		if(select("> Check current battle info.:> Leave") == 2){
    			mes "["+$@npcname$+"]";
    			mes "Come back to me and register your party after the battle between "+getpartyname($@party_team1)+" and "+getpartyname($@party_team2)+" has ended.";
    			close;
    		}
    		mes "["+$@npcname$+"]";
    		if(!$@Battle_Start) { mes "The Battle already ended."; close; }
    		set @standing_mem1,$@party_mem-$team2_mem;
    		set @standing_mem2,$@party_mem-$team1_mem;
    		mes "Battle Information";
    		mes "---";
    		mes "- " + getpartyname($@party_team1) + " Party : ";
    		mes "Standing Members Left : " + @standing_mem1;
    		mes "---";
    		mes "- " + getpartyname($@party_team2) + " Party : ";
    		mes "Standing Members Left : " + @standing_mem2; 
    		next;
    		mes "["+$@npcname$+"]";
    		if($team1_mem>$team2_mem) {
    			mes "Current leading party is "+getpartyname($@party_team1);
    			close;
    		} else if($team1_mem<$team2_mem) {
    			mes "Current leading party is "+getpartyname($@party_team2);
    			close;
    		} else {
    			mes "Both Party has the same number of members that are still alive.";
    			close;
    		}
    	}
    	if(getcharid(1)==0) goto L_ContinueMain;
    	if(getcharid(1)==$@party_team1 || getcharid(1)==$@party_team2) { mes getpartyleader(getcharid(1)) + ", your party leader already registered your party, please wait for the other team to register."; close; }
    L_ContinueMain:
    	mes "Welcome "+strcharinfo(0)+"!";
    	mes "I am the War Arena Organizer";
    
    	next;
    	switch(select("> Register")) {
    		case 1:	callsub R_Party;
    	}
    R_Party:
    
    	mes "["+$@npcname$+"]";
            if ( callfunc("party_has_duplicate_job") ) {
                    mes "It seems that someone in the party has the same class than another member. Please check again the requirements...";
                    close;
            }
    
            if ( $@partymembercount != 7 ) {
                    mes "You have to be 7 on the team.";
                    close;
    	}
    	if(getcharid(1)==0) { mes "I see that you have no party yet. Please form your party first before registering."; close; }
    	mes "Party Name : "+strcharinfo(1);
    	if(getpartyleader(getcharid(1),2)==getcharid(0)) {
    		mes "Party Leader : You";
    	} else {
    		mes "Party Leader : "+getpartyleader(getcharid(1));
    	}
    	mes "-";
    	getpartymember(getcharid(1));
    	set @partymembercount,$@partymembercount;
    	copyarray @partymembername$[0],$@partymembername$[0],@partymembercount;
    	set @countmem,0;
    
    L_DisplayMem:
    	if(@countmem == @partymembercount) goto L_Continue;
    	set @countmem,@countmem+1;
    	goto L_DisplayMem;
    L_Continue:
    	mes "Party Members ("+(@countmem)+"/"+$@party_mem+")";
    	set @count,0;
    
    L_DisplayMember:
    	if(@count == @partymembercount) goto L_Continue2;
    	mes (@count + 1) + ". ^0000FF" + @partymembername$[@count] + "^000000";
    	set @count,@count+1;
    	goto L_DisplayMember;
    L_Continue2:
    	if($@Battle_Start || $@party_team>=2) { next; mes "Sorry but party registration is now close. Please re-register after the current battle progress has ended."; close; }
    	if(getpartyleader(getcharid(1),2)!=getcharid(0)) { next; mes strcharinfo(0)+", If you have time, please find your Party Leader "+getpartyleader(getcharid(1))+" and let him/her register your party"; close; }
    	if(@countmem>$@party_mem) { next; mes "This event requires you to form a party with only "+$@party_mem+" members including you. I'm sorry to say but you need to expel ^FF0000"+(@countmem-$@party_mem)+"^000000 more member(s)."; close; }
    	if(@countmem<$@party_mem) { next; mes "This event requires you to form a party with "+$@party_mem+" members including you. You still need to recruit ^FF0000"+($@party_mem-@countmem)+"^000000 more member(s)."; close; }
    	set $@party_team,$@party_team+1;
    	if($@party_team==1) {
    		set $@party_team1,getcharid(1);
    		setarray $@mem_name1$[0],@partymembername$[0],@partymembername$[1],@partymembername$[2],@partymembername$[3],@partymembername$[4];
    		announce "Team "+getpartyname($@party_team1)+" registered on Team "+$@party_team+".",bc_all;
    		goto L_Continue3;
    	}
    	if($@party_team==2) {
    		set $@party_team2,getcharid(1);
    		announce "Team "+getpartyname($@party_team2)+" registered on Team "+$@party_team+".",bc_all;
    		setarray $@mem_name2$[0],@partymembername$[0],@partymembername$[1],@partymembername$[2],@partymembername$[3],@partymembername$[4];
    		goto L_Continue3;
    	}
    
    L_Continue3:
    	close2;
    	if($@party_team==2) donpcevent "PvP_Func::OnStart";
    	end;
    
    OnPCDieEvent:
    
    	getmapxy @map$,@x,@y,0;
    	
    	if($@Battle_Start && @map$==$@arena_map$ && getcharid(1)==$@party_team1) {
    		set $team2_mem,$team2_mem+1;
    		warp $@starting_map$,$@starting_mapX,$@starting_mapY;
    		if($team2_mem==$@party_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnTeam2Win2";
    		}
    		end;
    	}
    	if($@Battle_Start && @map$==$@arena_map$ && getcharid(1)==$@party_team2) {
    		set $team1_mem,$team1_mem+1;
    		warp $@starting_map$,$@starting_mapX,$@starting_mapY;
    		if($team1_mem==$@party_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnTeam1Win2";
    		}
    		end;
    	}
    	
    OnPCLogoutEvent:
    
    	getmapxy @map$,@x,@y,0;
    	
    	if($@Battle_Start && @map$==$@arena_map$ && getcharid(1)==$@party_team1) {
    		warp $@starting_map$,$@starting_mapX,$@starting_mapY;
    		set $team2_mem,$team2_mem+1;
    		mapannounce $@arena_map$,"User "+strcharinfo(0)+" of "+getpartyname($@party_team1)+" Team logged out of the game.",bc_all;
    		if($team2_mem==$@party_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnTeam2Win2";
    		}
    		end;
    	}
    	if($@Battle_Start && @map$==$@arena_map$ && getcharid(1)==$@party_team2) {
    		warp $@starting_map$,$@starting_mapX,$@starting_mapY;
    		set $team1_mem,$team1_mem+1;
    		mapannounce $@arena_map$,"User "+strcharinfo(0)+" of "+getpartyname($@party_team2)+" Team logged out of the game.",bc_all;
    		if($team1_mem==$@party_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnTeam1Win2";
    		}
    		end;
    	}
    	
    OnPCLoadMapEvent:
    
    	getmapxy @map$,@x,@y,0;
    	
    	if($@Battle_Start && @map$!=$@arena_map$ && getcharid(1)==$@party_team1) {
    		warp $@starting_map$,$@starting_mapX,$@starting_mapY;
    		set $team2_mem,$team2_mem+1;
    		mapannounce $@arena_map$,""+strcharinfo(0)+" of "+getpartyname($@party_team1)+" party warped out of the battle arena.",bc_blue;
    		if($team2_mem==$@party_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnTeam2Win2";
    		}
    		end;
    	}
    	if($@Battle_Start && @map$!=$@arena_map$ && getcharid(1)==$@party_team2) {
    		warp $@starting_map$,$@starting_mapX,$@starting_mapY;
    		set $team1_mem,$team1_mem+1;
    		mapannounce $@arena_map$,""+strcharinfo(0)+" of "+getpartyname($@party_team2)+" party warped out of the battle arena.",bc_blue;
    		if($team1_mem==$@party_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnTeam1Win2";
    		}
    		end;
    	}
    
    }
    
    // Script where all functions are stored
    
    -	script	PvP_Func	-1,{
    
    OnStart:
    
    	initnpctimer;
    	set $@Battle_Start,1;
    	setcell $@arena_map$,80,55,80,44,cell_walkable,0;
    	setcell $@arena_map$,19,55,19,44,cell_walkable,0;
    	announce "The Battle between  "+getpartyname($@party_team1)+" and "+getpartyname($@party_team2)+" Party has engaged. Registered Party along with its members will be automatically warped to the arena after 10 seconds.",bc_all;
    	gvgoff $@arena_map$;
    	setnpctimer 0;
    	startnpctimer;
    	end;
    	
    OnTimer5000:
    
    	warpparty $@arena_map$,$@team1_arena_mapX,$@team1_arena_mapY,$@party_team1;
    	warpparty $@arena_map$,$@team2_arena_mapX,$@team1_arena_mapY,$@party_team2;
    	end;
    OnTimer30000:
    	mapannounce $@arena_map$,"Players, you only have 30 seconds left to prepare for the Battle.",bc_all;
    	end;
    OnTimer50000:
    	mapannounce $@arena_map$,"The Battle will begin in 5 seconds.",bc_all;
    	end;
    OnTimer51000:
    	mapannounce $@arena_map$,"The Battle will begin in 4 seconds.",bc_all;
    	end;
    OnTimer52000:
    	mapannounce $@arena_map$,"The Battle will begin in 3 seconds.",bc_all;
    	end;
    OnTimer53000:
    	mapannounce $@arena_map$,"The Battle will begin in 2 seconds.",bc_all;
    	end;
    OnTimer54000:
    	mapannounce $@arena_map$,"The Battle will begin in 1 second.",bc_all;
    	end;
    OnTimer55000:
    	gvgon $@arena_map$;
    	setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    	setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    
    		    disablenpc "WALL#41";
    		    disablenpc "WALL#42";
    		    disablenpc "WALL#43";
    		    disablenpc "WALL#44";
    		    disablenpc "WALL#45";
    		    disablenpc "WALL#46";
    		    disablenpc "WALL#47";
    		    disablenpc "WALL#48";
    		    disablenpc "WALL#49";
    		    disablenpc "WALL#50";
    		    disablenpc "WALL#51";
    		    disablenpc "WALL#52";
    		    disablenpc "WALL#53";
    		    disablenpc "WALL#54";
    		    disablenpc "WALL#55";
    		    disablenpc "WALL#56";
    		    disablenpc "WALL#57";
    		    disablenpc "WALL#58";
    		    disablenpc "WALL#59";
    		    disablenpc "WALL#60";
    		    disablenpc "WALL#61";
    		    disablenpc "WALL#62";
    		    disablenpc "WALL#63";
    		    disablenpc "WALL#64";
    
    	announce "The team "+getpartyname($@party_team1)+" vs "+getpartyname($@party_team2)+" battle has begun!",bc_all;
    	mapannounce $@arena_map$,"You only have 5 minutes to eliminate all opponent's party members. Be quick!!!",bc_all;
    	end;
    	
    	// After 5 Minutes, system will check the party who has the most number of member and will declare that party as a winner.
    	// All variables will be resetted.
    OnTimer420000:
    
    	if($team2_mem<$team1_mem) {
    		donpcevent "PvP_Func::OnTeam1Win";
    	} else if ($team2_mem<$team1_mem) {
    		donpcevent "PvP_Func::OnTeam2Win";
    	} else if ($team2_mem==$team1_mem || $team1_mem==$team2_mem) {
    		donpcevent "PvP_Func::OnDraw";
    	} else {
    		donpcevent "PvP_Func::OnNoWin";
    	}
    	end;
    
    	// This label will be called after the event has ended without registered parties
    OnNoWin:
    
    	announce "The Battle has ended.",bc_all;
    	gvgoff $@arena_map$;
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    OnEndNoWin:
    
    	announce "The Battle has ended.",bc_all;
    	gvgoff $@arena_map$;
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	set $@evt_start,0;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    OnDraw:
    	announce "Team "+getpartyname($@party_team1)+" and Team "+getpartyname($@party_team2)+" has the same number of members standing in the arena, the battle result is a draw.",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_drawitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@drw_itemid[.@j]+" "+$@drw_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_drawitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@drw_itemid[.@j]+" "+$@drw_itemnum[.@j]+"";
    		}
    	}
    	stopnpctimer;
    	gvgoff $@arena_map$;
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    OnEndDraw:
    	announce "Team "+getpartyname($@party_team1)+" and Team "+getpartyname($@party_team2)+" has the same number of members standing in the arena, the battle result is a draw.",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_drawitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@drw_itemid[.@j]+" "+$@drw_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_drawitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@drw_itemid[.@j]+" "+$@drw_itemnum[.@j]+"";
    		}
    	}
    	stopnpctimer;
    	gvgoff $@arena_map$;
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	set $@evt_start,0;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    OnTeam1Win:
    
    	announce "After 5 minutes of battle, "+getpartyname($@party_team1)+" party member survives more than "+getpartyname($@party_team2)+" party member and won the Battle!",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_winitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@win_itemid[.@j]+" "+$@win_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_loseitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@lse_itemid[.@j]+" "+$@lse_itemnum[.@j]+"";
    		}
    	}
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	gvgoff $@arena_map$;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    OnEndTeam1Win:
    
    	announce "After 5 minutes of battle, "+getpartyname($@party_team1)+" party member survives more than "+getpartyname($@party_team2)+" party member and won the Battle!",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_winitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@win_itemid[.@j]+" "+$@win_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_loseitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@lse_itemid[.@j]+" "+$@lse_itemnum[.@j]+"";
    		}
    	}
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	set $@evt_start,0;
    	gvgoff $@arena_map$;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    
    OnTeam2Win:
    
    	announce "After 5 minutes of battle, "+getpartyname($@party_team2)+" party member survives more than "+getpartyname($@party_team1)+" party member and won the Battle!",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_winitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@win_itemid[.@j]+" "+$@win_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_loseitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@lse_itemid[.@j]+" "+$@lse_itemnum[.@j]+"";
    		}
    	}
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	gvgoff $@arena_map$;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    OnEndTeam2Win:
    
    	announce "After 5 minutes of battle, "+getpartyname($@party_team2)+" party member survives more than "+getpartyname($@party_team1)+"'s Party member and won the Battle!",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_winitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@win_itemid[.@j]+" "+$@win_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_loseitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@lse_itemid[.@j]+" "+$@lse_itemnum[.@j]+"";
    		}
    	}
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	set $@evt_start,0;
    	disablenpc "PartyReg";
    	gvgoff $@arena_map$;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    	
    OnTeam1Win2:
    
    	announce "Team "+getpartyname($@party_team1)+" smashed all the member of Team "+getpartyname($@party_team2)+" and won the Battle!",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_winitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@win_itemid[.@j]+" "+$@win_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_loseitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@lse_itemid[.@j]+" "+$@lse_itemnum[.@j]+"";
    		}
    	}
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	gvgoff $@arena_map$;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    
    OnTeam2Win2:
    
    	announce "Team "+getpartyname($@party_team2)+" smashed all the member of Team "+getpartyname($@party_team1)+"and won the Battle!",bc_all;
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_winitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name2$[.@i]+" "+$@win_itemid[.@j]+" "+$@win_itemnum[.@j]+"";
    		}
    	}
    	for(set .@i,0; .@i<$@party_mem; set .@i,.@i+1) {
    		for(set .@j,0; .@j<$@reward_loseitem_qnty; set .@j,.@j+1) {
    			charcommand ""+$@charsymbol$+"item "+$@mem_name1$[.@i]+" "+$@lse_itemid[.@j]+" "+$@lse_itemnum[.@j]+"";
    		}
    	}
    	set $@party_team,0;
    	set $@Battle_Start,0;
    	set $team1_mem,0;
    	set $team2_mem,0;
    	set $@party_team1,0;
    	set $@party_team2,0;
    	gvgoff $@arena_map$;
    
    	    	    setcell "guild_vs3",19,55,19,44,cell_walkable,0;
                        setcell "guild_vs3",80,55,80,44,cell_walkable,0;
    		    enablenpc "WALL#41";
    		    enablenpc "WALL#42";
    		    enablenpc "WALL#43";
    		    enablenpc "WALL#44";
    		    enablenpc "WALL#45";
    		    enablenpc "WALL#46";
    		    enablenpc "WALL#47";
    		    enablenpc "WALL#48";
    		    enablenpc "WALL#49";
    		    enablenpc "WALL#50";
    		    enablenpc "WALL#51";
    		    enablenpc "WALL#52";
    		    enablenpc "WALL#53";
    		    enablenpc "WALL#54";
    		    enablenpc "WALL#55";
    		    enablenpc "WALL#56";
    		    enablenpc "WALL#57";
    		    enablenpc "WALL#58";
    		    enablenpc "WALL#59";
    		    enablenpc "WALL#60";
    		    enablenpc "WALL#61";
    		    enablenpc "WALL#62";
    		    enablenpc "WALL#63";
    		    enablenpc "WALL#64";
    
    	stopnpctimer;
    	sleep2 10000;
    	areawarp $@arena_map$,12,87,87,12,$@starting_map$,$@starting_mapX,$@starting_mapY;
    	end;
    	
    }
    
    function	script	StartEvent	{
    		enablenpc "PartyReg";
    		set $@evt_start,1;
    		announce "The Battle has begun.",bc_all;
    		return;
    }
    
    function	script	EndEvent	{
    		if (!$@Battle_Start && $@party_team<2) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnEndNoWin";
    		} else if ($team2_mem<$team1_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnEndTeam1Win";
    		} else if ($team2_mem<$team1_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnEndTeam2Win";
    		} else if ($team2_mem==$team1_mem || $team1_mem==$team2_mem) {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnEndDraw";
    		} else {
    			setcell $@arena_map$,80,55,80,44,cell_walkable,1;
    			setcell $@arena_map$,19,55,19,44,cell_walkable,1;
    			donpcevent "PvP_Func::OnEndNoWin";
    		}
    		end;
    
    }
    
    ////////////////////////////////////////////////////////////////////////////
    ////RWC 3///////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////
        guild_vs3,19,55,0	script	WALL#41	1905,{
        }
        guild_vs3,19,54,0	duplicate(WALL#41)	WALL#42	1905
        guild_vs3,19,53,0	duplicate(WALL#41)	WALL#43	1905
        guild_vs3,19,52,0	duplicate(WALL#41)	WALL#44	1905
        guild_vs3,19,51,0	duplicate(WALL#41)	WALL#45	1905
        guild_vs3,19,50,0	duplicate(WALL#41)	WALL#46	1905
        guild_vs3,19,49,0	duplicate(WALL#41)	WALL#47	1905
        guild_vs3,19,48,0	duplicate(WALL#41)	WALL#48	1905
        guild_vs3,19,47,0	duplicate(WALL#41)	WALL#49	1905
        guild_vs3,19,46,0	duplicate(WALL#41)	WALL#50	1905
        guild_vs3,19,45,0	duplicate(WALL#41)	WALL#51	1905
        guild_vs3,19,44,0	duplicate(WALL#41)	WALL#52	1905
    
        guild_vs3,80,55,0	duplicate(WALL#41)	WALL#53	1905
        guild_vs3,80,54,0	duplicate(WALL#41)	WALL#54	1905
        guild_vs3,80,53,0	duplicate(WALL#41)	WALL#55	1905
        guild_vs3,80,52,0	duplicate(WALL#41)	WALL#56	1905
        guild_vs3,80,51,0	duplicate(WALL#41)	WALL#57	1905
        guild_vs3,80,50,0	duplicate(WALL#41)	WALL#58	1905
        guild_vs3,80,49,0	duplicate(WALL#41)	WALL#59	1905
        guild_vs3,80,48,0	duplicate(WALL#41)	WALL#60	1905
        guild_vs3,80,47,0	duplicate(WALL#41)	WALL#61	1905
        guild_vs3,80,46,0	duplicate(WALL#41)	WALL#62	1905
        guild_vs3,80,45,0	duplicate(WALL#41)	WALL#63	1905
        guild_vs3,80,44,0	duplicate(WALL#41)	WALL#64	1905
    
    function	script	party_has_duplicate_job	{
            set .@party_id, getarg( 0, getcharid(1) );
    
            // Need to have a party.
            if ( !.@party_id )
            {
                            return -1;
            }
    
            // Loading party members variables
            getpartymember .@party_id, 1;
            getpartymember .@party_id, 2;
    
            // Keep rid attached.
            set .@rid, playerattached();
    
    
            // Check all members
            for ( set .@i,0; .@i<$@partymembercount; set .@i, .@i+1 )
            {
    
                    // Online user
                    if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i]) )
                    {
                            // Attach the member to access "Class"
                            attachrid( $@partymemberaid[.@i] );
                            if ( compare( .@tmp_class$ + "|", "|" + Class + "|" ) )
                            {
                                    if ( .@rid )
                                            attachrid(.@rid);
                                    else
                                            detachrid;
                                    return 1;
                            }
                            set .@tmp_class$, .@tmp_class$ + "|" + Class;
                    }
    
                    // Offline user (use sql)
                    else
                    {
                            set .@sql$, .@sql$ + ( .@sql_i ? "OR " : "" ) + "`char_id`='" + $@partymembercid[.@i] + "' ";
                            set .@sql_i, .@sql_i + 1;
                    }
            }
    
            // SQL for offline users
            if ( getstrlen(.@sql$) )
            {
                    // get class from offline members
                    set .@count, query_sql("SELECT `class` FROM `char` WHERE " + .@sql$, .@class );
    
                    // Check the class.
                    for ( set .@i, 0; .@i<.@count; set .@i, .@i+1 )
                    {
                            if ( compare( .@tmp_class$ + "|", "|" + .@class[.@i] + "|" ) )
                            {
                                    if ( .@rid )
                                            attachrid(.@rid);
                                    else
                                            detachrid;
                                    return 1;
                            }
                            set .@tmp_class$, .@tmp_class$ + "|" + .@class[.@i];
                    }
            }
    
    
            // Restore RID.
            if ( .@rid )
                    attachrid(.@rid);
            else
                    detachrid;
    
            return 0;
    }
    
    -	script	RWC	-1,{
        // Settings
        // GM LVL Allowed
        set .gmlvl,99;
    
        OnWhisperGlobal:
                if(getgmlevel() <= .gmlvl) goto N_Authority;
    		switch(select("Reset:")) {
    	    case 1:
    		stopnpctimer;
    		gvgoff $@arena_map$;
    		set $@party_team,0;
    		set $@Battle_Start,0;
    		set $team1_mem,0;
    		set $team2_mem,0;
    		set $@party_team1,0;
    		set $@party_team2,0;
    		set $@evt_start,0;
    		dispbottom "Reset OK.";
    		close;
    
        N_Authority:
                dispbottom "You cannot use this commands anymore.";
                close;
    }
    }

     

  3. Hi guys! I need some help with this FFA Script please. I was hoping if someone can edit it, players will have to register to the NPC and wait for a certain time for example 3mins before all registered players be warped to the FFA Arena? And if possible, to add a announcement of the winner and reset the npc after the match with announcement that the FFA is open for register. Thanks in advance! :)

    // -------------------------------------//
    // ----------- Free For All ------------//
    // ------------- By: Butch -------------//
    // ---------- Rewrite by: Bio ----------//
    //      A simple Free for all script    //
    // -------------------------------------//
    // ------------- Changelog -------------//
    // 1.0 - The one made by Butch.         //
    // 2.0 - Rewrite by Bio:                //
    //       Easy Configuration             //
    //       Use of Event Labels            //
    //       Added Min and Max Players      //
    // -------------------------------------//
     
     
    // -- FFA Core
    -	script	::ffa_core	FAKE_NPC,{
    	end();
    OnInit:
     
    	// -- Configuration
    	.WAITINGROOM_TEXT$ = "[Free For All]"; // Text to be displayed on Waiting Room
    	.MIN_PLAYER = 5; // How many Players are needed to start
    	.MAX_PLAYER = 0; // Maximum number of Players allowed. Must be higher than '1' (0 to disable this limit)
    	.REWARD_PLAYER = 1; // Reward Players? Use 0 or 1 (0: off / 1: on)
    	.REWARD_NAMEID = 25002; // Reward ID
    	.REWARD_AMOUNT = 1; // Reward Amount
    	.ANNOUNCE_COLOR$ = "0x00b89d"; // FFA announce's color
    	.WINNER_DISP_COLOR$ = "0x00FFFF"; // FFA winner announce's color
    	.ATCMD_NAME$ = "startffa"; // @name of atcommand to force start announce.
    	.ATCMD_LEVEL = 60; // Min GroupID which can use this command.
    	.ATCMD_CHRLV = 99; // Min GroupID which can use this char command.
     
    	// -- Initializing
    	bindatcmd(.ATCMD_NAME$,"ffa_core::OnStartEvent",.ATCMD_LEVEL, .ATCMD_CHRLV);
    	.STATUS = 0; // Info: 0 - Off | 1 - Waiting for start | 2 - Running
    	waitingroom(.WAITINGROOM_TEXT$, 0);
    	end();
     
    OnStartEvent:
    	.STATUS = 1;
    	announce("Free for all will start in 1 minute.", bc_all, .ANNOUNCE_COLOR$);
    	sleep(60000);
    	if ( getmapusers("guild_vs5") >= .MIN_PLAYER ) {
    		for ( .@i = 5; .@i > 0; .@i-- ) {
    			mapannounce("guild_vs5", sprintf("FFA starts in [%d]", .@i), .ANNOUNCE_COLOR$);
    		}
    		announce("guild_vs5", "FFA has started!! Go kill'em all!!", bc_all, .ANNOUNCE_COLOR$);
    		.STATUS = 2;
    		setmapflag("guild_vs5", mf_gvg);
    		removemapflag("guild_vs5", mf_noskill);
    		initnpctimer(); // Time Limit of 30 minutes
    		end();
    	}
    	// Else: Fall Through
     
    OnStopEvent:
    OnTimer1800000:
    	stopnpctimer();
    	.STATUS = 0;
    	removemapflag("guild_vs5", mf_gvg);
    	setmapflag("guild_vs5", mf_noskill);
    	mapwarp("guild_vs5", "prontera", 156, 149);
    	end();
     
    OnPCKillEvent:
    	if ( getmapusers("guild_vs5") != 1 )  {
    		announce(sprintf("FFA Current players - %d.", getmapusers("guild_vs5")), bc_self, .ANNOUNCE_COLOR$);
    	} else if ( getmapusers("guild_vs5") == 1 ) {
    		dispbottom("You are a winner of Event Free for all. Congratz!", .WINNER_DISP_COLOR$);
    		announce(sprintf("Free For All Winner: %s", strcharinfo(0)), bc_all, .WINNER_DISP_COLOR$);
    		getitem(.REWARD_NAMEID, .REWARD_AMOUNT);
    		mapwarp("guild_vs5", "prontera", 156, 149); // TODO: make dest map configurable (I'm too lazy to do it now haha)
    		donpcevent("ffa_core::OnStopEvent");
    	}
    	end(); // Common end command for conditions above.
     
    OnPCLoadMapEvent:
    	if ( strcharinfo(3) == "guild_vs5" ) {
    		if ( getmapusers("guild_vs5") >= .MIN_PLAYER && !.STATUS ) {
    			donpcevent("ffa_core::OnStartEvent");
    		}
    	}
    	end();
    }
     
    // ------ FFA Warper -------//        
    prontera,147,149,6	script	Free For All	999,{
     
        .STATUS = getvariableofnpc(.STATUS, "ffa_core");
        .MAX_PLAYER = getvariableofnpc(.MAX_PLAYER, "ffa_core");
     
        mes("[^FF0000Agent Mil^000000]");
        mes("What do you want?");
        next();
     
        .@choice = select("Enter ^FFA500FFA Arena^000000", "Nothing");
     
        if ( .@choice == 2 ) {
            mes("[^FF0000Agent Mil^000000]");
            mes("Okay, see you next time.");
        } else if ( .STATUS > 1 ) {
            mes("[^FF0000Agent Mil^000000]");
            mes("Entrance for Free for all is not available at the moment");
        } else if ( .MAX_PLAYER > 1 && getmapusers("guild_vs5") >= .MAX_PLAYER ) {
            mes("[^FF0000Agent Mil^000000]");
            mes("Maximum number of players reached, try again in next match.");
        } else {
            if ( getcharid(1) ) {
                mes("^ff0000* Please leave your party.");
                close;
            } else if ( getcharid(2) ) {
                mes("^ff0000* Please leave your guild.");
                close;
            } else {
                // TODO: Why use this coordinates if we want to warp randomly?
                // Isn't better replace this switch and warp with just 'warp("guild_vs5", 0, 0);'?
                switch (rand(3)) {
                    case 0: .@x = 18; .@y = 50; break;
                    case 1: .@x = 50; .@y = 77; break;
                    case 2: .@x = 81; .@y = 49; break;
                    case 3: .@x = 49; .@y = 22; break;
                }
                warp("guild_vs5", .@x, .@y);
            }
        }
        close(); // Common close command for all conditions above.
    }
     
    // -- Mapflags
    guild_vs5	mapflag	loadevent
    guild_vs5	mapflag	partylock
    guild_vs5	mapflag	guildlock
    guild_vs5	mapflag	notrade
    guild_vs5	mapflag	nodrop
  4. 20 hours ago, chatterboy said:
    
    // -----------------------------//
    // ------- Free For All --------//
    // -------- By : Butch ---------//
    // A simple Free for all script //
    // -----------------------------//
    
    guild_vs5,48,51,6	script	FFA Master	999,{
    if(getmapusers("guild_vs5") != 1) 
    	{
    		mes "[^FF0000FFA Master^000000]";
    		mes "Current players - ^FF0000"+ getmapusers("guild_vs5") +"^000000.";
    		close;
    	}
    	else if(getmapusers("guild_vs5") == 1)
    	{
    		
    		dispbottom "You are a winner of Event Free for all. Congratz!";
    		donpcevent "Free For All::OnStopEvent";
    		announce "Free for all winner : "+ strcharinfo(0) +"", bc_all, "0xFFCE00";
    		getitem 25002,1; // Reward
    		warp "prontera", 156,149;
    		end;
    	}
    }
    
    // ------ FFA Warper -------//
    		
    prontera,147,149,6	script	Free For All	999,{
    
    	if (.start != 1) {
    	mes "[^FF0000Agent Mil^000000]";
    	mes "Free for all is not available at the moment";
    	close;
    	}
    		mes "[^FF0000Agent Mil^000000]";
    		mes "What do you want?";
    		switch(select("Free for all")) {
    			case 1:
    				if( getcharid(1) ) { mes "Please leave your party."; close; }
    				if( getcharid(2) ) { mes "Please leave your guild."; close; }
    					else switch(rand(3)) {
    						case 0: .@x = 18; .@y = 50; break;
    						case 1: .@x = 50; .@y = 77; break;
    						case 2: .@x = 81; .@y = 49; break;
    						case 3: .@x = 49; .@y = 22; break; 
    					}
    					warp "guild_vs5", .@x,.@y;
    				break;				
    		}
    	close;
    	
    OnStartEvent:	
    OnClock1245:
    OnClock1645:
    OnClock2045:
    OnClock0045:
    OnClock0445:
    OnClock0845:
    	.start = 1;
    	disablenpc "FFA Master";
    	announce "Free for all will start in 5 minutes.", bc_all, "0x00b89d";
    	sleep 120000;
    	announce "Free for all will start in 3 minutes.", bc_all, "0x00b89d";
    	sleep 120000;
    	announce "Free for all will start in 1 minute.", bc_all, "0x00b89d";
    	sleep 60000;
    	announce "Free for all has started!", bc_all, "0x00b89d";
    	.start = 2;
    	enablenpc "FFA Master";
    	sleep 2000;
    	if ( !getmapusers("guild_vs5") ) goto OnStopEvent;
    	mapannounce "guild_vs5", "FFA starts in 5", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 4", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 3", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 2", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 1", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "GO! Kill all!", bc_map;
    	setmapflag "guild_vs5", mf_gvg;
    	removemapflag "guild_vs5", mf_noskill;
    	end;
    	
    OnStopEvent:
    	.start = 0;
    	disablenpc "FFA Master";
    	removemapflag "guild_vs5", mf_gvg;
    	setmapflag "guild_vs5", mf_noskill;
    	end;
    		
    OnInit:
    	bindatcmd("startevent",strnpcinfo(1)+"::OnStartEvent",60,99);
    	waitingroom "[Free For All]",0;
    	end;
    }
    
    guild_vs5	mapflag	partylock
    guild_vs5	mapflag	guildlock
    guild_vs5	mapflag	notrade
    guild_vs5	mapflag	nodrop

    there you go dude!

    Thanks sir. ill go try it out.

    btw sir, how can i enable it all the time? so players can use it anytime. thanks in advance!

    • Upvote 1
  5. 1 hour ago, Skorm said:

    https://github.com/rathena/rathena/blob/master/doc/script_commands.txt#L7171

    Use the bindatcmd and direct it to a label that starts the event.

    sir can you possibly make a sample for this script? thank you very much sir i'd appreciate it very much.

    // -----------------------------//
    // ------- Free For All --------//
    // -------- By : Butch ---------//
    // A simple Free for all script //
    // -----------------------------//
    
    guild_vs5,48,51,6	script	FFA Master	999,{
    if(getmapusers("guild_vs5") != 1) 
    	{
    		mes "[^FF0000FFA Master^000000]";
    		mes "Current players - ^FF0000"+ getmapusers("guild_vs5") +"^000000.";
    		close;
    	}
    	else if(getmapusers("guild_vs5") == 1)
    	{
    		
    		dispbottom "You are a winner of Event Free for all. Congratz!";
    		donpcevent "Free For All::OnStopEvent";
    		announce "Free for all winner : "+ strcharinfo(0) +"", bc_all, "0xFFCE00";
    		getitem 25002,1; // Reward
    		warp "prontera", 156,149;
    		end;
    	}
    }
    
    // ------ FFA Warper -------//
    		
    prontera,147,149,6	script	Free For All	999,{
    
    	if (.start != 1) {
    	mes "[^FF0000Agent Mil^000000]";
    	mes "Free for all is not available at the moment";
    	close;
    	}
    		mes "[^FF0000Agent Mil^000000]";
    		mes "What do you want?";
    		switch(select("Free for all")) {
    			case 1:
    				if( getcharid(1) ) { mes "Please leave your party."; close; }
    				if( getcharid(2) ) { mes "Please leave your guild."; close; }
    					else switch(rand(3)) {
    						case 0: .@x = 18; .@y = 50; break;
    						case 1: .@x = 50; .@y = 77; break;
    						case 2: .@x = 81; .@y = 49; break;
    						case 3: .@x = 49; .@y = 22; break; 
    					}
    					warp "guild_vs5", .@x,.@y;
    				break;				
    		}
    	close;
    	
    OnStartEvent:	
    OnClock1245:
    OnClock1645:
    OnClock2045:
    OnClock0045:
    OnClock0445:
    OnClock0845:
    	.start = 1;
    	disablenpc "FFA Master";
    	announce "Free for all will start in 5 minutes.", bc_all, "0x00b89d";
    	sleep 120000;
    	announce "Free for all will start in 3 minutes.", bc_all, "0x00b89d";
    	sleep 120000;
    	announce "Free for all will start in 1 minute.", bc_all, "0x00b89d";
    	sleep 60000;
    	announce "Free for all has started!", bc_all, "0x00b89d";
    	.start = 2;
    	enablenpc "FFA Master";
    	sleep 2000;
    	if ( !getmapusers("guild_vs5") ) goto OnStopEvent;
    	mapannounce "guild_vs5", "FFA starts in 5", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 4", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 3", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 2", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 1", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "GO! Kill all!", bc_map;
    	setmapflag "guild_vs5", mf_gvg;
    	removemapflag "guild_vs5", mf_noskill;
    	end;
    	
    OnStopEvent:
    	.start = 0;
    	disablenpc "FFA Master";
    	removemapflag "guild_vs5", mf_gvg;
    	setmapflag "guild_vs5", mf_noskill;
    	end;
    		
    OnInit:
    	waitingroom "[Free For All]",0;
    	end;
    }
    
    guild_vs5	mapflag	partylock
    guild_vs5	mapflag	guildlock
    guild_vs5	mapflag	notrade
    guild_vs5	mapflag	nodrop

     

  6. Hi guys. Just wondering how i can remove the timer on this script and make it usable for eveyone at anytime they want. thanks! :)

     

    
    	----------------------------
    	special thanks to:
    	* Annieruru
    	----------------------------
    	Description:
    	* Free for all event like last man standing
    	* Can be activated through command "@ffa"
    	* Also can be activated every hour
    	* You can set your own number of winners
    	* Configurable settings (npc name, maps, minimum level to participate,
    	  maximum recognized winners, rewards, restricted jobs.)
    	* Significant mapflags were set
    */
    // =============================
    
    prontera,156,157,4	script	Request#2	4_CAT_DOWN,{
    	doevent "Request#2::OnMenu";
    	end;
    	
    OnActivate: // activated by the GM
    	if (agitcheck()) || (agitcheck2()){
    		mes .npc$;
    		mes "WoE is in progress.";
    		close;
    	}
    	if (.checkffa > 0) {
    		mes .npc$;
    		mes "Event is in progress.";
    		close;
    	}
    OnMinute00: // activated every hour
    	if (agitcheck()) || (agitcheck2()) end;
    	if (.checkffa > 0) end;
    	.checkffa = 1;
    	announce .npc$+": Registration for the event is now open for 3 minutes!",bc_all;
    	initnpctimer;
    	end;
    		OnTimer150000:
    			announce .npc$+": 30 seconds left before the registration will be closed.",bc_all;
    			end;
    			
    		OnTimer180000:
    			.checkffa = 2;
    			if ( .psize <= .maxwin) {
    				announce .npc$+": The Event has been cancelled! Not enough participants.",bc_all;
    				callsub Reset_evt_stats;
    				end;
    			}
    			announce .npc$+": Registration is now closed!",bc_all;
    			end;
    			
    		OnTimer185000:
    			mapannounce .pvpmap$,.npc$+": The Event will occur in a few moments!",bc_blue;
    			end;
    			
    		OnTimer187000:
    			mapannounce .pvpmap$,.npc$+": Get ready in 3!",bc_blue;
    			end;
    			
    		OnTimer188000:
    			mapannounce .pvpmap$,.npc$+": 2!",bc_blue;
    			end;
    			
    		OnTimer189000:
    			mapannounce .pvpmap$,.npc$+": 1!",bc_blue;
    			end;
    			
    		OnTimer190000:
    			stopnpctimer;
    			mapannounce .pvpmap$,.npc$+": Good luck everyone!",bc_blue;
    			setmapflag .pvpmap$, mf_pvp_noguild;
    			removemapflag .pvpmap$, mf_noskill;
    			pvpon .pvpmap$;
    			end;
    	
    OnMenu:
    	mes .npc$;
    	mes "Good day "+strcharinfo(0)+"!";
    	mes "How may I help you?";
    	next;
    	switch(select("Information:Join")){
    		case 1:
    			mes .npc$;
    			mes "Minimum Base Level: ^FF0000"+.minblvl+"^000000";
    			mes "Restricted Jobs:";
    			for( .@z = 0; .@z < .rjsize; .@z++ ) {
    				mes ( .@z +1 ) +". ^FF0000"+jobname (.resjob[.@z])+"^000000";
    			}
    			close;
    		case 2:
    			if (!.checkffa) {
    				mes .npc$;
    				mes "Event isn't activated, come back later.";
    				close;
    			}
    			if (.checkffa == 2) {
    				mes .npc$;
    				mes "Event is in progress, come back later.";
    				close;
    			}
    			if (BaseLevel < .minblvl) {
    				mes .npc$;
    				mes "You need to";
    				mes "have ^FF0000"+.minblvl+"^000000 Base level or more than";
    				mes "before you can participate.";
    				close;
    			}
    			for( .@z = 0; .@z < .rjsize; .@z++ ) {
    				if (Class == .resjob[.@z] ){
    					mes .npc$;
    					mes "Your job is restricted to join this event.";
    					close;
    				}
    			}
    			sc_end SC_ALL;
    			percentheal 100,100;
    			warp .pvpmap$,0,0;
    			.regaid[.psize] = getcharid(3);
    			.psize++;
    			end;
    	}
    	
    OnPCDieEvent:
    OnPCLogoutEvent:
    	if (strcharinfo(3) != .pvpmap$) end;
    	while (.regaid != getcharid(3) && .@i < .psize) .@i++;
    	deletearray .regaid[.@i],1;
    	.psize--;
    	if (.psize > .maxwin) end;
    	if (.checkffa > 0) {
    		announce .npc$+": The Event is now over! We already have our winners!",bc_all;
    			for (.@i = 0; .@i < .psize; ++.@i){
    				getitem .ritem,.rcount,.regaid[.@i];
    			}
    	}
    	callsub Reset_evt_stats;
    	end;
    	
    Reset_evt_stats:
    	removemapflag .pvpmap$, mf_pvp_noguild;
    	setmapflag .pvpmap$, mf_noskill;
    	pvpoff .pvpmap$;
    	.checkffa = 0;
    	deletearray .regaid;
    	.psize = 0;
    	mapwarp .pvpmap$,.extmap$,.extx,.exty,0;
    	end;
    	
    OnInit:
    	bindatcmd "ffa",strnpcinfo(3)+"::OnActivate",99,99;
    	
    // CONFIGURATION
    	.npc$ = "[ Free for All ]"; // NPC name
    	.pvpmap$ = "pvp_n_1-5"; // Set your FFA Map
    	.minblvl = 99; // Set minimum base level who can enter
    	.maxwin = 2; // Set the maximum winners
    	.ritem = 7227; // Set the item id of the reward
    		.rcount = 5; // Set reward amount
    	.extmap$ = "prontera"; // Set exit map
    		.extx = 150; // Exit map "x" coordinate
    		.exty = 150; // Exit map "y" coordinate
    	setarray .resjob[0], 0,4001; // This list serves as the restricted jobs
    		.rjsize = getarraysize (.resjob); // DO NOT TOUCH THIS
    		
    // MAPFLAGS
    	setmapflag .pvpmap$, mf_noskill;
    	pvpoff .pvpmap$;
    //---
    	setmapflag .pvpmap$, mf_nowarpto;
    	setmapflag .pvpmap$, mf_nocommand;
    	setmapflag .pvpmap$, mf_nowarp;
    	setmapflag .pvpmap$, mf_nosave;
    	setmapflag .pvpmap$, mf_noteleport;
    	setmapflag .pvpmap$, mf_nomemo;
    	setmapflag .pvpmap$, mf_novending;
    	setmapflag .pvpmap$, mf_nobranch;
    	end;
    }

     

  7. // -----------------------------//
    // ------- Free For All --------//
    // -------- By : Butch ---------//
    // A simple Free for all script //
    // -----------------------------//
    
    guild_vs5,48,51,6	script	FFA Master	999,{
    if(getmapusers("guild_vs5") != 1) 
    	{
    		mes "[^FF0000FFA Master^000000]";
    		mes "Current players - ^FF0000"+ getmapusers("guild_vs5") +"^000000.";
    		close;
    	}
    	else if(getmapusers("guild_vs5") == 1)
    	{
    		
    		dispbottom "You are a winner of Event Free for all. Congratz!";
    		donpcevent "Free For All::OnStopEvent";
    		announce "Free for all winner : "+ strcharinfo(0) +"", bc_all, "0xFFCE00";
    		getitem 25002,1; // Reward
    		warp "prontera", 156,149;
    		end;
    	}
    }
    
    // ------ FFA Warper -------//
    		
    prontera,147,149,6	script	Free For All	999,{
    
    	if (.start != 1) {
    	mes "[^FF0000Agent Mil^000000]";
    	mes "Free for all is not available at the moment";
    	close;
    	}
    		mes "[^FF0000Agent Mil^000000]";
    		mes "What do you want?";
    		switch(select("Free for all")) {
    			case 1:
    				if( getcharid(1) ) { mes "Please leave your party."; close; }
    				if( getcharid(2) ) { mes "Please leave your guild."; close; }
    					else switch(rand(3)) {
    						case 0: .@x = 18; .@y = 50; break;
    						case 1: .@x = 50; .@y = 77; break;
    						case 2: .@x = 81; .@y = 49; break;
    						case 3: .@x = 49; .@y = 22; break; 
    					}
    					warp "guild_vs5", .@x,.@y;
    				break;				
    		}
    	close;
    	
    OnStartEvent:	
    OnClock1245:
    OnClock1645:
    OnClock2045:
    OnClock0045:
    OnClock0445:
    OnClock0845:
    	.start = 1;
    	disablenpc "FFA Master";
    	announce "Free for all will start in 5 minutes.", bc_all, "0x00b89d";
    	sleep 120000;
    	announce "Free for all will start in 3 minutes.", bc_all, "0x00b89d";
    	sleep 120000;
    	announce "Free for all will start in 1 minute.", bc_all, "0x00b89d";
    	sleep 60000;
    	announce "Free for all has started!", bc_all, "0x00b89d";
    	.start = 2;
    	enablenpc "FFA Master";
    	sleep 2000;
    	if ( !getmapusers("guild_vs5") ) goto OnStopEvent;
    	mapannounce "guild_vs5", "FFA starts in 5", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 4", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 3", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 2", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "FFA starts in 1", bc_map;
    	sleep 1000;
    	mapannounce "guild_vs5", "GO! Kill all!", bc_map;
    	setmapflag "guild_vs5", mf_gvg;
    	removemapflag "guild_vs5", mf_noskill;
    	end;
    	
    OnStopEvent:
    	.start = 0;
    	disablenpc "FFA Master";
    	removemapflag "guild_vs5", mf_gvg;
    	setmapflag "guild_vs5", mf_noskill;
    	end;
    		
    OnInit:
    	waitingroom "[Free For All]",0;
    	end;
    }
    
    guild_vs5	mapflag	partylock
    guild_vs5	mapflag	guildlock
    guild_vs5	mapflag	notrade
    guild_vs5	mapflag	nodrop

    Hi! Just wondering how can i start the npc and make it usable anytime? and also how to remove the clock? thanks in advance!

  8. On 12/8/2016 at 0:50 AM, Azura Skyy said:

    If it isn't too much to ask, could you edit the issue back into your first post and let us know how you solved it?

    Thanks in advance,
    ~Azura Skyy

    Done sir. Sorry for that.

    Solved. See first post.

    • Upvote 1
  9. Hi guys! just wondering how to properly replace the prontera map with the a custom prontera map from olrox post. Cause i'm getting black tiles and other details are not shown. Thanks in advance!

     

    Solved!

    I deleted my newprontera.grf on my directory and on data.ini. Merged the custom files on my grf and updated my mapcache.dat and it worked.

     

    ss.jpg

×
×
  • Create New...