|
|
@@ -46,9 +46,10 @@ function red(human, type)
|
|
|
local zhuanpan = human.db.zhuanpan[type]
|
|
|
local config = getLuckConfig(type)
|
|
|
if zhuanpan then
|
|
|
+ local luck = zhuanpan.luck or 0
|
|
|
local luckStatus = zhuanpan.luckStatus
|
|
|
for k, v in pairs(config) do
|
|
|
- if zhuanpan.luck >= k then
|
|
|
+ if luck >= k then
|
|
|
if luckStatus[k] == 1 then
|
|
|
return true
|
|
|
end
|
|
|
@@ -75,7 +76,11 @@ function query(human, mainType)
|
|
|
end
|
|
|
|
|
|
local oldCnt = getCntByType(human, mainType)
|
|
|
- local oldLuck = human.db.zhuanpan[mainType].luck
|
|
|
+
|
|
|
+ local oldLuck
|
|
|
+ if human.db.zhuanpan and human.db.zhuanpan[mainType] then
|
|
|
+ oldLuck = human.db.zhuanpan[mainType].luck
|
|
|
+ end
|
|
|
-- 更新
|
|
|
update(human, mainType)
|
|
|
|
|
|
@@ -204,7 +209,10 @@ function refresh(human, mainType, needTime)
|
|
|
end
|
|
|
|
|
|
local oldCnt = getCntByType(human, mainType)
|
|
|
- local oldLuck = human.db.zhuanpan[mainType].luck
|
|
|
+ local oldLuck
|
|
|
+ if human.db.zhuanpan and human.db.zhuanpan[mainType] then
|
|
|
+ oldLuck = human.db.zhuanpan[mainType].luck
|
|
|
+ end
|
|
|
-- 更新
|
|
|
update(human, mainType)
|
|
|
|
|
|
@@ -280,7 +288,10 @@ function getReward(human, mainType, cnt)
|
|
|
end
|
|
|
|
|
|
local oldCnt = getCntByType(human, mainType)
|
|
|
- local oldLuck = human.db.zhuanpan[mainType].luck
|
|
|
+ local oldLuck
|
|
|
+ if human.db.zhuanpan and human.db.zhuanpan[mainType] then
|
|
|
+ oldLuck = human.db.zhuanpan[mainType].luck
|
|
|
+ end
|
|
|
-- 更新
|
|
|
update(human, mainType)
|
|
|
|
|
|
@@ -632,7 +643,10 @@ function isDot(human)
|
|
|
end
|
|
|
|
|
|
function getFree(human)
|
|
|
- local oldLuck = human.db.zhuanpan[DEFAULT_ZHUANPAN_TYPE_NORMAL] and human.db.zhuanpan[DEFAULT_ZHUANPAN_TYPE_NORMAL].luck
|
|
|
+ local oldLuck
|
|
|
+ if human.db.zhuanpan and human.db.zhuanpan[DEFAULT_ZHUANPAN_TYPE_NORMAL] then
|
|
|
+ oldLuck = human.db.zhuanpan[DEFAULT_ZHUANPAN_TYPE_NORMAL].luck
|
|
|
+ end
|
|
|
initDB(human,DEFAULT_ZHUANPAN_TYPE_NORMAL,nil,oldLuck)
|
|
|
if human.db.zhuanpan[DEFAULT_ZHUANPAN_TYPE_NORMAL].free ~= 1 then
|
|
|
return
|