hienvienkiem_1
17-09-14, 09:29 PM
e đang làm 1 npt nhưng ấn vào npt đó không hiên gì cả mấy bác giúp em chỉnh lại cái code với :
--NPC 姓i L?
--ID: 009999
--Script: Edit by S骾 Kool
--**************************
x009999_g_ScriptId = 009999
--**************************
function x009999_OnDefaultEvent(sceneId,selfId,targetId)
local nam = LuaFnGetName(sceneId,selfId)
BeginEvent(sceneId)
AddText(sceneId,"Ch鄌 m譶g "..nam.." 皙n v緄 Thi阯 Long B醫 B?edit by S骾 Kool !#rTa chuy阯 cung c th秈 trang cao c m鬾 ph醝, c醕 h?c?mu痭 ch鱪 m祎 m髇 kh鬾g ?")
AddNumText(sceneId,x009999_g_ScriptId,"Nh th秈 trang c 2",1,1)
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
end
--**********************************
--Ki琺 tra t鷌
--**********************************
function x009999_OnConditionCheck( sceneId, selfId )
local FreeSpace = LuaFnGetPropertyBagSpace( sceneId, selfId )
if( FreeSpace < 1 ) then
local strNotice = "T鷌 餰o thi猽 kh鬾g gian!"
x009999_ShowNotice( sceneId, selfId, strNotice)
return 0
end
end
--**************************
function x009999_OnEventRequest(sceneId,selfId,targetId,eve ntId)
local key = GetNumText()
--************************************--
if key == 1 then
BeginEvent(sceneId)
AddText(sceneId,"C醕 h?mu痭 l th秈 trang m鬾 ph醝 n鄌?")
AddNumText(sceneId,x009999_g_ScriptId,"Thi猽 L鈓",1,3)
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
end
-----****------
if key == 3 then --Thi猽 L鈓
BeginAddItem(sceneId)
AddItem(sceneId,10124009,1)
EndAddItem(sceneId,selfId)
AddItemListToHuman(sceneId,selfId)
BeginEvent(sceneId)
AddText(sceneId,"Ch鷆 m譶g c醕 h?nh 疬 th秈 trang c 2 Thi猽 L鈓.")
x009999_NotifyFailTips(sceneId, selfId, "Nh 疬 1 c醝 Kh鬾g S.")
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
-----****------
end
--Ghi l阯 tip
function x009999_NotifyFailTips( sceneId, selfId, Tip )
BeginEvent( sceneId )
AddText( sceneId, Tip )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end
--NPC 姓i L?
--ID: 009999
--Script: Edit by S骾 Kool
--**************************
x009999_g_ScriptId = 009999
--**************************
function x009999_OnDefaultEvent(sceneId,selfId,targetId)
local nam = LuaFnGetName(sceneId,selfId)
BeginEvent(sceneId)
AddText(sceneId,"Ch鄌 m譶g "..nam.." 皙n v緄 Thi阯 Long B醫 B?edit by S骾 Kool !#rTa chuy阯 cung c th秈 trang cao c m鬾 ph醝, c醕 h?c?mu痭 ch鱪 m祎 m髇 kh鬾g ?")
AddNumText(sceneId,x009999_g_ScriptId,"Nh th秈 trang c 2",1,1)
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
end
--**********************************
--Ki琺 tra t鷌
--**********************************
function x009999_OnConditionCheck( sceneId, selfId )
local FreeSpace = LuaFnGetPropertyBagSpace( sceneId, selfId )
if( FreeSpace < 1 ) then
local strNotice = "T鷌 餰o thi猽 kh鬾g gian!"
x009999_ShowNotice( sceneId, selfId, strNotice)
return 0
end
end
--**************************
function x009999_OnEventRequest(sceneId,selfId,targetId,eve ntId)
local key = GetNumText()
--************************************--
if key == 1 then
BeginEvent(sceneId)
AddText(sceneId,"C醕 h?mu痭 l th秈 trang m鬾 ph醝 n鄌?")
AddNumText(sceneId,x009999_g_ScriptId,"Thi猽 L鈓",1,3)
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
end
-----****------
if key == 3 then --Thi猽 L鈓
BeginAddItem(sceneId)
AddItem(sceneId,10124009,1)
EndAddItem(sceneId,selfId)
AddItemListToHuman(sceneId,selfId)
BeginEvent(sceneId)
AddText(sceneId,"Ch鷆 m譶g c醕 h?nh 疬 th秈 trang c 2 Thi猽 L鈓.")
x009999_NotifyFailTips(sceneId, selfId, "Nh 疬 1 c醝 Kh鬾g S.")
EndEvent(sceneId)
DispatchEventList(sceneId,selfId,targetId)
-----****------
end
--Ghi l阯 tip
function x009999_NotifyFailTips( sceneId, selfId, Tip )
BeginEvent( sceneId )
AddText( sceneId, Tip )
EndEvent( sceneId )
DispatchMissionTips( sceneId, selfId )
end