Jump to content
  • 0

Party v.s. Party Project.


Question

Posted (edited)

- Automated Script:

NPC A - Registration for party v.s. party 7 vs 7

Ability:

- can check number of party

- can check number of jobs

- after checking if party and job met - warp to waiting room team A and team B have designated rooms..

NPC B - a NPC w/ pub maximum of 7 members Only..

Ability:

- if teams can complete the 7/7 of the NPC B they will warp automatically in the pvp room.

- this will also prevent team from getting +1 member in the party.

- this is like in battle ground script.

NPC C - a NPC / Script inside the pvp room.

Ability:

- check the number of party

- count down if the count down ends the party w/ high number of player alive will win.

- party that is dead 2x will go outside the pvp room. - i think if its pvp map it will automatically allowed this. [no need for this]

NPC A:

team leader

if ( getpartyleader(getcharid(1),2) != getcharid(0) )
			{
					mes "Only party leader have the right to sign up / out from the game with me..";
					close;
			}
					mes "Choose your team to register.";
					switch(select("Red Team - [" + GetPartyName($@TeamID1) + "] :Blue Team - [" + GetPartyName($@TeamID2) + "]"))


NPC A:

party number checker

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;
}

mes "OK, no problem with your party, let's go !";

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;
}

NPC A:

- party choosing team [ red team | blue team ]

- a checker if someone already register to both team.

NPC A:

- warping team A and team B to a waiting room or to NPC B

NPC B:

- example of waiting room [ script from BG ]

bat_room,86,227,4    script    Lieutenant Ator    418,{
   end;
OnInit:
   waitingroom "Battle Station",10,"start#bat_b01::OnReadyCheck",1,0,80;
   end;
OnEnterBG:
   set $@FlaviusBG1_id1, waitingroom2bg("bat_b01",10,290,"start#bat_b01::OnGuillaumeQuit","");
   end;
}

bat_room,85,204,0    script    Lieutenant Thelokus    414,{
   end;
OnInit:
   waitingroom "Battle Station",10,"start#bat_b01::OnReadyCheck",1,0,80;
   end;
OnEnterBG:
   set $@FlaviusBG1_id2, waitingroom2bg("bat_b01",390,10,"start#bat_b01::OnCroixQuit","");
   end;

Edited by GM Takumirai
  • Upvote 1

3 answers to this question

Recommended Posts

Posted

- i need your help im not that good on scripting i will just formulate the example of the script that i get in the forum

- if we contruct this script and re coded it we can make a working automated 7vs7 party vs party.

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...