PDA

View Full Version : [JX] Share script đổi môn phái trang bị thanh câu > bạch hổ



laptrinhjx
25-03-20, 10:45 AM
Script tự viết ,nói chung cũng chuẩn. Vì trình gà mờ nên dùng tasktemp và hàm gán để lấy số dư hơi lủng củng anh em chịu khó vọc.



-------------------------Script by ngungucute----------------------------
function swapgolditemshow()
--if GetAccount() ~= "ngungucute" then
--Msg2Player("TÝnh n¨ng nµy ®ang b¶o tr×")
--return 1;
--end
local tab_Content = {
"Rêi Khái/no",
"ThiÕu L©m QuyÒn/#swapgolditem(1)",
"ThiÕu L©m Bçng/#swapgolditem(2)",
"ThiÕu L©m §ao/#swapgolditem(3)",
"Thiªn V­¬ng Chïy/#swapgolditem(4)",
"Thiªn V­¬ng Th­¬ng/#swapgolditem(5)",
"Thiªn V­¬ng §ao/#swapgolditem(6)",
"Nga My KiÕm/#swapgolditem(7)",
"Nga My Ch­ëng/#swapgolditem(8)",
"Thóy Yªn §ao/#swapgolditem(9)",
"Thóy Yªn Song §ao/#swapgolditem(10)",
"Ngò §«c Ch­ëng/#swapgolditem(11)",
"Ngò §«c §ao/#swapgolditem(12)",
"§­êng M«n Phi §ao/#swapgolditem(13)",
"§­êng M«n Tò TiÖn/#swapgolditem(14)",
"Trang sau/swapgolditem2",
}
Say("Xin chµo <color=yellow>"..GetName().."<color>, h·y lùa chon m«n ph¸i mong muèn", getn(tab_Content), tab_Content);
end
-------------------------Script by ngungucute----------------------------
function swapgolditem2()
local tab_Content = {
"Rêi Khái/no",
"§­êng M«n Phi Tieu/#swapgolditem(15)",
"C¸i Bang Rong/#swapgolditem(16)",
"C¸i Bang Bçng/#swapgolditem(17)",
"Thiªn NhÉn KÝch/#swapgolditem(18)",
"Thiªn NhÉn §ao/#swapgolditem(19)",
"Vâ §ang QuyÒn/#swapgolditem(20)",
"Vâ §ang KiÕm/#swapgolditem(21)",
"C«n L«n §ao/#swapgolditem(22)",
"C«n L«n KiÕm/#swapgolditem(23)",
}
Say("Xin chµo <color=yellow>"..GetName().."<color>, h·y lùa chon m«n ph¸i mong muèn", getn(tab_Content), tab_Content);
end
-------------------------Script by ngungucute----------------------------
function swapgolditem(nId)
if nId > 0 then
SetTaskTemp(203,nId)
end
if (CalcFreeItemCellCount() < 10) then
Say("§Ó b¶o ®¶m vËt phÈm an toµn, xin chõa l¹i 10 kho¶ng trèng trë lªn", 0);
return
end
GiveItemUI("§æi m«n ph¸i trang bÞ hoµng kim", "[+3 4 5] cÇn: 100 TiÒn §ång\n[+6] cÇn: 250 TiÒn §ång\n[+7] cÇn: 400 TiÒn §ång\n[+6] C­êng Hãa cÇn: 300 TiÒn §ång", "do_swapgolditem", "onCancel")
end

function do_swapgolditem(nCount)
if nCount ~= 1 then
CreateTaskSay({"ChØ ®­îc bá vµo 1 trang bÞ ", "µ ta nhÇm, ®Ó ta bá vµo l¹i./swapgolditem", "µ ta nhÇm, ®Ó ta ®i 1 lóc l¸t quay l¹i./onCancel"});
return
end

