Jump to content
Sign in to follow this  
Graf

Говорящий НПС

Recommended Posts

Говорящий НПС

Всем привет. Нашел на mega код. Выглядит он так:

function ChaSay(role,target,text)
	local pkt = GetPacket()
	local tid = GetCharID( target )
	WriteCmd( pkt, 501 );
	WriteDword( pkt, tid );
	WriteString( pkt, text);
	SendPacket( role, pkt );
end

function cha_npc_timer(ignore, character,freq,time)
	local name = GetChaDefaultName (character)
	local target = find_target(character,300)
	local playername = GetChaDefaultName (target)
		ChaSay(target,character, "Э, " ..playername.. " сюда иди!" )
end
	
Hook:AddPostHook("cha_timer", cha_npc_timer, 2)

Но есть одно "НО")))

Разговаривают сразу все НПС.

Как прописать это определенному НПС?

Edited by Graf

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  

×
×
  • Create New...