Jump to content
  • 0

Some checks in party


Bleadd

Question

Hello,

 

I want to know if it's possible to make a check for quests.

 

For example, if the party is constitued of a healer and a buffer (like BS/SWS/PP), the party can port to a location?

 

Cordially,

Bleadd

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

if i understand well you want to check the party if have some classes , if yes teleport the whole party some where?

If yes , just create a loop in the party and check the ids you want , if they have these ids teleport the whole party somewhere.

 

for(L2PcInstance j : player.getParty().getPartyMembers()){
        	int id = j.getClassId().getId();
        	if(id == 1|| id == 2){
        		for(L2PcInstance g :player.getParty().getPartyMembers())
        			g.teleToLocation(x, y, z);
        		
        	  break;		
        	}
        	
        }

Link to comment
Share on other sites

  • 0

It won't work exactly as you want, if you want both a buffer AND healer you have to "memorize" on 2 booleans. If at least one of them is false, then return.

 

Atm Iracundus's code works either if you got only a buffer or an healer. Not both. Added to that you can put

L2Party party = player.getParty().getPartyMembers()

and reuse it ;p.

Link to comment
Share on other sites

  • 0

It won't work exactly as you want, if you want both a buffer AND healer you have to "memorize" on 2 booleans. If at least one of them is false, then return.

 

Atm Iracundus's code works either if you got only a buffer or an healer. Not both. Added to that you can put

L2Party party = player.getParty().getPartyMembers()

and reuse it ;p.

yes.

or he can create 2 integers for each one class and combine them  ;D

Link to comment
Share on other sites

  • 0

Just create a Map or something with the ID's of the classes you required. Use an iterator to go across the table and see what's avaliable in the players part. Worse case secenerio theres like ~100 (or however many classes) * 9, which is only 900 iterations, which is almost nothing.

Link to comment
Share on other sites

  • 0

I've change the code . But in the for i have 2 booleans. Boolean go true if found id of healers && other boolean go true if found a buffer.

 

And after the for if the 2 booleans are true, i port the team. It works so it's fine :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...