Page 1 of 2
Talking NPCs
Posted: Sun Jan 19, 2014 4:33 am
by kornom
If you want to receive support we need this info to help you properly.
ยป Find Revision
L2J Revision
Number:Last
L2JDP Revision
Number:Last
Is there a way to make specific NPCs to shut up? Or atleast speak less?
Example Monks in MOS... They just spaaaam the chat.
Or this wondering Monk in towns...
I tought monks are quiet people lol.
Re: Talking NPCs
Posted: Sun Jan 19, 2014 5:02 am
by NosBit
You can hide them from client chat options

Re: Talking NPCs
Posted: Sun Jan 19, 2014 5:05 am
by kornom
Hides their Names
Not chat tho
Re: Talking NPCs
Posted: Sun Jan 19, 2014 7:14 am
by NosBit
Checking Do not view NPC dialogue hides it
http://pasteboard.co/22b5nXZ.png
Re: Talking NPCs
Posted: Sun Jan 19, 2014 8:06 am
by Hyrelius
It still requires every user to do it. Is there a server-side way to e.g. remove or add talking NPCs (as easy as possible) - is probably what kornom wants to know. I'd also like to know this.. I know we can write AIs etc., but is there a relatively easy way to add, remove or even change this?
Re: Talking NPCs
Posted: Sun Feb 09, 2014 12:43 pm
by vampir
Take a look at AbstractNpcAi#broadcastNpcSay
I think the best solution, is to make Map<Integer, Long> in L2PcInstance that will contain Message Id and Time of receiving the message. Then while broadcasting message of Npc, we would have to check when that message was received last time, if delay(between next and last messages) is too small, just don't send message to that player.
Re: Talking NPCs
Posted: Sun Feb 09, 2014 12:55 pm
by jurchiks
You would need to store that map for each player, which is obviously a bad idea.
Re: Talking NPCs
Posted: Sun Feb 09, 2014 1:27 pm
by vampir
You could store it in each player, new class containing such data.
What's your idea to achieve same result without creating such map?
Re: Talking NPCs
Posted: Sun Feb 09, 2014 1:31 pm
by jurchiks
Why would you even want the NPC to send the message to each player seperately? Just decrease the chat delay and be done with it. People always have to complicate things unnecessarily...
Re: Talking NPCs
Posted: Sun Feb 09, 2014 1:38 pm
by vampir
1. Lets say you are entering monastery of silence and monsters have something important to say("Everybody carring the weapon, will die by our hand"). Now if we will put 5 minutes delayad between the messages, new player that just entered the zone might be killed by those monsters because he didn't know about the weapon.
2. If you will make npcs talk to each other, we could make players able to read whole conversation(from first message to last) even if he just teleported to town and other players are there for 30 minutes.
Re: Talking NPCs
Posted: Sun Feb 09, 2014 3:46 pm
by jurchiks
vampir wrote:1. Lets say you are entering monastery of silence and monsters have something important to say("Everybody carring the weapon, will die by our hand"). Now if we will put 5 minutes delayad between the messages, new player that just entered the zone might be killed by those monsters because he didn't know about the weapon.
That's just an onSeeCreature trigger.
vampir wrote:2. If you will make npcs talk to each other, we could make players able to read whole conversation(from first message to last) even if he just teleported to town and other players are there for 30 minutes.
If the player missed the start of the conversation, there is no reason to compensate for that wasting precious system resources, it's the player's fault. He can just wait until the convo starts over.
For example, if you were to script the NPCs moving along routes and talking specific texts at each specific point in the route. You would not want to start the messages when the player appears, that would mean the messages would start at wrong points in the routes.
TL;DR - don't waste resources on something miniscule like this. Nobody will care except
maybe the most hardcore role-players.
Re: Talking NPCs
Posted: Sun Feb 09, 2014 4:19 pm
by vampir
Yeah, but still while using onSeeCreature you need to know somehow if player already received that CreatureSay or not.
Let's say you have created 100 conversations between npcs in one town. You are saying to make them linear and same for every player because it's their fault that they entered in town in middle of conversation they saw last time. I would prefer to make them different for every player, depending if he already saw that conversation or not.
All about 1-3 mb of ram, while most of the servers have at least 16gb and they don't even need half of it.
Re: Talking NPCs
Posted: Sun Feb 09, 2014 4:44 pm
by jurchiks
Ok, on zone enter, whatever.
Prefer what you want, it is a complete waste of resources. Nobody will care about those synced dialogs, not in this game.
Re: Talking NPCs
Posted: Sun Feb 09, 2014 7:33 pm
by Hyrelius
jurchiks - if you don't care, then it's fine. Noone forces you to answer here, right? Apparently there are enough people on here who actually care.
There should be a nice way to set the auto-text for NPCs as well as its delay. I don't know of such a way. Hence the topic in here.
If you don't have anything to contribute except for "who cares for this" then please don't care and don't pollute this thread.
Re: Talking NPCs
Posted: Sun Feb 09, 2014 8:14 pm
by vampir
Messages of MOS monsters are hardcoded in MonasteryOfSilence.java, the only way i noticed to show such message from xml files can be found in Routes.xml(Prophets in Towns are using it). They are connected with next move, example:
Code: Select all
<point npcStringId="1010223" X="43531" Y="-48109" Z="-792" delay="0" run="false" />
You could add something like:
example 1:
Code: Select all
<npc_say text="sadsdsad sad asdas" delay="300" />
example 2:
Code: Select all
<npc_say id="1010221" delay="300" />
example 3:
Code: Select all
<npc_say text="sadsdsad sad asdas" action="death" />
and write core support for it.