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.
Do you wanna buy D4 Gold, Items, Boosting?
Get the most powerful Diablo 4 items and gold at MMOexp! Get the best Set and Legendary items or Materials thanks to the services available at our site.
BUY and SELL for free, we don't take any hidden fees.
Check it now:
- Diablo 4 Gold
- Diablo 4 Items
- Diablo 4 Boosting
Also here are Giveaway and D4 Lucky Chest events! Welcome to MMOexp!
When I compile IL using the compiler, it shows an error:
Scripts Loaded
Source file processed
Compiling...
invalid function GlobalObject
Funcion ID Error gg
Funcion ID Error gg::myself::IsNullCreature myself
Funcion ID Error lparty
Funcion ID Error myself::SetInfo random1_list
invalid function CodeInfoList gg::myself::RandomSelectOne
Funcion ID Error gg::myself::RandomSelectOne random1_list
Funcion ID Error code_info
invalid function CodeInfo gg::myself::RandomSelectOne
Funcion ID Error gg::myself::RandomSelectOne code_info
Funcion ID Error target
Done in 15 milliseconds
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.
Link to comment
Share on other sites
7 answers to this question
Recommended Posts