Λοιπόν, εδώ και πολλές μέρες έψαχνα πώς να κάνω στο διάλογο του 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 , και πάλι...δεν δουλεύει.
Αν κάποιος έχει καμία ιδέα και μπορεί να με βοηθήσει θα το εκτιμούσα πολύ!
Ευχαριστώ!
Υ.Γ: Αν πειράζει που έκανα επικόληση αυτά που μου είπαν η παραβίασα κάποιον κανόνα , ζητώ συγνώμη.
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.
L2jMobius has a variety of servers, that all are actively developed.
https://gitlab.com/MobiusDevelopment/L2J_Mobius
Better version if you donate 200 euros to the project? Yes.
https://l2jmobius.org
A tutorial is provided.
https://l2jmobius.org/forum/index.php?topic=3231.0
Please do not come if you cannot compile and test on your own.
MidnightSell team WTB/WTS GOLD TWW EU/US all servers
Cataclysm all servers
Payment Visa/Master/Btc/Eth/Trc-20/Erc-20 (all payments within 10 min)
For all question pls dm
Discord https://discord.gg/h8AN57qJjK
Or Telegram @MidnightSell
Looking for gracia final or gracia epilogue java server. The seller must include full source files
test server is a must,please dont come with shared files. PM ME
Question
Sindelia
Καλησπέρα!
Λοιπόν, εδώ και πολλές μέρες έψαχνα πώς να κάνω στο διάλογο του 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
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.