Jump to content

[Share] Make an NPC dialogue say your character's name!


Sindelia

Recommended Posts

You can do "your" share in one line

"find "showChatWindow" method from L2NpcInstance and add

"html.replace("%pname%", String.valueOf(player.getName()));"

"

 

bro that isnt wornking for me... mmmm Gracia epilogue servers dont have the showChatWindow method on L2NpcInstance, instead it is on L2Npc, i added the code in there but... is not working XD i want to make this code global, like: if i write %name% in any html it returns the activeChar name... any ideas?

Link to comment
Share on other sites

corect i forgot it !...can i make this for interlude and ι combining with the welcome msg??

 

As far as I know, Interlude doesn't have that welcome msg by default so, I guess it's a custom mod. Maybe I could help you on a PM if u gave me your enterworld.java, paste it on http://pastebin.com.

Link to comment
Share on other sites

bro that isnt wornking for me... mmmm Gracia epilogue servers dont have the showChatWindow method on L2NpcInstance, instead it is on L2Npc, i added the code in there but... is not working XD i want to make this code global, like: if i write %name% in any html it returns the activeChar name... any ideas?

 

Didn't work for me either but I found the way. ;) (It's global but ONLY for NPC dialogues)

 

L2NPC:

// Send a Server->Client NpcHtmlMessage containing the text of the L2NpcInstance to the L2PcInstance
	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
	html.setFile(player.getHtmlPrefix(), filename);
	html.replace("%pname%", String.valueOf(player.getName()));

 

Sorry for double post.

Link to comment
Share on other sites

ive added some modifications to my L2Npc.java... here they are:

 

	public void showChatWindow(L2PcInstance player, String filename)
{
	// Send a Server->Client NpcHtmlMessage containing the text of the L2NpcInstance to the L2PcInstance 
	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
	html.setFile(player.getHtmlPrefix(), filename);
	html.replace("%objectId%", String.valueOf(getObjectId()));
+		html.replace("%playername%", String.valueOf(player.getName()));
+		html.replace("%npcname%", getName());
	player.sendPacket(html);

 

but for some VERY ANOYING and estrange reason its not working... can someone lend me a hand with this?

 

(Gracia Epilogue Server)

 

 

EDIT:

Didn't work for me either but I found the way. ;) (It's global but ONLY for NPC dialogues)

 

L2NPC:

// Send a Server->Client NpcHtmlMessage containing the text of the L2NpcInstance to the L2PcInstance
	NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
	html.setFile(player.getHtmlPrefix(), filename);
	html.replace("%pname%", String.valueOf(player.getName()));

 

Sorry for double post.

 

Ahhh! i did that too... but i didnt make it work :S did you? can you explain it a little bit more? only npc dialogues? but i did it on a L2Npc and it isnt working :S (Npc pixie murika, ID 31852)

 

Link to comment
Share on other sites

well... pixie murika is an L2NpcInstance maybe is because of that? dunno... im doing some little coding... ill edit this post if i find the problem :) tnx anyway for your atention

 

EDIT:

 

Okay ppl! i finally maked it really GLOBAL but if you want it you will need a little bit dedication and patience... this will also work for any server version and any chronicle...

 

steps:

you will need to use the search tool of eclipse, search for this:

 

player.sendPacket(html);

 

you will find around 140 matches... so now open each one of them and add this line over the another one:

 

html.replace("%playername%", String.valueOf(player.getName()));

 

be sure it looks like this:

 

html.replace("%playername%", String.valueOf(player.getName()));
player.sendPacket(html);

 

now press CONTROL+K (next match) and repeat the steps with all the matches in the Gameserver :) thats it! i did it on 15 mins XD i hope this help the comunity! and tnx to Pokiokio for this very cool and original idea :)

Link to comment
Share on other sites

  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.




  • Posts

    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/hoodservices https://campsite.bio/utchihaamkt
    • Yes, it is, it's not hard to do (if you know what you're doing); just time consuming.   To make some things clear: 1. You can not create .ukx files with animated skeletalmeshes inside, by using any of the freeshared L2Editors (basically, no support for .psa files) 2. You need a patched UT2003/UT2004. You can either get your own ut2004 and download Gildor's patch from his web, or use any of these: When you use these, you should be able to import both .psk and .psa animations > link the skeletalmesh to the psa > save as .ukx > use ut2down to convert the file to l2 format > encrypt the .ukx with standard l2 encryption (you can use mxc encdec, you can find it in the folder of the l2editor i shared). Your best bet is to use pawnviewer (aka dev mode) to test that. If you have troubles with that process then leave a reply here, otherwise, if it works correctly, you can move on to adding missing animnotify classes to you unrealed, then proper animnotifies, sounds, effects or w/e is missing from your .ukx files. Keep in mind that this is overall not difficult but a huge amount of work (unless you're good at scripting/macros) since you'd need to manually re-create every single animnotify, by hand. If you have doubts or i wasn't clear enough let me know here. (in case you don't know what an animnotify is: UDN - Two - AnimNotifies (unrealengine.com) )  
    • Welcome to JewStor Service!!!   ❖Ready-made verified wallets, exchanges, business banks and to order accounts. ❖EU/UK/US/DE Stuff: 100% Verified! Reliable financial tools for your business. ❖Popular items available include: Stripe business + Payoneer, Deutshce Bank, BBVA ES, Xapo Bank, Revolut business / personal, Santander Bank, Wallester business, Bitsa EU, Binance EU, Qonto Business, Blackcatcard EU, Shopify Payments, ICard EU, N26 EU, Naga Pay EU, Paysera EU, Mistertango Business and many others.
    • Custom = everything that is not part of my H5 client, such as Aegis skin, Death Knight skin, Constructor skin, Golden Valakas skin, an example is the pack containing 3 Golden Valakas skins+cloaks, to give you an idea, this pack consumes almost 200MB within the system, another example of custom is the Hunter Head set made by Asuki, almost 100MB within the system, every custom item added to the client, specifically within the system folder will increase the consumption of your client's virtual ram memory, the more custom added there, the faster your client will close due to critical. Around 4 to 5 custom packs that I removed from the system and made my client reach the ram virtual limit only after more than 40 hours online, in other words; It is only worth adding custom items to the system folder if it is very well compressed, maximum up to 10MB per custom pack (This pack below in the photo, only it inside your client - system consumes almost 200MB, when I removed this pack inside the system it increased the game's lifespan by almost 4h during my tests)
    • ready pack for sale with lucera files made from scratch price is 350 euros without the license the server is x30 rate the server is there to see everything test ie.. there have been several changes everything works there will be support for everything for as long as possible please, can you send me a message here, there is complete transparency in everything
  • Topics

×
×
  • Create New...