• 0
Sign in to follow this  
caspa

pvp npc with rotating getmapuser pub room

Question

does anybody know where can i find that pvp warper where it has a rotating waitingroom?

like

waitingroom = [ PvP Map 1 [ 12 user ] ] then after that delwaitingroom then  [ PvP Map 2 [ 1 User ] ] then it show another map again...

Share this post


Link to post
Share on other sites

13 answers to this question

Recommended Posts

  • 0
Posted (edited)

prontera,155,181,5	script	PVP Room	4_F_KAFRA1,{
	for ([email protected] = 0; [email protected] < .size; [email protected]++) 
		[email protected]$ += .name$[[email protected]] + "[ "+getmapusers(.map$[[email protected]])+" ]" + ":";
	[email protected] = select([email protected]$) - 1;
	warp .map$[[email protected]], 0, 0;
	end;
	
	OnInit:
		setarray .name$, "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6";
		setarray .map$, "pvp_map_1", "pvp_map_2", "pvp_map_3", "pvp_map_4", "pvp_map_5", "pvp_map_6";
		.size = getarraysize(.map$);
		initnpctimer;
		
	OnTimer5000:
		.index = (.index % .size);
		delwaitingroom;
		waitingroom .name$[.index] + "[ "+getmapusers(.map$[.index])+" ]", 0;
		.index++;
		initnpctimer;
		end;
}

try

Edited by Emistry
update

Share this post


Link to post
Share on other sites
  • 0

Something like that, but not tested.

OnTimer3000:
	
.@map$ = .pvp_maps$[[email protected]_pvp_map_index]; // just to make it more readable.
.chat_text$ = "[ PvP Map "+ [email protected]_pvp_map_index +"[ "+getmapusers(.@map$)+" user ] ]";

	delwaitingroom;
	waitingroom .chat_text$
	
	if([email protected]_pvp_map_index > getarraysize(.pvp_maps$)) {
		[email protected]_pvp_map_index = 0;
	} else {
		[email protected]_pvp_map_index++;
	}
	initnpctimer;
	end;


OnInit:
	setarray .pvp_maps$[0], "map1", "map2", "map3";
	[email protected]_pvp_map_index = 0;
	initnpctimer;
	end;

 

Share this post


Link to post
Share on other sites
  • 0
9 hours ago, anacondaq said:

Something like that, but not tested.

OnTimer3000:
	
.@map$ = .pvp_maps$[[email protected]_pvp_map_index]; // just to make it more readable.
.chat_text$ = "[ PvP Map "+ [email protected]_pvp_map_index +"[ "+getmapusers(.@map$)+" user ] ]";

	delwaitingroom;
	waitingroom .chat_text$
	
	if([email protected]_pvp_map_index > getarraysize(.pvp_maps$)) {
		[email protected]_pvp_map_index = 0;
	} else {
		[email protected]_pvp_map_index++;
	}
	initnpctimer;
	end;


OnInit:
	setarray .pvp_maps$[0], "map1", "map2", "map3";
	[email protected]_pvp_map_index = 0;
	initnpctimer;
	end;

 

this is the right one however i have problems during rotation... 

there is only 3 maps identifies but its rotating +2 maps beyond that

PvP Room 0 [ 1 user ]
pvp room 1  [ 1 user ] 
pvp room 2 [ 3 user ]
pvp room 3 [-1 user ]
pvp room 5 [-1user]

then if you put 4 maps.. it then becoms up to 6 rotation.. LOL

the room no. also starts with 0... how do u make it starts with Room 1, 2, 3 and so forth...

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)

it doesnt rotate

7 hours ago, Emistry said:
prontera,155,181,5	script	PVP Room	4_F_KAFRA1,{
	for ([email protected] = 0; [email protected] < .size; [email protected]++) 
		[email protected]$ += .name$[[email protected]] + "[ "+getmapusers(.map$[[email protected]])+" ]" + ":";
	[email protected] = select([email protected]$) - 1;
	warp .map$[[email protected]], 0, 0;
	end;
	
	OnInit:
		setarray .name$, "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6";
		setarray .map$, "pvp_map_1", "pvp_map_2", "pvp_map_3", "pvp_map_4", "pvp_map_5", "pvp_map_6";
		.size = getarraysize(.map$);
		initnpctimer;
		
	OnTimer5000:
		.index = (.index % .size);
		delwaitingroom;
		waitingroom .name$[.index] + "[ "+getmapusers(.map$[.index])+" ]", 0;
		.index++;
		end;
}

try

the waitingroom dont rotate.. you need to click the npc first before the waitingroom change... 

this is the script converted

