PDA

View Full Version : [JX] Mọi người giúp mình cách Edit Script JX Linux này với



JXDev
18-08-16, 09:19 PM
Hiện tại thì trong bản Ver 4 mình đang chơi thì có chức năng trùng luyện trang bị Kim Ô và mình thử edit cái Script trùng luyện trang bị Kim Ô đó thành chức năng trùng luyện trang bị Bạch Hổ . Nhưng không thành công và cứ bỏ trang bị Bạch Hổ vào bấm Xác định thì nó báo là : "Ngươi chưa đặt trang bị Bạch Hổ nào vào đây cả". Mọi người trong Clbgamesvn biết thì có thể chỉ mình edit lại cái Script này với.

Script trùng luyện trang bị - Lỗi !!

-- ÖØÖý½ðÎÚ×°±¸
Include("\\script\\lib\\composeex.lua")
Include("\\script\\misc\\eventsys\\type\\npc.lua")
Include("\\script\\lib\\log.lua")
Include("\\script\\event\\equip_publish\\baihu\\equiptable. lua")


tbBaiHuRefineEquip = tbActivityCompose:new()

tbBaiHuRefineList =
{
[1]= {szName="B¹ch Hæ H¹ng Liªn", nStone = 1, nWidth = 2, nHeight = 1, nFreeItemCellLimit = 1},
[2]= {szName="B¹ch Hæ Kh«i", nStone = 2, nWidth = 2, nHeight = 2, nFreeItemCellLimit = 1},
[3]= {szName="B¹ch Hæ Th­îng Giíi ChØ", nStone = 2, nWidth = 1, nHeight = 1, nFreeItemCellLimit = 1},
[4]= {szName="B¹ch Hæ Hé UyÓn", nStone = 1, nWidth = 1, nHeight = 2, nFreeItemCellLimit = 1},
[5]= {szName="B¹ch Hæ Yªu §¸i", nStone = 2, nWidth = 2, nHeight = 1, nFreeItemCellLimit = 1},
[6]= {szName="B¹ch Hæ Y Phôc", nStone = 3, nWidth = 2, nHeight = 3, nFreeItemCellLimit = 1},
[7]= {szName="B¹ch Hæ Vò KhÝ", nStone = 4, nWidth = 2, nHeight = 4, nFreeItemCellLimit = 1},
[8]= {szName="B¹ch Hæ Hµi", nStone = 3, nWidth = 2, nHeight = 2, nFreeItemCellLimit = 1},
[9]= {szName="B¹ch Hæ Béi", nStone = 3, nWidth = 1, nHeight = 2, nFreeItemCellLimit = 1},
[10]={szName="B¹ch Hæ H¹ Giíi ChØ", nStone = 2, nWidth = 1, nHeight = 1, nFreeItemCellLimit = 1},
}

function tbBaiHuRefineEquip:ComposeGiveUI()

local szTitle = format(" %-15s\t%s", "Trang bÞ B¹ch Hæ", "B¹ch Hæ Trïng LuyÖn Ngäc")
local strDesc = format(" %-21s\t%d", "B¹ch Hæ Kh«i", 2)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ Y Phôc", 3)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ Hµi", 3)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ Yªu §¸i", 2)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ Hé UyÓn", 1)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ Ngäc Béi", 3)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ H¹ng Liªn", 1)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ Giíi ChØ", 2)
strDesc = strDesc..format("\n %-21s\t%d", "B¹ch Hæ Vò KhÝ", 4)

g_GiveItemUI(szTitle, strDesc, {self.GiveUIOk, {self}}, nil, self.bAccessBindItem)
end

function tbBaiHuRefineEquip:Compose(nComposeCount)

nComposeCount = nComposeCount or 1

if type(self.tbFormula.pLimitFun) == "function" then
if self.tbFormula:pLimitFun(nComposeCount) ~= 1 then
return 0
end
end

-- È¡µÃ½ðÎÚÖØÁ·Ê¯µÄÊýÁ¿
local tbRoomItems = self:GetRoomItems(self.nRoomType) -- ÿ´Î¶¼ÖØлñÈ¡£¬ÒÔ·ÀÖ¹Óб 仯
local tbGoldEquip = nil
local nEquType = 0 -- ÎäÆ÷Àà±ð
local nEqIndex = 0
for i = 1, getn(tbRoomItems) do
nItemQuality = GetItemQuality(tbRoomItems[i])
--¼ì²éÎïÆ·Æ·ÖÊ
if nItemQuality == 1 then
nEqIndex = GetGlodEqIndex(tbRoomItems[i])
if nEqIndex >= 2285 and nEqIndex <= 2314 then -- ½ðÎÚ×°±¸
--¼ì²é°ó¶¨×´Ì¬
local nBindState = GetItemBindState(tbRoomItems[i])
if nBindState ~= 0 then
Say("Trang bÞ cña ng­¬i ®ang trong tr¹ng th¸i khãa, kh«ng thÓ trïng luyÖn.")
return 0
end

--¼ì²éÊÇ·ñÊÇÆÆËð×°±¸
local nG, _, _ = GetItemProp(tbRoomItems[i])
if nG == 7 then
Say("Trang bÞ cña ng­¬i ®· bÞ h­ h¹i kh«ng thÓ trïng luyÖn.")
return 0
end

nEquType = mod(nEqIndex - 2285, 10) + 1
tbGoldEquip = {0, nEqIndex}
break
end
end
end

if tbGoldEquip == nil then
Say("Ng­¬i ch­a ®Æt trang bÞ B¹ch Hæ nµo vµo ®©y c¶.")
return 0
end

