Jump to content
  • 0

PVP enter, announce


Famous

Question


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

//  ________________________________________________________
// /                                                        \
// |       _           _   _   _                            |
// |      | |__  _ __ / \ | |_| |__   ___ _ __   __ _       |
// |      | '_ \| '__/ _ \| __| '_ \ / _ \ '_ \ / _` |      |
// |      | |_) | | / ___ \ |_| | | |  __/ | | | (_| |      |
// |      |_.__/|_|/_/   \_\__|_| |_|\___|_| |_|\__,_|      |
// |                                                        |
// |                     brAthena Script                    |
// |--------------------------------------------------------|
// | Name of Script: Rotative PVP                           |
// |--------------------------------------------------------|
// | Created by: Neko                                       |
// |--------------------------------------------------------|
// | Version rA/brA: 1.0                                    |
// |--------------------------------------------------------|
// | Description: PVP NPC                                   |
// | - An NPC that alternates the current PVP map from time |
// | to time, the chosen map for rotation are configured by |
// | the administrator in the script. The idea is to have   |
// | multiple pvp rooms, without having to divide the players|
// | of your server among them, this way pvps are more crowded|
// | and funnier.                                           |
// |--------------------------------------------------------|
// | Changelog:               	                            |
// | 1.0 Script Created [Neko]                              |
// |--------------------------------------------------------|
// | - Note:                                                |
// | *There is a temporary global variable named $@lista$ in|
// | this NPC, watch out for global variables with the same |
// | name in other NPCs of yours.                           |
// |--------------------------------------------------------|
// | Any problem with this NPC please report directly to me.|
// \________________________________________________________/

-	script	PvpRotative	-1,{

OnInit:
// ======================================
// Configurations ***********************
// ======================================
// Which map will be on the rotation?
   setarray .lista$[0],"pvp_y_1-1","pvp_y_1-2","pvp_y_1-3";
// From how much time to time will the maps change? (Standard value 30 minutes/18000000)
// WARNING, DO NOT SET VALUES HERE SMALLER THAN 60000 (1 Minute).
   set .rotatetime, 18000000;
// ======================================	

	set $@lista$, ""+.lista$[0]+"";
	set .count, getarraysize(.lista$);

	for( set .@i,0; .@i < .count; set .@i, .@i+1 ){
			sleep .rotatetime-60000;
			mapannounce ""+.lista$[.@i]+"","The PVP map will change in 30 seconds.",8;
			sleep 30000;
			mapannounce ""+.lista$[.@i]+"","The PVP map will change in 20 seconds.",8;
			sleep 20000;
			mapannounce ""+.lista$[.@i]+"","The PVP map will change in 10 seconds.",8;
			sleep 10000;
			if(.lista$[.@i] == .lista$[.count-1]){
				mapwarp ""+.lista$[.@i]+"",""+.lista$[0]+"",0,0;
				set $@lista$, ""+.lista$[0]+"";
				set .@i,-1;
			}
			else{
				mapwarp ""+.lista$[.@i]+"",""+.lista$[.@i+1]+"",0,0;
				set $@lista$, ""+.lista$[.@i+1]+"";
			}
		}
}

prontera,162,186,4	script	PvP Keeper	459,{

	mes "[PvP Keeper]";
	mes "Ready for a bloody";
	mes "and glorious battle today?";
	if (select("Enter PVP. ["+getmapusers(""+$@lista$+"") +"]:I'm out of potions today.") == 1) {
		warp ""+$@lista$+"",0,0;
		end;
	}
	next;
	mes "[PvP Keeper]";
	mes "Haha!~";
	mes "It's okay to be scared!!";
	mes "HAHAHAHAHAHA!";
	close;
}

HOW TO EDIT THIS WHEN PLAYER ENTER THE ROOM NPC WILL BROADCAST TO ALL MAP THAT SOME ONE ENTERED THE PVP ARENA?
Edited by Capuche
Change the title
Link to comment
Share on other sites

4 answers to this question

Recommended Posts


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


	if (select("Enter PVP. ["+getmapusers(""+$@lista$+"") +"]:I'm out of potions today.") == 1) {
		warp ""+$@lista$+"",0,0;
		end;
	}

change to

if (select("Enter PVP. ["+getmapusers( $@lista$ ) +"]:I'm out of potions today.") == 1) {
	warp $@lista$,0,0;
	announce strcharinfo(0)+" entered "+$@lista$,0;
	end;
}
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  39
  • Topics Per Day:  0.01
  • Content Count:  615
  • Reputation:   201
  • Joined:  11/09/11
  • Last Seen:  

.@generatedMenu$ = "";

setarray(.@pvp_maps$, "a", "b", "c", "d"); // Corresponds to the Menu Options

// Generate the Menu from the Array
for (.@i = 0; .@i < getarraysize(.@pvp_maps$); .@i++) {
  .@generatedMenu$ += ( .@i = 0 ? "" : ":" ) + "Enter PVP Room #" + (.@i + 1) + "[" + getmapusers(.@pvp_maps$[.@i]) + "]";
}
                                              
// Append the last option
.@generatedMenu$ += ":I'm out of potions for today";

.@selection = select(.@generatedMenu$) - 1; // Substract 1 because select gives 1-N and array starts 0-N
                                          
if (.@selection = getarraysize(.@menu$) ) { // This is the actual array size because we added +1 due to last option
 // Chose Last Option
  mes "Sorry to see you go";
  close;
}
                                          
// Else they chose to warp to a pvp place...
warp .@pvp_maps$[.@selection], 0, 0;
end;

 

Link to comment
Share on other sites

  • -1

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.01
  • Content Count:  32
  • Reputation:   0
  • Joined:  05/27/17
  • Last Seen:  

@Emistry how can i add more option to select for example the current one is 

  • Enter pvp [0]
  • Im out of potion

How to add more option for different map but same functionality 

  • Enter Pvp Main [0]
  • Map 2 
  • Map 3 
  • Map 4 1 v 1 
  • Im out of potion
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  145
  • Topics Per Day:  0.03
  • Content Count:  455
  • Reputation:   3
  • Joined:  06/19/12
  • Last Seen:  

thanks :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...