Jump to content

Question

Posted

Καλησπέρα!

 

Λοιπόν, εδώ και πολλές μέρες έψαχνα πώς να κάνω στο διάλογο του NPC να λέει το όνομα του χαρακτήρα π.χ: Hello 'name'! Ζήτησα βοήθεια και απο L2J , μου έδωσαν ένα κωδικό να τον βάλω αλλά δεν ξέρω που ακριβώς, ορίστε τι μου είπαν:

 

You have as basis the source file "net.sf.l2j.gameserver.model.actor.L2Npc.java" with the function "onBypassFeedback". If you created a new extension of L2Npc class, then you have to override this function, otherwise you have to handle it in this way:

 

Κώδικας:

 

# NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());

# html.setFile("HERE THE PATH TO THE HTM FILE");

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

# player.sendPacket(html);

 

Now you will be answered by the npc with the htm file but replacing the plain text %playername% in this file transformed into the player name.

You can add as many replacements as you want.

 

Τους είπα πως δεν γινόταν τίποτα και μου είπε να σιγουρευτώ αν το NPC μου είναι L2Npc , και πάλι...δεν δουλεύει.

 

Αν κάποιος έχει καμία ιδέα και μπορεί να με βοηθήσει θα το εκτιμούσα πολύ!

 

Ευχαριστώ!

 

Υ.Γ: Αν πειράζει που έκανα επικόληση αυτά που μου είπαν η παραβίασα κάποιον κανόνα , ζητώ συγνώμη.

10 answers to this question

Recommended Posts

  • 0
Posted

*bump*

 

Υ.Γ.: Πέρασε 1 μέρα απο το post μου και γι' αυτό δικαιωούμαι 1 bump

  • 0
Posted

enoeis kai kala re paidi m otan milhsei sto npc o allos na pei Welcome kai to name tou paixtei?

an kai me to code p s dosan pisteuw na leitourgi 8a koita3w kai egw kai 8a sou pw

  • 0
Posted

Επίσης μου είπαν οτι άμα είναι handled ήδη να βάλω μόνο αυτό :

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

 

Κατάφερες τίποτα Krash?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • I am very satisfied, wonderful work and trustworthy, thank you for my logo.
    • ✔ We offer more services than listed. Prices of goods may vary depending on country, warranty, phone number, and other factors. We are available 24/7. ⠀⠀⠀⠀⠀⠀⣀⣠⣤⣀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⣴⡿⠋⠉⠉⠻⢿⣦⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠹⣷⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠈⣿⡄⠀⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠸⣷⠀⠀⠀⠀⠀⠀⢸⣿⠀⠀⢀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠀⠀ ⠀⠀⠀⠀⠀⢻⣇⠀⠀⠀⠀⠀⢸⣿⣿⡿⠿⠿⠟⠛⠛⠻⢿⣿⣶⣄⠀⠀⠀ ⠀⠀⠀⠀⠀⢈⣿⠆⠀⠀⠀⠀⠀⠀⠀⠀⣀⣠⣤⣤⣤⣤⠀⠈⠻⣿⣇⠀⠀ ⠀⠀⠀⠀⢀⣾⡏⠀⠀⠀⠀⠀⠀⠀⣴⡿⠋⠉⠀⠀⠀⠀⠀⠀⠀⢹⡿⠀⠀ ⠀⠀⣀⣤⣼⣿⠀⠀⠀⠀⠀⠀⠀⢸⡟⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣷⣄⠀ ⢠⣾⠟⠋⠉⠋⠀⠀⠀⠀⠀⠀⠀⠈⣿⣦⣀⣀⣀⣤⣤⣶⣶⠿⠋⠁⢹ ⢸⣿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⡟⢉⣿⠋⠉⠉⠉⠁⠀⠀⠀⠀⢸⣿⠀ ⢸⣿⠀⠀⠀⠀⠀⢀⣀⣀⣤⣴⠿⠋⠀⠘⣷⡀⠀⠀⠀⠀⠀⠀⢀⣴⣿⠏⠀ ⢸⣿⡄⠀⠀⠀⠀⠈⠉⠉⠁⠀⠀⠀⠀⠀⣸⣿⢶⣤⣤⣴⡶⠿⠛⠙⣿ ⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢰⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⣽⣿⠀ ⠀⠘⣿⣆⠀⠀⠀⠀⣠⣤⡀⠀⠀⠀⠀⠈⠻⣧⣀⡀⠀⠀⠀⣀⣠⣴⡿⠇⠀ ⠀⠀⠘⢿⣿⣦⣤⣴⡿⠻⠿⣷⣦⣤⣤⣤⣴⣾⣿⡿⠿⠿⠿⠟⠛⠉⠀⠀⠀ ⠀⠀⠀⠀⠀⠀
    • Frozen is more popular coz adm can edit npc from client side and no need dig in xml and etc  )
    • Your work is as good as your arrogance. If you didn't break 10 systems to fix 1, I would recommend aCis. Yes, I use aCis and I fixed a lot of things that you left aside to reorganize and rename things. You insist on recommending your broken public project. Don't do that because there are many people who dream of owning a server, and in aCis 409 every dream is broken. I've seen many people break things by using this. aCis 409 doesn't work at the basics. Water movement and flying movements are broken, which is the basics. Seven Sings is completely broken, Sieges need fixing, and worst of all, level 3 and 4 clan quests are bugged, besides other quests that you intentionally broke and still recommend. You are an excellent programmer, but your arrogance in feeling superior to everyone is killing you. Happy New Year to you, and be more transparent and honest when recommending this. I'm not sharing the corrections I made, nor my Geodata system, precisely because of your arrogance. I'll soon post a video of my Geoengine system, which you spent 12 years on and didn't finish. I can send you a list of everything you need to fix, but you're too arrogant for that because you're a superior God and don't accept advice from mortals.
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..

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