prontera,155,181,5    script    PVP Room    100,{
    for ( set [email protected],0; [email protected] < .size; set [email protected],[email protected]+1) 
    set [email protected]$, [email protected]$ + .name$[[email protected]] + "[ "+getmapusers(.map$[[email protected]])+" ]" + ":";
    set [email protected],select([email protected]$) - 1;
    warp .map$[[email protected]], 0, 0;
    end;
    
    OnInit:
        setarray .name$, "Title 1", "Title 2", "Title 3", "Title 4", "Title 5", "Title 6";
        setarray .map$, "prontera", "izlude", "pvp_n_room", "pvp_y_1-2", "invek", "mellina";
        set .size,getarraysize(.map$);
        initnpctimer;
        
    OnTimer5000:
        set .index,(.index % .size);
        delwaitingroom;
        waitingroom .name$[.index] + "[ "+getmapusers(.map$[.index])+" ]", 0;
        set .index,.index+1;
        end;
}
Edited by caspa

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
45 minutes ago, caspa said:

it doesnt rotate

 

the waitingroom dont rotate.. you need to click the npc first before the waitingroom change... 

quiz_02,287,265,4	script	Ultimate PvP Warper	417,{
	if (.pvp_square$=="") donpcevent "Ultimate PVP warper::OnClock0000";
 
	mes "[PvP Warper]";
	mes "Which arena do you want to join?";
	switch(select("All Job                 ["+getmapusers(.pvp_square$)+"/128]:Max lvl 99            ["+getmapusers("pvp_y_2-2")+"/128]:3rd Baby Class ["+getmapusers("pvp_y_1-2")+"/128]")) {
	case 1:	// PVP Square
		if (getmapusers(.pvp_square$) > 127) callsub S_full;
		warp .pvp_square$,0,0;
		announce "Player "+strcharinfo(0)+" join arena PVP All Job !!",bc_all;
		end;
  
	case 2:	// PVP Low Level
		if (getmapusers("pvp_y_2-2") > 127) callsub S_full;
		if (BaseLevel > 99) { // Edit 150 to any maximum Lvl of a player can enter this room
			mes "Only for level 1 - 99";
			close;
		}
		warp "pvp_y_2-2",0,0;
		announce "Player "+strcharinfo(0)+" join arena PVP Max lvl 99 !!",bc_all;
		end;
 
	Case 3: // Baby Class
		if (getmapusers("pvp_y_1-2") > 127) callsub S_full;
		if (class < 4096 || class > 4112) goto L_NotBaby;
		warp "pvp_y_1-2",0,0;
		announce "Player "+strcharinfo(0)+" join arena PVP 3rd Baby Class !!",bc_all;
		end;
L_NotBaby:
		mes "This room only for 3rd baby class";
		close;
}

S_full:
		mes "Sorry, The arena already full. Please wait...";
		close;
 
OnInit:
	OnTimer5000:
	delwaitingroom;
	switch(rand(1,3)) {
Case 1:
	waitingroom getmapusers(.pvp_square$)+" player"+( getmapusers(.pvp_square$) > 1 ? "s":"") +" in arena All Job", 0;
	goto Timer;
	end;
	break;

Case 2:
	waitingroom getmapusers("pvp_y_2-2")+" player"+( getmapusers("pvp_y_2-2") > 1 ? "s":"") +" in arena Max lvl 99", 0;	
	goto Timer;
	end;
	break;

Case 3:
	waitingroom getmapusers("pvp_y_1-2")+" player"+( getmapusers("pvp_y_1-2") > 1 ? "s":"") +" in arena 3rd Baby Class", 0;	
	goto Timer;
	end;
	break;
Timer:
	initnpctimer;
}

OnClock0000:
	// set the "PVP Square" map, based on day of the weeek
	switch(gettime(4)) {
	case 0:	// Sunday
	case 1:	// Monday
		set .pvp_square$, "pvp_y_7-2";
		break;
	case 2:	// Tuesday
	case 3:	// Wednesday
		set .pvp_square$, "guild_vs3";
		break;
	case 4:	// Thursday
	case 5:	// Friday
		set .pvp_square$, "pvp_y_7-2";
		break;
	case 6:	// Saturday
		set .pvp_square$, "guild_vs3";
		break;
	}
}

 

Edited by hendra814

Share this post


Link to post
Share on other sites
  • 0
