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
L2 Insignia High Five 20x
MID SERVER FOCUSED ON
OLYMPIAD | PVP | AUTOFARM
OPEN BETA TEST SERVER
3 MAY 2024
GRAND OPENING
10 MAY 2024
Rates:
📜 XP/SP 20x | Spoil 15x | Drop 10x | Adena 10x 📜
Server Features:
🔥 No Olf-T Shirt, No big over-enchant, No over-power Donate 🔥
🔥 VIP Gold Color Chat, Unique Olympiad Extra Points Engine, GvG Event 🔥
🔥 Auto-Farm, LoA and DV scheduled PvP Zone, Calendar Daily Reward 🔥
🔥 Castle Instance, Solo Instance, PvP Solo Rift, Dress me system, Adena Boxes 🔥
Website:
https://www.l2insignia.com
Discord:
https://discord.com/invite/yEgsrHn2hQ
I am selling the essence project which includes versions 388 and 439 that have been running for over 2 years or (447 as custom PVP like Pride). I have a test server for you to test them out. If you are really interested in it then contact my seller at discord: kiwi7106.
Price: 4000 Euro
P/s: This is a project that I have spent a lot of money and time developing, so if you are not interested in it, please get out of this topic, thank you.
P/s 2: If you find the price too expensive, it's best to skip this article and find another project and don't comment negatively on my topic, thank you.
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
Link to comment
Share on other sites
0 answers to this question
Recommended Posts