View Full Version : [Request] NPC that speaks?
How I can make that a npc speaks when I want (at general chat)?
When you want I don't know, for boss that's the way (maybe you already know this):
npcdata:
npc_begin warrior 493 [tiger_hornet] level=26 exp=2497077.5 acquire_exp_rate=xx.xx
...
ignore_clan_list={} ruler=0 ruling_domain={} npc_ai={[tiger_hornet];{[ShoutMsg1]=[1000118]};{[ShoutMsg2]=[1000119]};{[ShoutMsg3]=[1000120]};{[ShoutMsg4]=[1000121]}} corpse_time=7 no_sleep_mode=0 npc_end
fstring
1000118 [''Que tal sabe la miel de este lugar?!]
1000119 ['Dame algo dulce, deliciosa miel dorada!]
1000120 [Si me das algo de miel, te perdonare la vida...]
1000121 [Si hubiera encontrado algo de miel... no habria perdido contra alguien como tu.]
These are the messages he'll say:
1-When it respawns.
2-Every X time (when it's not been attacked).
3-When a player attacks it.
4-When it dies.
So, for bosses, it's easy, add new fstrings and put them into the npc.
Osito2Dancer
27.03.2006, 14:45
You have to edit the AI for the NPC you want to "shout" also.
Oso
there 3 ways to do it
1.-by npc data u have to set some strings at strings file.
2.- By using Shout function. Shout ("blabla");
3.- Say function. Say("BlaBla");
last two ones on ai.
Use NASC to compile it.
shift_sp 1
push_const 1000007
S269. ""
push_string S269
S270. ""
push_string S270
S271. ""
push_string S271
S272. ""
push_string S272
S273. ""
push_string S273
func_call 89 // func[MakeFString]
shift_sp -6
func_call 37 // func[Say]
shift_sp -1
shift_sp -1
Change the String numbers so they are unique in your AI.obj. Replace 1000007 with the number for the string in fstring.txt