local nFreeItemCellLimit = tbBaiHuRefineList[nEquType].nFreeItemCellLimit or 1

nFreeItemCellLimit = ceil(nFreeItemCellLimit * nComposeCount)

if tbBaiHuRefineList[nEquType].nWidth ~= 0 and tbBaiHuRefineList[nEquType].nHeight ~= 0 and CountFreeRoomByWH(tbBaiHuRefineList[nEquType].nWidth, tbBaiHuRefineList[nEquType].nHeight, nFreeItemCellLimit) < nFreeItemCellLimit then
Say(format("§Ó b¶o ®¶m tµi s¶n cña ®¹i hiÖp, xin h·y ®Ó trèng %d %dx%d hµnh trang", nFreeItemCellLimit, tbBaiHuRefineList[nEquType].nWidth, tbBaiHuRefineList[nEquType].nHeight))
return 0
end

local tbItem = {szName = "Ngäc Trïng LuyÖn B¹ch Hæ", tbProp = {6,1,3187,1,0,0}, nCount = tbBaiHuRefineList[nEquType].nStone}
local nCount = self:CalcItemCount(tbRoomItems, tbItem)
if nCount < tbBaiHuRefineList[nEquType].nStone then
local szMsg = self.tbFormula.szFailMsg or "<color=red>B¹ch Hæ Trïng LuyÖn Ngäc mµ ng­¬i ®Æt vµo kh«ng ®ñ. <color>"
Talk(1, "", szMsg)
return 0;
end

local nIdx = floor((nEqIndex - 2285)/10) + 1
local tbProduct = tbEquip_baihu[nEquType][nIdx]
local tbMaterial = {{szName = tbProduct.szName, tbProp = tbGoldEquip, nCount = 1}, tbItem}

if self:ConsumeMaterial(tbMaterial, nComposeCount, self.szLogTitle) ~= 1 then
--Say("ÖÆ×÷ʧ°Ü£¬²¿·ÖÎïÆ·¶ªÊ§¡£",0)
Msg2Player("ChÕ t¹o thÊt b¹i, mÊt ®i mét sè nguyªn liÖu.")
return 0;
end


tbAwardTemplet:GiveAwardByList(tbProduct, self.szLogTitle, nComposeCount)

if type(self.tbFormula.pProductFun) == "function" then
self.tbFormula:pProductFun(nComposeCount)
end
return 1;
end

function refine_baihu()

local strDesc = "<npc>LÊy <color=yellow>trang bÞ B¹ch Hæ <color> muèn trïng luyÖn vµ sè l­îng <color=yellow> B¹ch Hæ Trïng LuyÖn Ngäc<color> t­¬ng øng ®Æt vµo phÝa d­íi"
strDesc = strDesc..format("\n\t\t\t\t\t%-29s%s", "Trang bÞ B¹ch Hæ", "B¹ch Hæ Trïng LuyÖn Ngäc")
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Kh«i", 2)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Y Phôc", 3)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Hµi", 3)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Yªu §¸i", 2)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Hé UyÓn", 1)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Ngäc Béi", 3)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ H¹ng Liªn", 1)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Giíi ChØ", 2)
strDesc = strDesc..format("\n\t\t\t<color=yellow>%-34s<color=red>%d<color>", "B¹ch Hæ Vò KhÝ", 4)
local tbOpt = {}
local tbMate = {
tbMaterial =
{
{szName = "Trang bÞ B¹ch Hæ", tbProp = {0, {2285,2314}}, nQuality = 1 },
{szName = "Ngäc Trïng LuyÖn B¹ch Hæ", tbProp = {6,1,3187,1,0,0},},
},
tbProduct = {szName="Trang bÞ B¹ch Hæ", tbProp={0, {2285,2314}}},
}
local p = tbBaiHuRefineEquip:new(tbMate, "BaiHuRefineEquip", INVENTORY_ROOM.room_giveitem)
tinsert(tbOpt, {"Trïng luyÖn trang bÞ B¹ch Hæ", p.ComposeGiveUI, {p}})
tinsert(tbOpt, {"Hñy bá "})
CreateNewSayEx(strDesc, tbOpt);
end


Hình ảnh
<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>
<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>
<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>

wermanhme1990
18-08-16, 09:28 PM
bạn để ý điều kiện để dẫn đến dòng thông báo đó:


if tbGoldEquip == nil then
Say("Ngươi chưa đặt trang bị Bạch Hổ nào vào đây cả.")
return 0
end

JXDev
18-08-16, 09:36 PM
bạn để ý điều kiện để dẫn đến dòng thông báo đó:


if tbGoldEquip == nil then
Say("Ngươi chưa đặt trang bị Bạch Hổ nào vào đây cả.")
return 0
end



Bạn có thể chỉ mình được ko vì có một số dòng nó hiện toàn chữ éòầủặ mình không hiểu nghĩa của nó là gì

wermanhme1990
18-08-16, 09:50 PM
Bạn có thể chỉ mình được ko vì có một số dòng nó hiện toàn chữ éòầủặ mình không hiểu nghĩa của nó là gì

bạn thử chọn chức năng trùng luyện trang bị Bạch Hổ, rồi bỏ trang bị kim ô vào trùng luyện xem có được không.

JXDev
18-08-16, 09:54 PM
bạn thử chọn chức năng trùng luyện trang bị Bạch Hổ, rồi bỏ trang bị kim ô vào trùng luyện xem có được không.

Nó cũng báo cái dòng " Ngươi chưa bỏ trang bị Bạch Hổ nào vào đây " .Cái chức năng trùng luyện Kim ô thì ngon lành ko bị lỗi gì cả :(