Jump to content
  • 0

Question

Posted (edited)

So I adapted a code from l2jbrasil into my pack, however since it was old as shit I decided to remake it.

 

So i did

 

 

in config.java

+      public static boolean ENABLE_LEVEL_REWARD;
+      public static int LEVEL_REWARD_ITEM;
+      public static int LEVEL_REWARD_COUNT;
+      public static int LEVEL_TO_REWARD;
+ENABLE_LEVEL_REWARD = Boolean.parseBoolean(L2JHellasSettings.getProperty("AllowLevelRewardSystem", "False"));
+LEVEL_REWARD_ITEM = Integer.parseInt(L2JHellasSettings.getProperty("LevelewardItemID", "57"));
+LEVEL_REWARD_COUNT = Integer.parseInt(L2JHellasSettings.getProperty("LevelRewardAmount", "1"));
+LEVEL_TO_REWARD = Integer.parseInt(L2JHellasSettings.getProperty("PlayerLevel", "20"));


+if (USE_SAY_FILTER)

then in L2PCinstance.java

+              
+              // Level Reward System
+              if (Config.ENABLE_LEVEL_REWARD && getLevel() == Config.LEVEL_TO_REWARD)
+              {
+                      // Item Level Reward System
+                      addItem("Level Reward", Config.LEVEL_REWARD_ITEM, Config.LEVEL_REWARD_COUNT, this, true);
+                      sendMessage("Make sure you reach your level first. " +Config.LEVEL_TO_REWARD+ " .");
+                      NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
+                      html.setFile(new StringBuilder("data/html/mods/LevelReward/level.htm").toString());
+                      html.replace("%objectId%", String.valueOf(getObjectId()));
+                      sendPacket(html);
+              }

Its just a simple code in order to reward players once they reach level 80.

 

I have added everything into l2jhellas.ini, and I have made the html file in the correct order

 

when I start the server I get informed that the level rewarder is enabled in the console. But when my player reachers level 80 he gets no reward. What am I missing here?

Edited by ExtreameR

Recommended Posts

  • 0
Posted

Try adding the code @ rewardSkill() method, before

 

 

if (Config.AUTO_LEARN_SKILLS)

 

Also, how could that work while you put your code @ doPickupItem() method which has nothing to do with that case :happyforever:

  • 0
Posted

aha right, so at which sector do i have to put it at, I pretty much have the same problem with my other code that I reworked, I am still mildly confused what goes where

  • 0
Posted

It needs to be there because you want a code to check if the character reaches the X level.

 

At PcStat, @addLevel method.

  • 0
Posted

yeah so, what is wrong then, thats what I am wondering, the html does not pop up, but at the console everything seems stable and smooth. Same for the Kill streak feature.

  • 0
Posted

Show your addLevel method, once you moved the custom inside it.

 

And verify your ini properties names match with your Config.java, otherwise the default values are used (false, 20, 57, 1).

  • 0
Posted (edited)

Check to the first point

 

Check to the second point

 

However I am still receiving the same shit, I think being on a lot of medial drugs killed my brain heh.

 

 

 

Edit: I am getting no errors in eclipse, no errors in console, I also checked the ini files by disabling, enabling the mod, and it works perfectly fine.

 

so its either I am partially brain dead and I am doing something wrong in regards to player hitting the level and receiving the reward and the html popping up (none of which occours) or I am just missing something simple.

Edited by ExtreameR
  • 0
Posted (edited)

When you reach the desired lvl, does you get the msg ? Or nothing from the code is working ?

sendMessage("Make sure you reach your level first. " +Config.LEVEL_TO_REWARD+ " .");
Edited by SweeTs
  • 0
Posted

 

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (revision 10)
+++ java/net/sf/l2j/gameserver/model/actor/stat/PcStat.java (working copy)
@@ -23,6 +23,8 @@
 import net.sf.l2j.gameserver.model.base.Experience;
 import net.sf.l2j.gameserver.model.quest.QuestState;
 import net.sf.l2j.gameserver.network.SystemMessageId;
+import net.sf.l2j.gameserver.network.serverpackets.ActionFailed;
+import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
 import net.sf.l2j.gameserver.network.serverpackets.PledgeShowMemberListUpdate;
 import net.sf.l2j.gameserver.network.serverpackets.SocialAction;
 import net.sf.l2j.gameserver.network.serverpackets.StatusUpdate;
@@ -196,6 +198,19 @@
  su.addAttribute(StatusUpdate.MAX_MP, getMaxMp());
  getActiveChar().sendPacket(su);
  
