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

    • Hello community, I’d like to share an improved version of the L2smr editor for StaticMeshes, focused on solving some workflow issues I found in the original tool. CreditsThis project is based on the original acmi/L2smr repository https://github.com/acmi/L2smr , created by acmi, and I updated it to Java 17 with some additional features. Issues in the original L2smr Too many windows: each StaticMesh opened in a new one → cluttered desktop. No search: navigating through hundreds of StaticMeshActors was slow and tedious. Added improvements Flexible views Single Window Mode: reuse one window instead of opening new ones. Multiple Window Mode: still available for those who prefer having several views open simultaneously. Real-time Search Field Instant filtering as you type. Case-insensitive search. “Reset” button to quickly clear the search.     Installation and Execution: Clone the repository: git clone https://github.com/Jeep12/l2smr.git cd l2smr        2.Build the project:   ./gradlew build        3. Run the application:     ./run.bat      Or simply double-click on run.bat.     The run.bat script automatically extracts JavaFX from the included javafx-17.0.2.zip file in the javafx/ directory, sets up the required libraries, and launches the application. You don’t    need to install JavaFX separately.      Repository: https://github.com/Jeep12/l2smr     Maybe these features already existed in another version or fork, and they might not be very big changes, but since I didn’t know about them and found them necessary, I decided to          implement them myself and wanted to share them.      
    • no....Mobius L2Clientdat and L2FileEditor can do that...but still cant works with TaiWanese Grand Crusade ,especially Armorgrp.dat and Armorgrp-Classic.dat
    • L2GOLD - Halcyon x45 Project Classic Interlude   C6 - Classic Interlude: Protocol 110     Is a complete copy of L2Gold in Classic [110 Protocol] with L2OFF files.   Fully L2Gold Features - Daily Quest - Daily Mining Quest - Ancient Weapons -Refine System  -Rebirth System -Fully configurable everything you want -Gold stats/Gold skills/Gold items working 100% -Zones 100% alike  -Unique donations system (npc or voicedcommand .donate) - On Enchant success announcement ( if +16 for weapon, 8 for armor , 7 for jewel) - Announce of Castle Lord - Announce of Hero  - Olympiad Max A grade - Olympiad Buffs on matches changed to Gold Alike - Working fully Dreadbane   - AI Mods: Static Time for RB   Automated Events: Squash Watermelon RB Event High rate  (those are fully automated)   Server is running a Test Server: Online to anyone can test it.   Game Client: https://www.mediafire.com/file/1d8xe18rvgi04lx/L2_Classic_Interlude_Client_V2.rar/file   Game Patch: https://www.mediafire.com/file/3z4b8ezy93h2z1g/L2Halcyon+Gold+Patch.rar/file   GM Accounts: ID: root pass root [ accounts go from  root1 until root20 ]   Regular Accounts Registrations: http://84.247.164.27/?page=register   Some Screenshots: https://imgur.com/a/o7TxzTN   Contact me here via PM (only serious buyers).    Price of the product: Fully Server Pack + Source ( 250 Euros )
    • ✨ A Service with Vibes  Vibe SMS ✨   Vibe SMS is not just a platform for working with numbers. We’ve built it to be simple, convenient, and stress-free, so your tasks get done without hassle. We value real communication: we listen to your ideas, provide support, and make sure everyone feels calm and confident. With us, you’re not just a client  you’re part of a space built on trust, support, and a human touch. Vibe SMS is a place where people matter and where we create an atmosphere you’ll want to stay in.   Website link — https://vibe-sms.net/ Our Telegram channel — https://t.me/vibe_sms
  • 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