Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --############################################################################
- --[[
- Weapon System
- -------------
- Automatically create several weapon items and a proficiency passive skill
- ------ Global Requires -------
- Items={}
- TYPES_WEAPON={}
- Skills={}
- MACROS={}
- ]]
- --############################################################################
- -- level for items that will be create from a weapon type
- local weapon_levels={
- {
- name="Bronze",
- multiplier=1.0,
- },
- {
- name="Steel",
- multiplier=1.5,
- },
- {
- name="Silver",
- multiplier=2.2,
- },
- {
- name="Brave",
- multiplier=2.7,
- },
- {
- name="Runic",
- multiplier=3.2,
- },
- }
- -- create weapon items and proficiency skill from a weapon type
- function MACROS:Create_Weapon(weapon)
- local type_data =TYPES_WEAPON[weapon]
- --create weapon levels
- for index, value in ipairs(weapon_levels) do
- local new_item={
- name=(weapon_levels[index].name).." "..type_data.name,
- icon=type_data.icon,
- item_category="equipment",
- equip_type="weapon",
- wpn_type=weapon,
- }
- local item_name = weapon..index
- Items[item_name]=new_item
- print_s(item_name)
- end
- --create weapon proficiency passive skill
- local new_skill={
- name=("Weapon Proficiency: " .. type_data.name),
- description="Allows the use of " .. type_data.name .. " weapons.",
- icon=type_data.icon,
- }
- local new_skill_name = "WpnProf_" .. weapon
- Skills[new_skill_name]=new_skill
- end
- -- EXAMPLE --
- TYPES_WEAPON["TestoBlade"]={
- name="TestoBlade",
- icon="ico_wpn_TestoBlade",
- }
- MACROS:Create_Weapon("TestoBlade")
Advertisement
Add Comment
Please, Sign In to add comment