local nItemIndex = GetGiveItemUnit(1)
local nQuality = GetItemQuality(nItemIndex); --Æ·ÖÊ
local GetIdGoldItem = GetGlodEqIndex(nItemIndex)
if (nQuality ~= 1 or ((GetIdGoldItem > 2514 or GetIdGoldItem < 1365 ) and (GetIdGoldItem < 3235 or GetIdGoldItem >= 3465) and (GetIdGoldItem < 3895 or GetIdGoldItem >= 4125)) ) then
CreateTaskSay({"ChØ ®­îc bá vµo trang bÞ hoµng kim [+3] ,[+4] , [+5] ,[+6] hoÆc [+7] ", "µ ta nhÇm, ®Ó ta bá vµo l¹i./swapgolditem", "µ ta nhÇm, ®Ó ta ®i 1 lóc l¸t quay l¹i./onCancel"});
return
end
if (nQuality == 1 and GetIdGoldItem >= 3895 and CalcEquiproomItemCount(4,417,1,-1) < 400) then
Talk(1,"","Ng­¬i kh«ng cã 400 TiÒn §ång")
return 1;
elseif (GetIdGoldItem >= 3895) then
SetTaskTemp(206,400)
SetTaskTemp(204,0)
SetTaskTemp(208,2)
end
if (nQuality == 1 and GetIdGoldItem >= 3235 and GetIdGoldItem < 3465 and CalcEquiproomItemCount(4,417,1,-1) < 300) then
Talk(1,"","Ng­¬i kh«ng cã 300 TiÒn §ång")
return 1;
elseif (GetIdGoldItem >= 3235 and GetIdGoldItem < 3465) then
SetTaskTemp(206,300)
SetTaskTemp(204,0)
SetTaskTemp(208,1)
end
if (nQuality == 1 and GetIdGoldItem >= 2285 and GetIdGoldItem < 2515 and CalcEquiproomItemCount(4,417,1,-1) < 400) then
Talk(1,"","Ng­¬i kh«ng cã 400 TiÒn §ång")
return
elseif (nQuality == 1 and GetIdGoldItem >= 2285 and GetIdGoldItem < 2515 and CalcEquiproomItemCount(4,417,1,-1) >= 400) then
SetTaskTemp(206,400)
SetTaskTemp(204,4)
end
if (nQuality == 1 and GetIdGoldItem >= 2055 and GetIdGoldItem < 2285 and CalcEquiproomItemCount(4,417,1,-1) < 250) then
Talk(1,"","Ng­¬i kh«ng cã 250 TiÒn §ång")
return
elseif (nQuality == 1 and GetIdGoldItem >= 2055 and GetIdGoldItem < 2285 and CalcEquiproomItemCount(4,417,1,-1) >= 250) then
SetTaskTemp(206,250)
SetTaskTemp(204,3)
end
if (nQuality == 1 and (GetIdGoldItem >= 1825 and GetIdGoldItem < 2055) and CalcEquiproomItemCount(4,417,1,-1) < 100) then
Talk(1,"","Ng­¬i kh«ng cã 100 TiÒn §ång")
return
elseif GetIdGoldItem >= 1825 and GetIdGoldItem < 2055 then
SetTaskTemp(206,100)
SetTaskTemp(204,2)
end
if (nQuality == 1 and (GetIdGoldItem >= 1595 and GetIdGoldItem < 1825) and CalcEquiproomItemCount(4,417,1,-1) < 100) then
Talk(1,"","Ng­¬i kh«ng cã 100 TiÒn §ång")
return
elseif (GetIdGoldItem >= 1595 and GetIdGoldItem < 1825) then
SetTaskTemp(206,100)
SetTaskTemp(204,1)
end
if (nQuality == 1 and (GetIdGoldItem >= 1365 and GetIdGoldItem < 1595) and CalcEquiproomItemCount(4,417,1,-1) < 100) then
Talk(1,"","Ng­¬i kh«ng cã 100 TiÒn §ång")
return
elseif (GetIdGoldItem >= 1365 and GetIdGoldItem < 1595) then
SetTaskTemp(206,100)
SetTaskTemp(204,0)
end
id = GetIdGoldItem-(1365+230*GetTaskTemp(204))
SetTaskTemp(205,(id)/10)
duong = id-(GetTaskTemp(205)*10)
if GetTaskTemp(208) == 2 then
idnew = 3885+GetTaskTemp(203)*10+duong+230*GetTaskTemp(204 )
SetTaskTemp(208,0)
elseif GetTaskTemp(208) == 1 then
idnew = 3225+GetTaskTemp(203)*10+duong+230*GetTaskTemp(204 )
SetTaskTemp(208,0)
else
idnew = 1355+GetTaskTemp(203)*10+duong+230*GetTaskTemp(204 )
end
if idnew == GetIdGoldItem then
CreateTaskSay({"Trang bÞ hiÖn t¹i <color=red>trïng víi m«n ph¸i<color> cña b¹n ", "µ ta nhÇm, ®Ó ta chän l¹i m«n ph¸i./swapgolditemshow", "µ ta nhÇm, ®Ó ta ®i 1 lóc l¸t quay l¹i./onCancel"});
return
end
if (RemoveItemByIndex(nItemIndex) ~= 1) then
WriteLog(format("[%s]\t Date:%s\t Account:%s\t Name:%s\t %s",
"§æi m«n ph¸i trang bÞ hoµng kim",
GetLocalDate("%y-%m-%d %H:%M:%S"),
GetAccount(),
GetName(),
"§æi m«n ph¸i trang bÞ hoµng kim thÊt b¹i:\t"..GetItemName(nCurItemIdx)));
end
ConsumeEquiproomItem(GetTaskTemp(206), 4, 417, 1, -1)
AddGoldItem(0,idnew)
Msg2SubWorld("Chóc mõng <color=green>"..GetName().."<color> <color=yellow> ®æi m«n ph¸i trang bÞ hoµng kim<color> thµnh c«ng");
--Msg2Player(""..GetTaskTemp(205).."")
SetTaskTemp(204,0)
SetTaskTemp(203,0)
SetTaskTemp(205,0)
SetTaskTemp(206,0)
WriteLog(format("[%s]\t Date:%s\t Account:%s\t Name:%s\t %s",
"§æi m«n ph¸i trang bÞ hoµng kim Success",
GetLocalDate("%y-%m-%d %H:%M:%S"),
GetAccount(),
GetName(),
format("§æi m«n ph¸i trang bÞ hoµng kim", GetItemName(nItemIndex))));
end


Demo:
<b><font color=red>[Chỉ có thành viên mới xem link được. <a href="register.php"> Nhấp đây để đăng ký thành viên......</a>]</font></b>