PDA

View Full Version : [JX] Help ME code ghép đồ với ạ !!!



hocdevgame
20-05-16, 12:40 AM
Các a cho e hỏi đoạn code này muốn add vào 1 NPC để cho nó có chức năng ghép đồ tím phải ntn ạ.




Include("\\script\\global\\recoin_goldenequip.lua")
Include("\\script\\global\\equipenchase_help.lua")
Include("\\script\\task\\newtask\\education\\jiaoyutasknpc. lua")
Include("\\script\\task\\newtask\\newtask_head.lua")
Include("\\script\\global\\紫色及黄金装备铸造.lua")
Include("\\script\\global\\shenmi_chapman.lua"); --修装备功能



Include("\\script\\activitysys\\npcdailog.lua")
Include("\\script\\misc\\eventsys\\type\\npc.lua")



--------固定对话 城市--------
function tiejiang_city(...)

local nNpcIndex = GetLastDiagNpc();
--local szNpcName = GetNpcName(nNpcIndex);
--if NpcName2Replace then szNpcName = NpcName2Replace(szNpcName) end
local szNpcName = "Th?R蘮"
local tbDailog = DailogClass:new(szNpcName);
G_ACTIVITY:OnMessage("ClickNpc", tbDailog, nNpcIndex);

EventSys:GetType("AddNpcOption"):OnEvent(szNpcName, tbDailog, nNpcIndex)

local aryParam = arg;

if (getn(aryParam) == 0) then
tbDailog.szTitleMsg = TIEJIANG_DIALOG
else
for i = 1, getn(aryParam) do
if (i == 1) then
tbDailog.szTitleMsg = TIEJIANG_DIALOG
else
local _,_, szOpt, szFun = strfind(aryParam[i], "([^/]+)/([^/]+)")
local fn = getglobal(szFun)
if fn then
tbDailog:AddOptEntry(szOpt, fn);
end
end;
end;
end;


tbDailog.szTitleMsg = gsub(tbDailog.szTitleMsg, "<dec>", "")


tbDailog:AddOptEntry("Giao d辌h", yes);
tbDailog:AddOptEntry("C鯽 h祅g tinh luy謓 th筩h", energy_sale);
tbDailog:AddOptEntry("Ch?t筼", onFoundry);
tbDailog:AddOptEntry("Kh秏 n筸", jewel_yes);
tbDailog:AddOptEntry("X?l?Trang b?h醤g>", deal_brokenequip);
tbDailog:AddOptEntry("Ta t韎 l祄 nhi謒 v?t﹏ th?", education_tiejiang);
tbDailog:AddOptEntry("Ta ch?gh?xem th玦.", no, {});
tbDailog:Show()
end;
--------固定对话 孝手村------
function tiejiang_village(...)
local aryParam = arg;
local aryDescribe = {
--szDialog, --铁匠的说话,在各城市铁匠处
"Giao d辌h/yes",

--Change request 04/06/2011, ng ch? t筼 trang b? b筩h kim - Modified by DinhHQ - 20110605
"V藅 ph萴 c /onFoundry",

"Nhi謒 v?t﹏ th?/tboss",
"Ta ch?甶 d筼 m閠 ch髏 /no",
};

if (getn(aryParam) == 0) then
tinsert(aryDescribe, 1, TIEJIANG_DIALOG)
else
for i = 1, getn(aryParam) do
if (i == 1) then
tinsert(aryDescribe, 1, aryParam[i]);
else
tinsert(aryDescribe, 2, aryParam[i]);
end;
end;
end;
CreateTaskSay(aryDescribe);
end;

--------镶嵌--------
function jewel_yes()
CreateTaskSay({"<dec><npc>Kh秏 B秓 Ng鋍 li猲 quan n s?c﹏ b籲g c馻 Ng?h祅h, l?m閠 c鵦 ph萴 tuy謙 th? Ngi mu鑞 x竎 nh薾 kh秏 ch??", "B総 u kh秏/jewel_yes1", "T譵 hi觰 th猰/help", "Ta ch?gh?xem th玦/no"});
end

function jewel_yes1()
EnchaseItem()
end

-------No--------
function no()
end;

------精炼石-------
function energy_sale()
CreateStores();
--AddShop2Stores(174, "Tinh luy謓 ", 15, 100, "fBuyCallBack(%d,%d)");
AddShop2Stores(179, "Ho箃 ng ", 1, 100, "fBuyCallBack(%d,%d)");
AddShop2Stores(93, "Ph骳 duy猲 ", 2, 100, "fBuyCallBack(%d,%d)");
AddShop2Stores(98, "T鑞g kim ", 4, 100, "fBuyCallBack(%d,%d)");
AddShop2Stores(146, "Vinh d?", 11, 100, "fBuyCallBack(%d,%d)");
--AddShop2Stores(173, "Danh v鋘g ", 13, 100, "fBuyCallBack(%d,%d)");
OpenStores();
end

function fBuyCallBack(nItemIdx, nPrice)
local nCount = 1
local itemgenre, itemdetail, itemParticular = GetItemProp(nItemIdx)
if itemgenre == 6 and itemdetail == 1 and itemParticular == 2317 then
-- 试炼帖
AddStatData("jlxiaohao_shiliantiegoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 2355 then
-- 玄天锦囊
AddStatData("jlxiaohao_xuantiangoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 2369 then
-- 堑驹令
AddStatData("jlxiaohao_qingjulinggoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 2353 then
-- 云⒐令
AddStatData("jlxiaohao_yunlulinggoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 2352 then
-- 苍狼令
AddStatData("jlsxiaohao_canglanglinggoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 2351 then
-- 玄猿令
AddStatData("jlxiaohao_xuanyuanlinggoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 2350 then
-- 紫蟒令
AddStatData("jlxiaohao_zimanglinggoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 2744 then
-- 如意钥匙
AddStatData("jlxiaohao_ruyiyaoshigoumai", nCount)
elseif itemgenre == 6 and itemdetail == 1 and itemParticular == 1617 then
-- 炎帝令
AddStatData("jlxiaohao_yandilinggoumai", nCount)
end
return 1
end

hichay
20-05-16, 06:41 AM
của bạn đây ,

Include( "\\script\\item\\compound\\compound_header.lua" );
Include( "\\script\\item\\compound\\atlas.lua" );
{"VËt PhÈm §óc", chetao},

function chetao()
Say( "NƠu ®¹i hiÖp muèn că mét măn ®å vơa ư th× ®em ®Çy ®ñ nguyªn liÖu tíi ®©y. Ta sÏ ®óc luyÖn mét vËt phÈm ng­¬i thƯch nhÊt!", 4, "B¾t ®Çu chƠ t¹o/onFoundryItem", "Liªn quan chƠ t¹o/onAbout", "T×m hiÓu m¶nh Hoµng Kim./onQueryPiece","§Ó ta suy nghÜ kü l¹i xem/onCancel");
end



cậu chỉnh lại cho phù hợp với npc bạn add vào là đc

cabato
20-05-16, 07:16 AM
Boss hichay tái xuất giang hồ
:-ss:-ss:-ss:-ss:-ss