Now there is no drop for premium users at all but still works for users w/o premium.
Am I miss something or it's impossible to make it in this way?
Best Wishes
Update: Problem solved.
I used standard DropListScope Death but i made changes in IChanceMultiplierStrategy DEFAULT_STRATEGY and IAmountMultiplierStrategy DEFAULT_STRATEGY methods.
The trick was to add public property L2PcInstance killer (initialized before call getChanceMultiplier) and read data about premium using victim.killer in DEFAULT_STRATEGY
Dear players, We are excited to announce the open beta testing of the Airin x2 server. Start: March 14, 2025, at 18:00 (GMT +1) server time. An NPC will be available on the test server, where you can acquire items, level up, choose a profession, and more. All character progress (EXP/Items) may be wiped at any time and will not transfer to the live Airin server.
OBT is expected to last until March 17, 20:00 server time. We are also working on a client with multiple language options and a proxy solution to improve the gaming experience for players worldwide and ensure a more stable connection. Download links and account registration will be available later. Stay tuned for updates!
Question
sylwuu
Hello,
i'm working on premium account and i need a little help.
I created a database table with premium account data and this data is loaded on player login.
As i saw in L2Attackable.java there is a method doItemDrop and line
deathItems = npcTemplate.calculateDrops(DropListScope.DEATH, this, player);
so i added
if (player.hasPremium()) { deathItems = npcTemplate.calculateDrops(DropListScope.PREMIUMDEATH, this, player); } else{ deathItems = npcTemplate.calculateDrops(DropListScope.DEATH, this, player); }
To DropListScope i added
PREMIUMDEATH((itemId, min, max, chance) -> new GeneralDropItem(itemId, min, max, chance, IAmountMultiplierStrategy.PREMIUMDROP, IChanceMultiplierStrategy.PREMIUMDROP), GroupedGeneralDropItem::new),
To IAmountMultiplierStrategy.java i added
IAmountMultiplierStrategy PREMIUMDROP = DEFAULT_STRATEGY(rates().getDeathDropAmountMultiplier() + rates().getDeathDropAmountMultiplier()/2);
To IChanceMultiplierStrategy.java added
IChanceMultiplierStrategy PREMIUMDROP = DEFAULT_STRATEGY(rates().getCorpseDropChanceMultiplier() + rates().getCorpseDropChanceMultiplier()/2);
Now there is no drop for premium users at all but still works for users w/o premium.
Am I miss something or it's impossible to make it in this way?
Best Wishes
Update: Problem solved.
I used standard DropListScope Death but i made changes in IChanceMultiplierStrategy DEFAULT_STRATEGY and IAmountMultiplierStrategy DEFAULT_STRATEGY methods.
The trick was to add public property L2PcInstance killer (initialized before call getChanceMultiplier) and read data about premium using victim.killer in DEFAULT_STRATEGY
0 answers to this question
Recommended Posts