[World of Warcraft] [routine task] 30 star beast fragment logic SQL to Lua

04/16/2021 08:24 847069216#1
--Name: [magic field] [general task] 30 star beast fragment logic SQL to Lua

--Purify: general tasks

--Creator: chengzhimin

--Created: 2018-08-28

--Modifier: $Author: $

--Modified: $Date: $

--RCS-ID: $Revision: $

-------------------------------------------------------------------------------------------------------------------



--Document No.: 35458



local nLogId = 8677




local tConfig = {}

tConfig[1024257] = {sName = "30*~Divine~Eudemon~Fragment~+1",nCostNum = 8,nGainItem = 1024258,sGainName = "30*~Divine~Eudemon~Fragment~+2",sUnit = "piece"}

tConfig[1024258] = {sName = "30*~Divine~Eudemon~Fragment~+2",nCostNum = 8,nGainItem = 1024259,sGainName = "30*~Divine~Eudemon~Fragment~+3",sUnit = "piece"}

tConfig[1024259] = {sName = "30*~Divine~Eudemon~Fragment~+3",nCostNum = 8,nGainItem = 742187,sGainName = "30-star~SaintXO",sUnit = "Piece"}




for nItem,tInfo in pairs(tConfig) do

rwtItemType[nItem]={}

rwtItemType[nItem]["Rule"]=0

rwtItemType[nItem]["Group1"] = { }

rwtItemType[nItem]["Group1"]["FunC1"]=function(nId, nType, nUserId, nDyNpcId,nItemFlag)

--Nitemflag = 0 Non gift = 1 gift

local nMark = 2

local sTxt = ""

if nItemFlag >= 1 then

nMark = 3

sTxt = "[Bound]"

end

if not rwSysItemCheckStr(nType,tInfo["nCostNum"],nMark,0,0,nUserId,0) then

rwSysTemDialogTips("You~don't~have~"..tInfo["nCostNum"].."stacked~"..tInfo["sName"]..sTxt..",~cannot~compose~into~1"..tInfo["sGainName"]..sTxt..".",nUserId)

return

end

if not rwSysItemBagSpace(1,nUserId) then

rwSysTemDialogTips("You~don't~have~enough~space~in ~your~inventory,~please~make~some~adjustment.",nUs erId)

return

end

if rwSysItemDel(nType, tInfo["nCostNum"], nMark, 0, 0, nUserId) then

rwSysItemAdd(tInfo["nGainItem"],1,nMark,0,nUserId)

rwSysQusetLog(nLogId,1000,0,0,tInfo["nGainItem"],1,nType,tInfo["nCostNum"],0,nUserId)

rwSysAddEffect(nUserId,"gem06")

rwSysTemDialogTips("Congratulations,~you~got~"..tI nfo["sUnit"]..tInfo["sGainName"]..sTxt..",~keep~the~hard~work.",nUserId)

return

end

end

end