Module:Township: Difference between revisions

p.GetTraderTable -> V1.1.1 Update
(Updated resourceDisplayOrder/buildingDisplayOrder)
(p.GetTraderTable -> V1.1.1 Update)
Line 10: Line 10:
p.Township = Township
p.Township = Township


-- Returns the namespace name (eventually we should use an icon)
function p.PLACEHOLDER_NAMESPACE_ICON(namespace)
local namespaces = {
melvorD = 'Demo',
melvorF = 'Full',
melvorTotH = 'TotH'
}
return namespaces[namespace]
end


-- Returns the recipe for the item of a desired skill.
-- Returns the recipe for the item of a desired skill.
Line 128: Line 119:
end
end
local function matchClothing(item)
local function matchClothing(item)
local valid_tiers = {'Leather', 'Hard Leather', 'Dragonhide', 'Elderwood', 'Revenant', 'Carrion'}
return item.id == 'melvorD:Green_Dragonhide' or item.id == 'melvorD:Blue_Dragonhide' or item.id == 'melvorD:Red_Dragonhide' or item.id == 'melvorD:Black_Dragonhide' or item.id == 'melvorF:Elder_Dragonhide'
for _, tier in ipairs(valid_tiers) do
if item.tier == tier then
return true
end
end
return false
end
end


Line 163: Line 148:
for _, item in ipairs(resource.itemConversions) do
for _, item in ipairs(resource.itemConversions) do
item.toTownship = math.max(math.floor(1000/(item.healsFor*10)), 2)
item.toTownship = math.max(math.floor(1000/(item.healsFor*10)), 2)
item.fromTownship = item.healsFor*5*6
item.fromTownship = item.healsFor*5*6*5
end
end
elseif resource.id == 'melvorF:Planks' then
elseif resource.id == 'melvorF:Planks' then
Line 207: Line 192:
table.insert(ret_resource, '\r\n!Item')
table.insert(ret_resource, '\r\n!Item')
table.insert(ret_resource, '\r\n!Name')
table.insert(ret_resource, '\r\n!Name')
table.insert(ret_resource, '\r\n!DLC')
table.insert(ret_resource, '\r\n!Level')
table.insert(ret_resource, '\r\n!Level')
table.insert(ret_resource, '\r\n!Give To')
table.insert(ret_resource, '\r\n!Give To')
Line 251: Line 235:
table.insert(ret_resource, '\r\n|style="text-align:center"|'..Icons.Icon({item.name, type='item', size='50', notext=true}))
table.insert(ret_resource, '\r\n|style="text-align:center"|'..Icons.Icon({item.name, type='item', size='50', notext=true}))
-- Name
-- Name
table.insert(ret_resource, '\r\n|style="text-align:left"|'..Icons.Icon({item.name, type='item', noicon=true}))
table.insert(ret_resource, '\r\n|style="text-align:left"|'..Icons.getExpansionIcon(item.id)..Icons.Icon({item.name, type='item', noicon=true}))
-- DLC
local item_namespace, item_localid = GameData.getLocalID(item.id)
table.insert(ret_resource, '\r\n|style="text-align:center"|'..p.PLACEHOLDER_NAMESPACE_ICON(item_namespace))
-- Level
-- Level
if required_level == nil then
if required_level == nil then
Line 300: Line 281:
['melvorF:Potions'] = {skill = 'melvorD:Herblore'},
['melvorF:Potions'] = {skill = 'melvorD:Herblore'},
['melvorF:Planks'] = {skill = 'melvorD:Woodcutting'},
['melvorF:Planks'] = {skill = 'melvorD:Woodcutting'},
['melvorF:Clothing'] = {skill = 'melvorD:Crafting'}
['melvorF:Clothing'] = {skill = nil}
}
}
function p._GetResourceSkill(id)
function p._GetResourceSkill(id)
572

edits