Jump to content
  • 0

Custom Zone (Random Race Display)


Question

Posted (edited)

Hello.

 

I created a custom zone. And I edited the charinfo, so when a player enters the zone his/her name will be "Unknown".

 

However, my problem is that the system damage message still displays the original name of the characters. (I guess becuase the changes in charinfo only affect the client and the server still recognize the character's origianl name).

 

My question is: what should I edit or change in order to have the system message display "unknown" instead of the original names?

 

I know i could create new system messsages (instead of $c1 done $s3 damge $c2 to unknown done $s3 damage to unknown) but I'd rather avoid this if theres a better way.

 

 

EDIT:

 

Does anybody have any suggestion, ideas how could I make  Random Race displayed in a specific zone for players?

 

Either in Charinfo, or some other working method would be great.

 

Thank you.

 

 

P.S: Im using High Five latest rev.

Edited by Horse

Recommended Posts

  • 0
Posted (edited)
getAntifeedTemplate() != null 

wherever it's needed, because it is null the majority of time, and not null only for events. As you use the packets both for events and regular, it needs a null check, until you initialize it with a default template and avoids to null it after the event as you currently do.

 

PS : easiest would be to initialize and get same template for everyone. That avoid your do/while loop for race, that avoid to generate shitloads amount of pointless templates, that avoid to get NPE checks. You initialize a static template and refers to it everytime you need it ; can't be null, single object, best performance.

 

First of all, thank you for the little explanation. For me who has just started to get into "coding and java"  a few weeks ago, these tiny explonations help me to understand a whole lot about how java works.

 

On topic: I've added the null checks. This solved the npe errors that i got when i entered the custom zone where I d like to apply the race change.

 

However, currently i get no errors at all, but once i recall or enter with a second char to the zone i see the original template.  (the name change works as it should along with the system message (unknown hit unknown for xxx damage) without the need to edit systemmessage.dat directly, which is a blessing.

 

I assume that something might be wrong with the createRandomAntifeedTemplate(). So, I'm still keep trying.

 

 

You mentioned to get a given/same template for everyone. Originally this was my idea as well, however due to the lack of my knowladge or experience with l2 java, I wasn't able to figure it out, how can I pick a certain template.

To my understanding, the antifeed method which I tried to adopt uses values of the classid to verify the temlate (if im not mistaken). But this is where I'm stuck, becuase I do not know how can I get  (a) certain template(s).

 

An exemple or hint like: getting the template of "orc fighter" for each class would be very helpful.    (I find exemples the best way to learn).

 

 

In any case, thank you for the help you've already provided, it sure is useful.

Edited by Horse
  • 0
Posted (edited)

Short but gold : almost everything exists already on sources. EVERYTHING. If you don't know how to make something, be sure it already exists, on a form or another. 99,9% of time.

 

Case of templates : when you login with your player, you're (logically, as you already understand the trick with edit race template) associated with a template. According to you, is that template generated with your player instance... Or is it preloaded from static XMLs, stored on static maps and simply "pulled out" on demand ? You already know than players use PcTemplate as type of template, a simple search over sources will get you :

  • (first search with "PcTemplate" keyword) CharTemplateTable holds PcTemplate on a Map<Integer, PcTemplate> internally named _templates, but publically accessible with getter getTemplate(int/ClassId) - so a CharTemplateTable.getInstance().getTemplate( will load you the given template.
  • (another search with "CharTemplateTable.getInstance().getTemplate(" keyword) CharTemplateTable.getInstance().getTemplate( is used 16 times over (aCis) sources : character creation packets (we don't care), and 5 uses on L2PcInstance. If you got an issue with templates those 5 occurences need to be checked and eventually overidden by your own event template. Because both templates exist, and the reference template is and stay the base template.

The fact than you edit the template at a moment M doesn't mean the template is now the one you gave. It stills reference to base template. If you don't say "I'm on an event, please keep the given template for all scenarios until I give another order" it simply uses the one registered. Exactly like player name.

Edited by Tryskell
  • 0
Posted (edited)

Short but gold : almost everything exists already on sources. EVERYTHING. If you don't know how to make something, be sure it already exists, on a form or another. 99,9% of time.

 

Case of templates : when you login with your player, you're (logically, as you already understand the trick with edit race template) associated with a template. According to you, is that template generated with your player instance... Or is it preloaded from static XMLs, stored on static maps and simply "pulled out" on demand ? You already know than players use PcTemplate as type of template, a simple search over sources will get you :

  • (first search with "PcTemplate" keyword) CharTemplateTable holds PcTemplate on a Map<Integer, PcTemplate> internally named _templates, but publically accessible with getter getTemplate(int/ClassId) - so a CharTemplateTable.getInstance().getTemplate( will load you the given template.
  • (another search with "CharTemplateTable.getInstance().getTemplate(" keyword) CharTemplateTable.getInstance().getTemplate( is used 16 times over (aCis) sources : character creation packets (we don't care), and 5 uses on L2PcInstance. If you got an issue with templates those 5 occurences need to be checked and eventually overidden by your own event template. Because both templates exist, and the reference template is and stay the base template.

The fact than you edit the template at a moment M doesn't mean the template is now the one you gave. It stills reference to base template. If you don't say "I'm on an event, please keep the given template for all scenarios until I give another order" it simply uses the one registered. Exactly like player name.

Thank you once more, for the detailed explanation. Once I get home, I'll take a closer look at the things you wrote.

 

"CharTemplateTable.getInstance().getTemplate(" keyword) CharTemplateTable.getInstance().getTemplate( ---->this far I got, and more or less understood it on my own. But i wasn't sure what holds the template's themselves since it's a bit different in hi5. But I'm beginning to understand how it works.  P.S In my case there is no charTemplateTable (newer hi5 versions have this stored in some other file i assume---most likely this will be the problem).

Edited by Horse
  • 0
Posted (edited)

Basically said, search wherever L2PcTemplate is used. I gave you exemples based on aCis / IL. L2PcTemplate still exists on latest L2J sources, so...

I cleaned up and changed the method of getAntiFeedTemplate(), I picked a specific template (elvenfighter) for starters. And it seems to be working fine.

 

All that's left is to make it pick random IDs from  my own random list with Rnd.

 

Thanks a lot, Tryskell.

 

 

 

P.S : This is just a slight cosmetic issue. When an other char enters or leaves the zone ( where i applied the custom template) by simply walking out and in (NO TELEPORT), the template changes only when the character gets hit or affected by skills or some action. (ofc when it is teleported it display the changed template, so you see the new template already.  I was just wondering if the template change could be seen automatically by simply walking inside the zone.

Since, most of the time this zone and zones alike will be accasabble by teleport, or will be used as event zones it isn't that much of an issue. But I'm curious if there is some kind of way to fix that.

Edited by Horse
  • 0
Posted

Sounds like missing broadcast. Are you using decayMe, spawnMe, broadcast? Thats the order, I guess, when you change class with gm command. Do the same.

  • 0
Posted

How is your zone onEnter / onExit ? If it's not yet handled here, it should. If it is, then it's like SweeTs said.

Yes. It wasn't handled there. Now it seems to be fine.

 

Thank you guys.

 

 

 

Topic can be locked.

Guest
This topic is now closed to further replies.


  • Posts

    • Experience L2Gold like never before – available ONLY on Saturdays & Sundays! Custom Armors: Dynasty, Apella Custom Weapons: L2Gold Weapons Custom Jewelry: L2Gold Jewelry Custom Teleport System & AIO Buffer Custom Zones, NPCs & Raidbosses This is not just another private server – it’s a limited-time battleground for the ultimate L2 experience! Play only on weekends Website: https://l2kandra.online/ Info & Contact: https://www.facebook.com/profile.php?id=61578869175323  
    • 突发新闻! Twitter Premium(推特高级版) 现以优惠价发售!立即尝试 — 限时优惠! ➡ Twitter Premium X 订阅(适用于您的推特账户),可选 1 个月 / 1 年(任选)。需要登录授权您的推特账户。价格:每月 $7–13(每年 $75) ➡ Twitter X Premium Plus 订阅 + GROK AI 助手(适用于您的推特账户),可选 1 个月 / 1 年(任选)。需要登录授权您的推特账户。价格:每月 $48–55(每年 $480) ➡ 2010–2023 年老推特账号,带蓝色认证标志(Tier 1/2/3 国家)| 提供完整访问权限(含登录名、密码和令牌)| 价格:起价 $9 ➡ 2010–2023 年老推特 NFT 账号,带蓝色认证标志(Tier 1/2/3 国家)| 提供完整访问权限(含登录名、密码和令牌)| 价格:起价 $9 ➡ 2010–2023 年老推特账号,带蓝色认证标志 + 真实粉丝(100–20000,可自选)| Tier 1/2/3 国家 | 提供完整访问权限(含登录名、密码和令牌)| 支持补充:30+ 天 | 价格:起价 $9.5 ➡ 2010–2023 年老推特账号,带广告管理器(ADS Manager)和蓝色认证标志,并绑定信用卡 | 区域:Tier 1 国家 | 提供完整访问权限(含登录名、密码和令牌)| 价格:起价 $35 您可以在我们的网站商店或通过 Telegram 机器人购买! ➡ 数字商品商店(网站):前往 ➡ 商店 Telegram 机器人:前往 ➡ Telegram Stars 购买机器人:前往 ➡ SMM 面板:前往 – 推广您的社交媒体账户。 我们为您呈现最新的优惠与特别活动,用于购买我们平台的商品和服务: 1. 使用优惠码 OCTOBER2025(8% 折扣)在十月于我们的网站或机器人中购物!首次购买还可使用优惠码 SOCNET(15% 折扣) 2. 注册后在我们网站的论坛主题中按以下格式留言,即可获得 $1 商店余额或 10–20% 折扣:"SEND ME BONUS, MY USERNAME IS..." 3. 首次试用 SMM 面板即可获得 $1:只需在网站支持中心提交标题为 “Get Trial Bonus” 的工单。 4. 我们的 Telegram 频道与 Telegram Stars 购买机器人每周举行 Telegram Stars 抽奖活动! 新闻资讯: ➡ Telegram 频道:https://t.me/accsforyou_shop✅ ➡ WhatsApp 频道:https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t✅ ➡ Discord 服务器:https://discord.gg/y9AStFFsrh✅ 联系方式与支持: ➡ Telegram:https://t.me/socnet_support✅ ➡ WhatsApp:https://wa.me/79051904467✅ ➡ Discord:socnet_support ✅ ➡ ✉ 邮箱:solomonbog@socnet.store ✅
    • Breaking News! Twitter Premium now available at a discounted price! Try it right now — limited-time offer! ➡ Twitter Premium X subscription for your Twitter account for 1 month / 1 year (your choice). Requires login authorization to your Twitter account. Price from: $7–13 per 1 month ($75 per 12 months) ➡ Twitter X Premium Plus subscription and GROK AI assistant for your Twitter account for 1 month / 1 year (your choice). Requires login authorization to your Twitter account. Price from: $48–55 per 1 month ($480 per 12 months) ➡ Old Twitter Accounts 2010–2023 with BLUE Regular Tick (Tier 1/2/3 countries) | Full access with Login, Password, and Token included! | Price from: $9 ➡ Old Twitter NFT Accounts 2010–2023 with BLUE Tick (Tier 1/2/3 countries) | Full access with Login, Password, and Token included! | Price from: $9 ➡ Old Twitter Accounts 2010–2023 with BLUE Regular Tick and real followers: 100–20000 (followers of your choice) | Tier 1/2/3 countries | Full access with Login, Password, and Token included | Refill: 30+ days | Price from: $9.5 ➡ Old Twitter Accounts 2010–2023 with ADS Manager and BLUE Regular Tick linked with Credit Card | GEO: Tier 1 countries | Full access with Login, Password, and Token included | Price from: $35 Shop in our online store or through our Telegram bot! ➡ Digital goods store (Website): Go ➡ Store Telegram bot: Go ➡ Telegram bot for purchasing Telegram Stars: Go ➡ SMM Panel: Go – promote your social media accounts. We would like to present you with the latest list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) in October! You can also use the first-time promo code SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." – post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a support ticket with the title “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop✅ ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t✅ ➡ Discord server: https://discord.gg/y9AStFFsrh✅ Contacts and Support: ➡ Telegram: https://t.me/socnet_support✅ ➡ WhatsApp: https://wa.me/79051904467✅ ➡ Discord: socnet_support ✅ ➡ ✉ Email: solomonbog@socnet.store ✅
    • Breaking News! Twitter Premium now available at a discounted price! Try it right now — limited-time offer! ➡ Twitter Premium X subscription for your Twitter account for 1 month / 1 year (your choice). Requires login authorization to your Twitter account. Price from: $7–13 per 1 month ($75 per 12 months) ➡ Twitter X Premium Plus subscription and GROK AI assistant for your Twitter account for 1 month / 1 year (your choice). Requires login authorization to your Twitter account. Price from: $48–55 per 1 month ($480 per 12 months) ➡ Old Twitter Accounts 2010–2023 with BLUE Regular Tick (Tier 1/2/3 countries) | Full access with Login, Password, and Token included! | Price from: $9 ➡ Old Twitter NFT Accounts 2010–2023 with BLUE Tick (Tier 1/2/3 countries) | Full access with Login, Password, and Token included! | Price from: $9 ➡ Old Twitter Accounts 2010–2023 with BLUE Regular Tick and real followers: 100–20000 (followers of your choice) | Tier 1/2/3 countries | Full access with Login, Password, and Token included | Refill: 30+ days | Price from: $9.5 ➡ Old Twitter Accounts 2010–2023 with ADS Manager and BLUE Regular Tick linked with Credit Card | GEO: Tier 1 countries | Full access with Login, Password, and Token included | Price from: $35 Shop in our online store or through our Telegram bot! ➡ Digital goods store (Website): Go ➡ Store Telegram bot: Go ➡ Telegram bot for purchasing Telegram Stars: Go ➡ SMM Panel: Go – promote your social media accounts. We would like to present you with the latest list of promotions and special offers for purchasing products and services from our platform: 1. Promo code OCTOBER2025 (8% discount) for purchases in our store (Website or Bot) in October! You can also use the first-time promo code SOCNET (15% discount) 2. Get $1 credited to your store balance or a 10–20% discount — just post your username after registration on our website in the following format: "SEND ME BONUS, MY USERNAME IS..." – post it in our forum thread! 3. Get $1 for your first SMM Panel trial — just open a support ticket with the title “Get Trial Bonus” on our website (Support). 4. Weekly giveaways of Telegram Stars in our Telegram channel and our Telegram bot for Star purchases! News: ➡ Telegram channel: https://t.me/accsforyou_shop✅ ➡ WhatsApp channel: https://chat.whatsapp.com/K8rBy500nA73z27PxgaJUw?mode=ems_copy_t✅ ➡ Discord server: https://discord.gg/y9AStFFsrh✅ Contacts and Support: ➡ Telegram: https://t.me/socnet_support✅ ➡ WhatsApp: https://wa.me/79051904467✅ ➡ Discord: socnet_support ✅ ➡ ✉ Email: solomonbog@socnet.store ✅
    • Enthusiasm about everything functioning perfectly, until those files became public. These files taught me the difference between making things work in a private, commercial environment versus releasing your work publicly and facing intense scrutiny over even the smallest details.  
  • 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