Hello im doing one custom thing now but Im wondering how to create Instance for each player with stats that will be hold until shutdown/restart. For example im calling function DoSomething() in doDie from L2PcInstance in which I want to read or create if not exist Instance for each player(killer) with few statics for example I want hold there pvp stats, if something happens im raising it or reseting.
Im thinking to do something similar like they have done in l2jFrozen:
public class CustomPvpSystem{
public CustomPvpSystem(L2PcInstance killer, L2PcInstance victim){
Will something like this work with this return instance ? Or can I do this easier?
And the second question, how can I random array ? For example I have ex[] = {1,2,3,4} and I want to random this array but inside, NOT like to get random from this array.
DISCORD :
https://discord.com/users/325653525793210378
utchiha_market
telegram :
https://t.me/utchiha_market
SELLIX STORE :
https://utchihamkt.mysellix.io/
Join our server for more products :
https://discord.gg/uthciha-services
https://campsite.bio/utchihaamkt
Question
Archagnel
Hello im doing one custom thing now but Im wondering how to create Instance for each player with stats that will be hold until shutdown/restart. For example im calling function DoSomething() in doDie from L2PcInstance in which I want to read or create if not exist Instance for each player(killer) with few statics for example I want hold there pvp stats, if something happens im raising it or reseting.
Im thinking to do something similar like they have done in l2jFrozen:
public class CustomPvpSystem{
public CustomPvpSystem(L2PcInstance killer, L2PcInstance victim){
this.setKiller(killer);
this.setVictim(victim);
...
Pvp pvp = PvpTable.getInstance().getPvp(killer.getObjectId(), victim.getObjectId(), systemDay);
...
and in pvptable class:
...
private static PvpTable _instance = null;
...
public static PvpTable getInstance(){
if(_instance == null){
_instance = new PvpTable();
}
return _instance;
}
Will something like this work with this return instance ? Or can I do this easier?
And the second question, how can I random array ? For example I have ex[] = {1,2,3,4} and I want to random this array but inside, NOT like to get random from this array.
7 answers to this question
Recommended Posts