Bleadd Posted May 12, 2012 Posted May 12, 2012 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
0 adenaman Posted May 13, 2012 Posted May 13, 2012 you can get the party from l2pcinstance and just make a for each loop with 2 flags initialized to false and turn them true when you find healer/buffer
0 Rizlaaa Posted May 13, 2012 Posted May 13, 2012 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; } }
0 Bleadd Posted May 13, 2012 Author Posted May 13, 2012 Oh, thanks for the code. I'll try now :) Edit : It works. Thanks. :)
0 Tryskell Posted May 13, 2012 Posted May 13, 2012 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.
0 Rizlaaa Posted May 13, 2012 Posted May 13, 2012 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
0 dpbBryan Posted May 13, 2012 Posted May 13, 2012 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.
0 Bleadd Posted May 13, 2012 Author Posted May 13, 2012 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 :)
Question
Bleadd
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
7 answers to this question
Recommended Posts