31 minutes ago, hendra814 said:
quiz_02,287,265,4	script	Ultimate PvP Warper	417,{
	if (.pvp_square$=="") donpcevent "Ultimate PVP warper::OnClock0000";
 
	mes "[PvP Warper]";
	mes "Which arena do you want to join?";
	switch(select("All Job                 ["+getmapusers(.pvp_square$)+"/128]:Max lvl 99            ["+getmapusers("pvp_y_2-2")+"/128]:3rd Baby Class ["+getmapusers("pvp_y_1-2")+"/128]")) {
	case 1:	// PVP Square
		if (getmapusers(.pvp_square$) > 127) callsub S_full;
		warp .pvp_square$,0,0;
		announce "Player "+strcharinfo(0)+" join arena PVP All Job !!",bc_all;
		end;
  
	case 2:	// PVP Low Level
		if (getmapusers("pvp_y_2-2") > 127) callsub S_full;
		if (BaseLevel > 99) { // Edit 150 to any maximum Lvl of a player can enter this room
			mes "Only for level 1 - 99";
			close;
		}
		warp "pvp_y_2-2",0,0;
		announce "Player "+strcharinfo(0)+" join arena PVP Max lvl 99 !!",bc_all;
		end;
 
	Case 3: // Baby Class
		if (getmapusers("pvp_y_1-2") > 127) callsub S_full;
		if (class < 4096 || class > 4112) goto L_NotBaby;
		warp "pvp_y_1-2",0,0;
		announce "Player "+strcharinfo(0)+" join arena PVP 3rd Baby Class !!",bc_all;
		end;
L_NotBaby:
		mes "This room only for 3rd baby class";
		close;
}

S_full:
		mes "Sorry, The arena already full. Please wait...";
		close;
 
OnInit:
	OnTimer5000:
	delwaitingroom;
	switch(rand(1,3)) {
Case 1:
	waitingroom getmapusers(.pvp_square$)+" player"+( getmapusers(.pvp_square$) > 1 ? "s":"") +" in arena All Job", 0;
	goto Timer;
	end;
	break;

Case 2:
	waitingroom getmapusers("pvp_y_2-2")+" player"+( getmapusers("pvp_y_2-2") > 1 ? "s":"") +" in arena Max lvl 99", 0;	
	goto Timer;
	end;
	break;

Case 3:
	waitingroom getmapusers("pvp_y_1-2")+" player"+( getmapusers("pvp_y_1-2") > 1 ? "s":"") +" in arena 3rd Baby Class", 0;	
	goto Timer;
	end;
	break;
Timer:
	initnpctimer;
}

OnClock0000:
	// set the "PVP Square" map, based on day of the weeek
	switch(gettime(4)) {
	case 0:	// Sunday
	case 1:	// Monday
		set .pvp_square$, "pvp_y_7-2";
		break;
	case 2:	// Tuesday
	case 3:	// Wednesday
		set .pvp_square$, "guild_vs3";
		break;
	case 4:	// Thursday
	case 5:	// Friday
		set .pvp_square$, "pvp_y_7-2";
		break;
	case 6:	// Saturday
		set .pvp_square$, "guild_vs3";
		break;
	}
}

 

is there anyway to make this sequence? like case 1 first then case 2 then case 3?

 

Share this post


Link to post
Share on other sites
  • 0
17 minutes ago, caspa said:

is there anyway to make this sequence? like case 1 first then case 2 then case 3?

 

Sequence for getmapuser in pub room?

i think it's already sequence

Share this post


Link to post
Share on other sites
  • 0
8 minutes ago, hendra814 said:

Sequence for getmapuser in pub room?

i think it's already sequence

i think the switch(rand1,3) is making it random.... when you put Room 1 instead of the maps mentioned above..


it would look like this 

room 1
room 3 
room 4
room 1
room 2
room 4

instead of 

room 1
room 2 
room 3
room 4
and then 1 again
room 2

Share this post


Link to post
Share on other sites
  • 0
Posted (edited)
1 hour ago, caspa said:

is there anyway to make this sequence? like case 1 first then case 2 then case 3?

 

not sure, but try with 

switch(1,3)
Edited by hendra814

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, hendra814 said:

not sure, but try with 

switch(1,3)

it doesn't work 
😞

OnInit:
setarray .map$,"pvp_y_1-2","pvpmapall1","classmap3","pvpmapall2";
set .map_size,getarraysize ( .map$ );
for( set [email protected],0; [email protected] < .map_size; set [email protected],[email protected]+1 ){
	    OnTimer5000:
    delwaitingroom;
    switch([email protected]+1) {
	Case 1:
    waitingroom "Room 1 [ "+ getmapusers("pvp_y_1-2")+" ]", 0;
    goto Timer;
    end;
    break;
	Case 2:
    waitingroom "Room 2 [ "+ getmapusers("pvpmapall1")+" ]", 0;    
    goto Timer;
    end;
    break;
	Case 3:
    waitingroom "Room 3 [ "+ getmapusers("classmap3")+" ]", 0;    
    goto Timer;
    end;
    break;
	Case 4:
    waitingroom "Room 4 [ "+ getmapusers("pvpmapall2")+" ]", 0;    
    goto Timer;
    end;
    break;
Timer:
    initnpctimer;

tried doing this and it doesnt work... JEsaaasss i swear to god if this script thing is as easy as medical terms.. LOL!

Share this post


Link to post
Share on other sites
  • 0
4 hours ago, caspa said:

the waitingroom dont rotate..

refer the updated script again

Share this post


Link to post
Share on other sites
  • 0
15 minutes ago, Emistry said:

refer the updated script again

thank you [solved]

Share this post


Link to post
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.

Loading...
Sign in to follow this