cuongvh93
03-09-15, 12:15 PM
Chào anh em forum, chả là em mới tập tành viết script game, viết ra được cái scrip sách kỹ năng 90. Nhưng do trình còn gà nên viết còn dài lắm. Và bị 1 tình huống là click vào nhận xong không bị mất vật phẩm, ae nào khắc phục giùm em với :(
Include("\\script\\task\\system\\task_string.lua")
function main()
dofile("script/global/sachkynang90.lua")
local n_fac = GetLastFactionNumber();
if (n_fac < 0) then
Talk(1, "","Gièng nh quyÓn s¸ch nµy miªu t¶ chÝnh lµ c¸c m«n ph¸i cao cÊp vâ c«ng , ng¬i kh«ng cã m«n ph¸i nªn sÏ kh«ng hiÓu ®îc. ");
return 1;
end
mp = GetFaction()
if mp == "shaolin" then
local tbSay = {}
tinsert(tbSay,"ThiÕu L©m §ao Ph¸p./thieulamdao")
tinsert(tbSay,"ThiÕu L©m C«n Ph¸p./thieulamcon")
tinsert(tbSay,"ThiÕu L©m QuyÒn Ph¸p./thieulamquyen")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "tianwang" then
local tbSay = {}
tinsert(tbSay,"Thiªn V¬ng §ao./thienvuongdao")
tinsert(tbSay,"Thiªn V¬ng Chïy./thienvuongchuy")
tinsert(tbSay,"Thiªn V¬ng Th¬ng./thienvuongthuong")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "tangmen" then
local tbSay = {}
tinsert(tbSay,"B¹o Vò Lª Hoa./baovulehoa")
tinsert(tbSay,"NhiÕp Hån NguyÖt ¶nh./nhiephontuyetanh")
tinsert(tbSay,"H·m TÜnh Lo¹n Hoµn KÝch./loanhoankich")
tinsert(tbSay,"C÷u Cung Phi Tinh./cuucungphitinh")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "wudu" then
local tbSay = {}
tinsert(tbSay,"Ngò §«c §ao./ngudocdao")
tinsert(tbSay,"Ngò §éc Chëng./ngudocchuong")
tinsert(tbSay,"Ngò §éc Bïa./ngudocbua")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "emei" then
local tbSay = {}
tinsert(tbSay,"Nga Mi KiÕm./ngamikiem")
tinsert(tbSay,"Nga Mi Chëng./ngamichuong")
tinsert(tbSay,"Nga Mi Buff./ngamibuff")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "cuiyan" then
local tbSay = {}
tinsert(tbSay,"Thóy Yªn §ao./thuyyendao")
tinsert(tbSay,"Thóy Yªn Song §ao./thuyyensongdao")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "gaibang" then
local tbSay = {}
tinsert(tbSay,"C¸i Bang Bçng./caibangbong")
tinsert(tbSay,"C¸i Bang Rång./caibangrong")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "tianren" then
local tbSay = {}
tinsert(tbSay,"Thiªn NhÉn §ao./thiennhandao")
tinsert(tbSay,"Thiªn NhÉn KÝch./thiennhankich")
tinsert(tbSay,"Thiªn NhÉn Bïa./thiennhanbua")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "wudang" then
local tbSay = {}
tinsert(tbSay,"Vâ §ang QuyÒn./vodangquyen")
tinsert(tbSay,"Vâ §ang KiÕm./vodangkiem")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "kunlun" then
tinsert(tbSay,"C«n L«n §ao./conlondao")
tinsert(tbSay,"C«n L«n KiÕm./conlonkiem")
tinsert(tbSay,"C«n L«n Bïa./conlonbua")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
end
end
function ngudocchuong()
AddItem(6,1,47,0,0,0,0)
end
function ngudocdao()
AddItem(6,1,48,0,0,0,0)
end
function ngudocbua()
AddItem(6,1,49,0,0,0,0)
end
function thieulamdao()
AddItem(6,1,58,0,0,0,0)
end
function thieulamcon()
AddItem(6,1,57,0,0,0,0)
end
function thieulamquyen()
AddItem(6,1,56,0,0,0,0)
end
function thienvuongdao()
AddItem(6,1,39,0,0,0,0)
end
function thienvuongchuy()
AddItem(6,1,37,0,0,0,0)
end
function thienvuongthuong()
AddItem(6,1,38,0,0,0,0)
end
function baovulehoa()
AddItem(6,1,27,0,0,0,0)
end
function cuucungphitinh()
AddItem(6,1,46,0,0,0,0)
end
function loanhoankich()
AddItem(6,1,28,0,0,0,0)
end
function nhiephontuyetanh()
AddItem(6,1,28,0,0,0,0)
end
function ngamikiem()
AddItem(6,1,42,0,0,0,0)
end
function ngamichuong()
AddItem(6,1,43,0,0,0,0)
end
function ngamibuff()
AddItem(6,1,59,0,0,0,0)
end
function thuyyendao()
AddItem(6,1,40,0,0,0,0)
end
function thuyyensongdao()
AddItem(6,1,41,0,0,0,0)
end
function caibangbong()
AddItem(6,1,55,0,0,0,0)
end
function caibangrong()
AddItem(6,1,54,0,0,0,0)
end
function thiennhandao()
AddItem(6,1,36,0,0,0,0)
end
function thiennhankich()
AddItem(6,1,35,0,0,0,0)
end
function thiennhanbua()
AddItem(6,1,53,0,0,0,0)
end
function vodangquyen()
AddItem(6,1,33,0,0,0,0)
end
function vodangkiem()
AddItem(6,1,34,0,0,0,0)
end
function conlondao()
AddItem(6,1,50,0,0,0,0)
end
function conlonkiem()
AddItem(6,1,51,0,0,0,0)
end
function conlonbua()
AddItem(6,1,52,0,0,0,0)
end
Include("\\script\\task\\system\\task_string.lua")
function main()
dofile("script/global/sachkynang90.lua")
local n_fac = GetLastFactionNumber();
if (n_fac < 0) then
Talk(1, "","Gièng nh quyÓn s¸ch nµy miªu t¶ chÝnh lµ c¸c m«n ph¸i cao cÊp vâ c«ng , ng¬i kh«ng cã m«n ph¸i nªn sÏ kh«ng hiÓu ®îc. ");
return 1;
end
mp = GetFaction()
if mp == "shaolin" then
local tbSay = {}
tinsert(tbSay,"ThiÕu L©m §ao Ph¸p./thieulamdao")
tinsert(tbSay,"ThiÕu L©m C«n Ph¸p./thieulamcon")
tinsert(tbSay,"ThiÕu L©m QuyÒn Ph¸p./thieulamquyen")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "tianwang" then
local tbSay = {}
tinsert(tbSay,"Thiªn V¬ng §ao./thienvuongdao")
tinsert(tbSay,"Thiªn V¬ng Chïy./thienvuongchuy")
tinsert(tbSay,"Thiªn V¬ng Th¬ng./thienvuongthuong")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "tangmen" then
local tbSay = {}
tinsert(tbSay,"B¹o Vò Lª Hoa./baovulehoa")
tinsert(tbSay,"NhiÕp Hån NguyÖt ¶nh./nhiephontuyetanh")
tinsert(tbSay,"H·m TÜnh Lo¹n Hoµn KÝch./loanhoankich")
tinsert(tbSay,"C÷u Cung Phi Tinh./cuucungphitinh")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "wudu" then
local tbSay = {}
tinsert(tbSay,"Ngò §«c §ao./ngudocdao")
tinsert(tbSay,"Ngò §éc Chëng./ngudocchuong")
tinsert(tbSay,"Ngò §éc Bïa./ngudocbua")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "emei" then
local tbSay = {}
tinsert(tbSay,"Nga Mi KiÕm./ngamikiem")
tinsert(tbSay,"Nga Mi Chëng./ngamichuong")
tinsert(tbSay,"Nga Mi Buff./ngamibuff")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "cuiyan" then
local tbSay = {}
tinsert(tbSay,"Thóy Yªn §ao./thuyyendao")
tinsert(tbSay,"Thóy Yªn Song §ao./thuyyensongdao")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "gaibang" then
local tbSay = {}
tinsert(tbSay,"C¸i Bang Bçng./caibangbong")
tinsert(tbSay,"C¸i Bang Rång./caibangrong")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "tianren" then
local tbSay = {}
tinsert(tbSay,"Thiªn NhÉn §ao./thiennhandao")
tinsert(tbSay,"Thiªn NhÉn KÝch./thiennhankich")
tinsert(tbSay,"Thiªn NhÉn Bïa./thiennhanbua")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "wudang" then
local tbSay = {}
tinsert(tbSay,"Vâ §ang QuyÒn./vodangquyen")
tinsert(tbSay,"Vâ §ang KiÕm./vodangkiem")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
elseif mp == "kunlun" then
tinsert(tbSay,"C«n L«n §ao./conlondao")
tinsert(tbSay,"C«n L«n KiÕm./conlonkiem")
tinsert(tbSay,"C«n L«n Bïa./conlonbua")
tinsert(tbSay,"KÕt thóc ®èi tho¹i./no")
Say("Xin chµo <color=yellow>"..GetName().."<color>, H·y chän vâ c«ng mµ b¹n muèn !", getn(tbSay), tbSay)
return 1
end
end
function ngudocchuong()
AddItem(6,1,47,0,0,0,0)
end
function ngudocdao()
AddItem(6,1,48,0,0,0,0)
end
function ngudocbua()
AddItem(6,1,49,0,0,0,0)
end
function thieulamdao()
AddItem(6,1,58,0,0,0,0)
end
function thieulamcon()
AddItem(6,1,57,0,0,0,0)
end
function thieulamquyen()
AddItem(6,1,56,0,0,0,0)
end
function thienvuongdao()
AddItem(6,1,39,0,0,0,0)
end
function thienvuongchuy()
AddItem(6,1,37,0,0,0,0)
end
function thienvuongthuong()
AddItem(6,1,38,0,0,0,0)
end
function baovulehoa()
AddItem(6,1,27,0,0,0,0)
end
function cuucungphitinh()
AddItem(6,1,46,0,0,0,0)
end
function loanhoankich()
AddItem(6,1,28,0,0,0,0)
end
function nhiephontuyetanh()
AddItem(6,1,28,0,0,0,0)
end
function ngamikiem()
AddItem(6,1,42,0,0,0,0)
end
function ngamichuong()
AddItem(6,1,43,0,0,0,0)
end
function ngamibuff()
AddItem(6,1,59,0,0,0,0)
end
function thuyyendao()
AddItem(6,1,40,0,0,0,0)
end
function thuyyensongdao()
AddItem(6,1,41,0,0,0,0)
end
function caibangbong()
AddItem(6,1,55,0,0,0,0)
end
function caibangrong()
AddItem(6,1,54,0,0,0,0)
end
function thiennhandao()
AddItem(6,1,36,0,0,0,0)
end
function thiennhankich()
AddItem(6,1,35,0,0,0,0)
end
function thiennhanbua()
AddItem(6,1,53,0,0,0,0)
end
function vodangquyen()
AddItem(6,1,33,0,0,0,0)
end
function vodangkiem()
AddItem(6,1,34,0,0,0,0)
end
function conlondao()
AddItem(6,1,50,0,0,0,0)
end
function conlonkiem()
AddItem(6,1,51,0,0,0,0)
end
function conlonbua()
AddItem(6,1,52,0,0,0,0)
end