+ boolean allowReward = true;
+ int level = 80;
+ 
+ if (allowReward && getActiveChar().getLevel() == level)
+ {
+ getActiveChar().addItem("", 57, 1, getActiveChar(), true);
+ getActiveChar().sendMessage("Make sure you reach your level first. " +level+ " .");
+ NpcHtmlMessage html = new NpcHtmlMessage(0);
+ html.setFile("data/html/mods/yourHtml.htm");
+ getActiveChar().sendPacket(html);
+ getActiveChar().sendPacket(ActionFailed.STATIC_PACKET);
+ }
+ 
  // Update the overloaded status of the L2PcInstance
  getActiveChar().refreshOverloaded();
  // Update the expertise status of the L2PcInstance
  • 0
Posted (edited)

Sweeets you're my hero! topic solved !

 

@devlin there was no need of adding the an extra boolean in PcStat.java

Edited by ExtreameR
Guest
This topic is now closed to further replies.


  • Posts

    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click   🚀 Promo code: MEDIUM5 (5% Discount)   ➡️ Online Store: Click ✅ ➡️ Telegram Bot: Click ✅ ➡️ SMM Panel: Click ✅   Regular customers receive additional discounts and promo codes!   Support: ➡️ Telegram: https://t.me/solomon_bog ✅ ➡️ Discord: https://discord.gg/y9AStFFsrh ✅ ➡️ WhatsApp: https://wa.me/79051904467 ✅ ➡️ Email: solomonbog@socnet.store ✅   ➡️ Telegram Channel: https://t.me/accsforyou_shop ✅   You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners )  — Becoming a supplier   SocNet — your store for digital goods and premium subscriptions ✅
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • SocNet is now on Medium! Check out our new article showcasing the full potential of our store and SMM Panel! Article: Click Promo code: MEDIUM5 (5% Discount) Online Store: Click Telegram Bot: Click SMM Panel: Click Regular customers receive additional discounts and promo codes! Support: Telegram: https://t.me/solomon_bog Discord: https://discord.gg/y9AStFFsrh WhatsApp: https://wa.me/79051904467 Email: solomonbog@socnet.store  Telegram Channel: https://t.me/accsforyou_shop You can also contact us for: — Wholesale inquiries — Partnership opportunities (Current partners: https://socnet.bgng.io/partners ) — Becoming a supplier SocNet — your store for digital goods and premium subscriptions  Want to expand your business network or promote services through the largest B2B platform? LinkedIn accounts are your tool for marketing, recruiting, and outreach automation. Perfect for SMM, hiring, lead generation, and business scaling. ➡ Ready-made accounts — fast, convenient, no hassle. Promo code: LINKEDIN5 (5% discount) Payment: Bank cards · Cryptocurrency · Other popular methods How to buy: ➡ Online Store: Click ➡ Telegram Bot: Click Other services: ➡ SMM Panel: Click Product range: ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM USA IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM EUROPE IP | Price from: $2.5 ➡ LINKEDIN.COM ACCOUNTS | EMAIL INCLUDED @OUTLOOK.COM / @HOTMAIL.COM / @FIRSTMAIL.COM, MALE OR FEMALE, PARTIALLY FILLED PROFILES, REGISTERED FROM MIX IP | Price from: $2.5 ➡ LinkedIn Old Brute Account with Real Connections (0 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $10 ➡ LinkedIn Premium Brute Account (Premium) with active 1-month Premium subscription | Geo: MIX | Registered on real device | Full account access | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (50 connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $20 ➡ LinkedIn Old Brute Account with Real Connections (100+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $39 ➡ LinkedIn Old Brute Account with Real Connections (500+ connections) | Mix Geo | Filled Profile | Registered on real device | Price from: $69 ➡ LinkedIn Verified Brute Account with verified documents | Geo: MIX | Registered on real device | Full account access | Price from: $89 Loyal customers — additional discounts and promo codes! Support: ➡ Telegram: https://t.me/solomon_bog ➡ Discord: https://discord.gg/y9AStFFsrh ➡ WhatsApp: https://wa.me/79051904467 ➡ Email: solomonbog@socnet.store ➡ Telegram Channel: https://t.me/accsforyou_shop Also via these contacts you can: — Consult about wholesale purchases — Set up a partnership (current partners: https://socnet.bgng.io/partners ) — Become our supplier SocNet — Digital Goods and Premium Subscriptions Store
    • Buying & Selling Torn City Cash
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock