Interface administrators, Administrators (Semantic MediaWiki), Curators (Semantic MediaWiki), Editors (Semantic MediaWiki), Suppressors, Upload Wizard campaign editors
5,699
edits
Neko Knight (talk | contribs) (Created page with "--★アーティファクト系の計算が合わない --★とりあえず local M = {} local localhost = nil--ローカル"true":"nil" local matdata = mw.loadData('Module:Item/Materials') local catdata = mw.loadData('Module:Item/Categories') function M.get_price(itemArgs,itemData) mw.log('--------') local itemData = itemData or {} local sell = itemArgs['sell'] or false--売り値のスイッチ local PriceType = itemArgs['PriceType'] or 'Default' local Cur...") |
Neko Knight (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
local M = {} | local M = {} | ||
local localhost = nil--ローカル"true":"nil" | local localhost = nil--ローカル"true":"nil" | ||
| Line 7: | Line 5: | ||
function M.get_price(itemArgs,itemData) | function M.get_price(itemArgs,itemData) | ||
mw.log('--------') | |||
local itemData = itemData or {} | |||
local sell = itemArgs['sell'] or false--売り値のスイッチ | local sell = itemArgs['sell'] or false--売り値のスイッチ | ||
local PriceType = itemArgs['PriceType'] or 'Default' | local PriceType = itemArgs['PriceType'] or 'Default' | ||
| Line 23: | Line 21: | ||
local rarityLv = itemArgs['rarityLv'] or itemData.quality or 0 | local rarityLv = itemArgs['rarityLv'] or itemData.quality or 0 | ||
local qualityLv = itemArgs['qualityLv'] or 0--品質 おそらく接頭辞 | local qualityLv = itemArgs['qualityLv'] or 0--品質 おそらく接頭辞 | ||
local matvalue = itemArgs['matvalue'] or matdata[itemData.defMat].value or 100 | local matvalue = itemArgs['matvalue'] or matdata[itemData.defMat].value or 100 | ||
local cattag = itemArgs['cattag'] or catdata[itemData.category].tag or '' | local cattag = itemArgs['cattag'] or catdata[itemData.category].tag or '' | ||
local value = itemData.value | local value = itemData.value | ||
local isCopy = itemArgs['isCopy'] == 1 and true or false | local isCopy = itemArgs['isCopy'] == 1 and true or false | ||
local IsReplica = itemArgs['Replica'] or false--レプリカ判定 | local IsReplica = itemArgs['Replica'] or false--レプリカ判定 | ||
local IsUnique = itemArgs['Unique'] or rarityLv == 4 or false--ユニーク判定 | local IsUnique = itemArgs['Unique'] or rarityLv == 4 or false--ユニーク判定 | ||
local IsEquipmentOrRangedOrAmmoList = { ['sword'] = true, ['dagger'] = true, ['blunt'] = true, ['staff'] = true, ['axe'] = true, ['polearm'] = true, ['scythe'] = true, ['martial'] = true, ['shield'] = true, ['bow'] = true, ['crossbow'] = true, ['gun'] = true, ['cane'] = true, ['throw'] = true, ['head'] = true, ['torso'] = true, ['back'] = true, ['waist'] = true, ['arm'] = true, ['foot'] = true, ['ring'] = true, ['amulet'] = true, ['lightsource'] = true, ['ammo'] = true} | local IsEquipmentOrRangedOrAmmoList = { ['sword'] = true, ['dagger'] = true, ['blunt'] = true, ['staff'] = true, ['axe'] = true, ['polearm'] = true, ['scythe'] = true, ['martial'] = true, ['shield'] = true, ['bow'] = true, ['crossbow'] = true, ['gun'] = true, ['cane'] = true, ['throw'] = true, ['head'] = true, ['torso'] = true, ['back'] = true, ['waist'] = true, ['arm'] = true, ['foot'] = true, ['ring'] = true, ['amulet'] = true, ['lightsource'] = true, ['ammo'] = true} | ||
local IsEquipmentOrRangedOrAmmo = itemArgs['isEquipped'] or IsEquipmentOrRangedOrAmmoList[itemData.category] or false | local IsEquipmentOrRangedOrAmmo = itemArgs['isEquipped'] or IsEquipmentOrRangedOrAmmoList[itemData.category] or false | ||
mw.log('item_id:',item_id) | mw.log('item_id:',item_id) | ||
| Line 73: | Line 65: | ||
--IsFoodは多分categoriesのchildofがfoodってこと | --IsFoodは多分categoriesのchildofがfoodってこと | ||
--以下の可能性がある categories 料理,食材,調味料,保存食,未加工食材 加工品 | --以下の可能性がある categories 料理,食材,調味料,保存食,未加工食材 加工品 | ||
local price_value | |||
--指定idならvalueの計算を行い「GetValueここまで」まで飛ばす(Trait系) | --指定idならvalueの計算を行い「GetValueここまで」まで飛ばす(Trait系) | ||
if item_id == 'gene' or item_id == 'gene_brain' then | if item_id == 'gene' or item_id == 'gene_brain' then | ||
price_value = value * (100 + (itemData.owner.c_DNA.cost or 0) * 10) / 100 | price_value = value * (100 + (itemData.owner.c_DNA.cost or 0) * 10) / 100 | ||
elseif item_id == 'book_plan' then | elseif item_id == 'book_plan' then--計画書 | ||
price_value = value * (mathf_max((source.cost[1] or 0), 3) * 17) / 100 | price_value = value * (mathf_max((source.cost[1] or 0), 3) * 17) / 100 | ||
elseif item_id == ' | elseif item_id == 'Mod' then | ||
if item_id == 'Rune' then | |||
if item_id == ' | |||
value = value | value = value | ||
end | end | ||
local num = (source.value or 0) * (itemData.encLV or 0) | local num = (source.value or 0) * (itemData.owner.encLV or 0) | ||
price_value = value * num / 100 | price_value = value * num / 100 | ||
elseif item_id == 'mathammer' then | elseif item_id == 'mathammer' then--マテリアルハンマー | ||
price_value = 5000 + (value or 0) * (matvalue or 0) * (matvalue or 0) / 1000 | price_value = 5000 + (value or 0) * (matvalue or 0) * (matvalue or 0) / 1000 | ||
elseif item_id == 'figure' then | elseif item_id == 'figure' then--彫刻 | ||
if source == nil then value = value end | if source == nil then value = value end | ||
local multisize_factor = source.multisize and 2 or 1 | local multisize_factor = source.multisize and 2 or 1 | ||
| Line 102: | Line 91: | ||
price_value = (value + (source.LV or 0) * 50) * multisize_factor * quality_factor | price_value = (value + (source.LV or 0) * 50) * multisize_factor * quality_factor | ||
elseif item_id == 'perfume' then | elseif item_id == 'perfume' then--香水?当てはまらず。ポーション計算かもしれない | ||
price_value = (source.value or 0) * 1200 / 100 | price_value = (source.value or 0) * 1200 / 100 | ||
elseif item_id == 'chest_gamble' then | elseif item_id == 'chest_gamble' then--小さな宝くじ箱 | ||
price_value = (value or 0) + (lockLv or 0) * 50 | price_value = (value or 0) + (lockLv or 0) * 50 | ||
elseif item_id == '1163' then | elseif item_id == '1163' then--魔法のポーション elevalueかな? | ||
price_value = (source.value or 0) * 120 / 100 | price_value = (source.value or 0) * 120 / 100 | ||
elseif item_id == 'scroll_random' then | elseif item_id == 'scroll_random' then--魔法の巻物 | ||
if source ~= nil and (source.value or 0) ~= 0 then | if source ~= nil and (source.value or 0) ~= 0 then | ||
-- MTPValueが不明なため、1と仮定 | -- MTPValueが不明なため、1と仮定 | ||
| Line 127: | Line 112: | ||
price_value = value * (100 + (itemData.owner.LV or 0) - 5) * 10 / 100 | price_value = value * (100 + (itemData.owner.LV or 0) - 5) * 10 / 100 | ||
elseif item_id == 'book_skill' then | elseif item_id == 'book_skill' then--技術書 | ||
price_value = (value or 0) | price_value = (value or 0) | ||
elseif item_id == 'rp' then | elseif item_id == 'rp' then--ランダムレシピ | ||
price_value = (value or 0) * (100 + (itemData.recipe.row.LV or 0) * 15) / 100 | price_value = (value or 0) * (100 + (itemData.recipe.row.LV or 0) * 15) / 100 | ||
elseif item_id == 'monsterball' then | elseif item_id == 'monsterball' then--モンスターボール | ||
if itemData.IsLittleBall then | if itemData.IsLittleBall then | ||
value = value | value = value | ||
| Line 142: | Line 124: | ||
price_value = value * (100 + (itemData.owner.LV or 0) * 15) / 100 | price_value = value * (100 + (itemData.owner.LV or 0) * 15) / 100 | ||
else | else | ||
mw.log('136 price_valuelue:',price_value) | |||
mw.log(' | |||
if item_id == 'plat' then | if item_id == 'plat' then | ||
| Line 157: | Line 138: | ||
price_value = price_value * math.max(100 + rarityLv + math.min(qualityLv * 10, 200), 80) / 100 | price_value = price_value * math.max(100 + rarityLv + math.min(qualityLv * 10, 200), 80) / 100 | ||
end | end | ||
mw.log(' | mw.log('150 price_valuelue:',price_value) | ||
if IsFood then | if IsFood then | ||
| Line 165: | Line 146: | ||
end | end | ||
end | end | ||
mw.log(' | mw.log('156 price_valuelue:',price_value) | ||
local num | local num | ||
mw.log('IsEquipmentOrRangedOrAmmo:',IsEquipmentOrRangedOrAmmo) | mw.log('IsEquipmentOrRangedOrAmmo:',IsEquipmentOrRangedOrAmmo) | ||
if IsEquipmentOrRangedOrAmmo then | if IsEquipmentOrRangedOrAmmo then | ||
num = 2 | num = 2 | ||
else | else | ||
| Line 183: | Line 161: | ||
--神々の武器以外?★ユニーク判定追加 | --神々の武器以外?★ユニーク判定追加 | ||
mw.log(' | mw.log('168 IsUnique:',IsUnique) | ||
if IsUnique == false then | if IsUnique == false then | ||
if IsEquipmentOrRanged and rarityLv >= 2 then--Legendary | if IsEquipmentOrRanged and rarityLv >= 2 then--Legendary | ||
| Line 199: | Line 177: | ||
end | end | ||
end | end | ||
mw.log(' | mw.log('178 price_valuelue:',price_value) | ||
--if (trait is TraitRecipe && sell) | --if (trait is TraitRecipe && sell) | ||
if encLV | if encLV ~= 0 and not itemData.category == 'rune' then | ||
if string.find(cattag, 'enc') then | if string.find(cattag, 'enc') then--itemData.categoryのカテゴリtagにencがあるもの | ||
--コンテナ,窓,照明,装飾,鉢植え,設備,製作設備,加工設備,発電機,マウント,屋外用品,機工,特殊,ベッド,椅子,机,扉,フィギア,地球儀,楽器 | --コンテナ,窓,照明,装飾,鉢植え,設備,製作設備,加工設備,発電機,マウント,屋外用品,機工,特殊,ベッド,椅子,机,扉,フィギア,地球儀,楽器 | ||
price_value = price_value * (0.7 + (encLV - 1) * 0.2) | price_value = price_value * (0.7 + (encLV - 1) * 0.2) | ||
| Line 215: | Line 192: | ||
end | end | ||
end | end | ||
--if (tier > 0) | --if (tier > 0) | ||
end | end | ||
mw.log(' | mw.log('195 price_valuelue:',price_value) | ||
-- GetValueここまで | -- GetValueここまで | ||
price_value = price_value + (PriceAdd or 0) | price_value = price_value + (PriceAdd or 0) | ||
| Line 252: | Line 227: | ||
price_value = price_value * (sell and 0.01 or 50) | price_value = price_value * (sell and 0.01 or 50) | ||
end | end | ||
--チャージ(回数)があるもの | |||
if CurrencyType == 'Ecopo' then | if CurrencyType == 'Ecopo' then | ||
price_value = price_value * 0.2 | |||
elseif CurrencyType == 'Casino_coin' then | elseif CurrencyType == 'Casino_coin' then | ||
price_value = price_value * 0.1 | price_value = price_value * 0.1 | ||
| Line 270: | Line 240: | ||
price_value = price_value * 0.005 | price_value = price_value * 0.005 | ||
else | else | ||
if IsIdentified then | if IsIdentified then | ||
if blessedState == 1 then | if blessedState == 1 then | ||
price_value = price_value * 1.25 | price_value = price_value * 1.25 | ||
| Line 282: | Line 250: | ||
end | end | ||
end | end | ||
else | |||
if sell then | |||
if | price_value = 1 + 15 | ||
else | |||
price_value = | price_value = 50 + 500 | ||
end | end | ||
end | end | ||
mw.log('258 price_valuelue:',price_value) | mw.log('258 price_valuelue:',price_value) | ||
--if not sell then | --if not sell then | ||
-- price_value = price_value * (1 + 0.2 * (c.Evalue1406 or 0)) | -- price_value = price_value * (1 + 0.2 * (c.Evalue1406 or 0)) | ||
--end | --end | ||
end | end | ||
- | local num = 0 | ||
if CurrencyType ~= 'Money' and CurrencyType ~= 'Money2' then | |||
num = 0 | |||
end | |||
price_value = price_value * (sell and (1 + num * 0.02) or (1 - num * 0.02)) | |||
mw.log('283 price_valuelue:',price_value) | |||
if sell then | if sell then | ||
price_value = M.curve(price_value, 10000, 10000, 80) | price_value = M.curve(price_value, 10000, 10000, 80) | ||
end | end | ||
if price_value < 1.0 then | if price_value < 1.0 then | ||
price_value = not sell and 1 or 0 | price_value = not sell and 1 or 0 | ||
end | end | ||
if not sell and CurrencyType == 'Casino_coin' then | |||
if price_value > 100000 then | |||
price_value = math.ceil(price_value / 100000) * 100000 | |||
elseif price_value > 10000 then | |||
price_value = math.ceil(price_value / 10000) * 10000 | |||
elseif price_value > 1000 then | |||
price_value = math.ceil(price_value / 1000) * 1000 | |||
elseif price_value > 100 then | |||
price_value = math.ceil(price_value / 100) * 100 | |||
elseif price_value > 10 then | |||
price_value = math.ceil(price_value / 10) * 10 | |||
end | |||
end | |||
if price_value > 1000000000 then | if price_value > 1000000000 then | ||
price_value = not sell and 1000000000 or 500000000 | price_value = not sell and 1000000000 or 500000000 | ||
| Line 370: | Line 348: | ||
rarityLv = args['rarityLv'],--レアリティレベル | rarityLv = args['rarityLv'],--レアリティレベル | ||
qualityLv = args['qualityLv'],--品質レベル | qualityLv = args['qualityLv'],--品質レベル | ||
matvalue = item_data.defMat and matdata[item_data.defMat].value, | matvalue = item_data.defMat and matdata[item_data.defMat].value, | ||
cattag = (catdata[item_data.category] and catdata[item_data.category].tag) or '' | cattag = (catdata[item_data.category] and catdata[item_data.category].tag) or '' | ||