Transferring a current party leader's variables to a new one

This is not a Support area! Discuss about the Server here. Non-Server related discussion goes in Off-Topic Discussion.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
drizzlx
Posts: 13
Joined: Mon Jul 16, 2012 6:53 pm

Transferring a current party leader's variables to a new one

Post by drizzlx »

I have a custom quest that onKill event is getting the party leader's L2PcInstance and adding 1 to an int variable inside it. The whole party's progress is calculated by the party leader's variable. Now, if the party leader were to change leader then the quest progress would be reset. I have tried doing a for loop through the party members and syncing their variable to the party leader but it acted awkward and didn't work. Any ideas on how I can make it not reset if the leader were to get disconnected? I need some way of transferring the leader's variable to the new leader.

Also, is there a way to detect if someone enters the party? I'd like to display the party's current progress.

Thanks for any input.
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Transferring a current party leader's variables to a new

Post by jurchiks »

set the variable to them all? at least one should remain with the latest value.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
Post Reply