New weapon skills - Resolved
Posted: Thu Dec 18, 2014 11:31 am
New weapon proficiency skills.
Main purpose is to give player possibility to evolve and train some favorite weapon skill similar to Log1.
In case you want use / modify it, no need to ask, credit goes to akroma22 who helped me with scripting. As for myself no credit need.
You will need to use you own / existing icons.
Setup:
- Dagger / Bow not developed yet
- for Swords nothing is required, just copy skill / trait code
- for Axe and Mace you need
1. copy Axe / Mace skills and traits as well
2. Inside editor create script and put inside following code:
TBD (find akroma manager in this topic
3. You need modify EACH axe and mace weapon you want to "enhance". All you need to do is to insert following onAttack hook for such a weapon. If you want all the basic axe and mace weapons to support these skills / traits, you need modify them as well.
For Mace it is following onAttack hook
Skills and traits definitions
SWORD
Skill
Trait
AXE
Skill
Traits
MACE
Skill
Traits
Main purpose is to give player possibility to evolve and train some favorite weapon skill similar to Log1.
In case you want use / modify it, no need to ask, credit goes to akroma22 who helped me with scripting. As for myself no credit need.
You will need to use you own / existing icons.
Setup:
- Dagger / Bow not developed yet
- for Swords nothing is required, just copy skill / trait code
- for Axe and Mace you need
1. copy Axe / Mace skills and traits as well
2. Inside editor create script and put inside following code:
TBD (find akroma manager in this topic
3. You need modify EACH axe and mace weapon you want to "enhance". All you need to do is to insert following onAttack hook for such a weapon. If you want all the basic axe and mace weapons to support these skills / traits, you need modify them as well.
SpoilerShow
Code: Select all
onAttack = function(self, champion, action, slot)
weaponModManager.script.addWeaponModifiers(self, champion:getOrdinal(), "axe")
delayedCall("weaponModManager", 0.2, "removeWeaponModifiers", self, champion:getOrdinal(), "axe")
end,
-------------------------
--Example:
--Reworked basic hand axe
------------------------
defineObject{
name = "hand_axe",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/hand_axe.fbx",
},
{
class = "Item",
uiName = "Hand Axe",
gfxIndex = 25,
impactSound = "impact_blade",
weight = 2.4,
traits = { "light_weapon", "axe" },
},
{
class = "MeleeAttack",
attackPower = 10,
accuracy = 0,
cooldown = 4.5,
swipe = "horizontal",
attackSound = "swipe",
onAttack = function(self, champion, action, slot)
weaponModManager.script.addWeaponModifiers(self, champion:getOrdinal(), "axe")
delayedCall("weaponModManager", 0.2, "removeWeaponModifiers", self, champion:getOrdinal(), "axe")
end,
},
},
tags = { "weapon" },
}
SpoilerShow
Code: Select all
onAttack = function(self, champion, action, slot)
weaponModManager.script.addWeaponModifiers(self, champion:getOrdinal(), "mace")
delayedCall("weaponModManager", 0.2, "removeWeaponModifiers", self, champion:getOrdinal(), "mace")
end,
-----------------
--Example:
-----------------
defineObject{
name = "branch",
baseObject = "base_item",
components = {
{
class = "Model",
model = "assets/models/items/branch.fbx",
},
{
class = "Item",
uiName = "Branch",
gfxIndex = 273,
impactSound = "impact_blunt",
weight = 1.2,
traits = { "light_weapon", "mace" },
},
{
class = "MeleeAttack",
attackPower = 3,
pierce = 0,
accuracy = 0,
cooldown = 3,
swipe = "vertical",
attackSound = "swipe",
onAttack = function(self, champion, action, slot)
weaponModManager.script.addWeaponModifiers(self, champion:getOrdinal(), "mace")
delayedCall("weaponModManager", 0.2, "removeWeaponModifiers", self, champion:getOrdinal(), "mace")
end,
},
},
tags = { "weapon" },
}
SWORD
Skill
SpoilerShow
Code: Select all
defineSkill{
name = "sword_prof",
uiName = "Sword prof",
priority = 10,
--iconAtlas = "mod_assets/icons/testujuikony.tga",
icon = 0,
description = "Mastering the sword requires both dexterity and Strength. Each point invested increases your Strength / Hit points or Dexterity / energy. On Level 5 any attack with sword is 20% faster.",
onRecomputeStats = function(champion, level)
if level == 1 then
champion:addStatModifier("dexterity", level)
champion:addStatModifier("max_energy", level * 5)
elseif level == 2 then
champion:addStatModifier("dexterity", level - 1)
champion:addStatModifier("max_energy", (level - 1) * 5)
champion:addStatModifier("strength", level - 1)
champion:addStatModifier("max_health", (level - 1) * 5)
elseif level == 3 then
champion:addStatModifier("dexterity", level - 1)
champion:addStatModifier("max_energy", (level - 1) * 5)
champion:addStatModifier("strength", level - 2)
champion:addStatModifier("max_health", (level - 2) * 5)
elseif level == 4 then
champion:addStatModifier("dexterity", level - 2)
champion:addStatModifier("max_energy", (level - 2) * 5)
champion:addStatModifier("strength", level - 2)
champion:addStatModifier("max_health", (level - 2) * 5)
elseif level == 5 then
champion:addStatModifier("dexterity", level - 3)
champion:addStatModifier("max_energy", (level - 3) * 5)
champion:addStatModifier("strength", level - 3)
champion:addStatModifier("max_health", (level - 3) * 5)
end
end,
traits = { [5] = "grandmaster_sword" },
}
SpoilerShow
Code: Select all
defineTrait{
name = "grandmaster_sword",
uiName = "Sword Slasher",
icon = 2,
description = "Any sword attack is 20% faster.",
onComputeCooldown = function(champion, weapon, attack, attackType, level)
if weapon:hasTrait("sword") or weapon:hasTrait("sword") then return 0.833 end
end
end,
}
Skill
SpoilerShow
Code: Select all
defineSkill{
name = "axe_prof",
uiName = "Axe proficiency",
priority = 10,
--iconAtlas = "mod_assets/icons/testujuikony.tga",
icon = 1,
description = "Swinging the axe makes your character much stronger. Each point increases your Strength (+1) and Hit points (+5). At the 3rd skill level you gain the Expert Axeman trait (Attack Power +10 with axes) and at the 5th level you gain the Grand Master Axeman trait (Attack Power +30 with axes).",
onRecomputeStats = function(champion, level)
champion:addStatModifier("max_health", level*5)
champion:addStatModifier("strength", level*1)
end,
traits = { [3] = "expert_axeman", [5] = "grandmaster_axeman" },
}
SpoilerShow
Code: Select all
defineTrait{
name = "expert_axeman",
uiName = "Expert Axeman",
icon = 5,
description = "You have learned how to use axe properly and there are scary rumors among the monsters.",
}
defineTrait{
name = "grandmaster_axeman",
uiName = "Axe Grand Master",
icon = 6,
description = "Finally you have mastered the axe with full potential. Monsters tremble with fear now !",
}
Skill
SpoilerShow
Code: Select all
defineSkill{
name = "mace_prof",
uiName = "Mace proficience",
priority = 10,
--iconAtlas = "mod_assets/icons/testujuikony.tga",
icon = 2,
description = "You become more resistant on the battlefield while fighting with Mace. Each point invested increases your Vitality and Hit points. On Level 3 your attack with mace ignores 10 points of opponents armor and finally on level 5 your attack ignores 30 points of armor.",
onRecomputeStats = function(champion, level)
champion:addStatModifier("max_health", level*5)
champion:addStatModifier("vitality", level*1)
end,
traits = { [3] = "expert_mace", [5] = "grandmaster_mace" },
}
SpoilerShow
Code: Select all
defineTrait{
name = "expert_mace",
uiName = "Chain Breaker",
icon = 2,
description = "You learned how to use mace beyond regular knowledge. Now you ignore 15 points of opponents armor with any mace-weapon type.",
}
defineTrait{
name = "grandmaster_mace",
uiName = "Wardens Bane",
icon = 2,
description = "You bash any armored enemy with deadly precision, ignoring additional 30 points of armor.",
}