Champion:setClass(class) to change a champions classGradunk wrote:I'm trying to find out how to either make a new class or set champions to a specific one. i tried removing the class traits and adding different ones but they're just stacking on top of eachother so i start with 120hp and mana lvl 1 cause i have 2 classes at the same time etc. thanks
Hey! Slow reply - very sorryGradunk wrote:can you send me yours? i can use it as a reference and ask if i have further questions. that would be the best and likely easiest way. thanks a bunch!
and yes i agree that would be glorious
Code: Select all
-------------------------------------------------------------BARBARIAN
defineCharClass{
name = "barbarian",
uiName = "Barbarian",
optionalTraits = 2,
skillPoints = 2,
traits = { "correct_resistance", "stun_strike_2H", },
skills = { heavy_weapons = 1 }
}
defineTrait{
name = "barbarian",
uiName = "Barbarian",
iconAtlas = "mod_assets/textures/gui/legacy_custom_icons1.tga",
icon = 16,
description = "Barbarians of the Midland Wastes do not care about finesse in combat, but instead rely on brute force to ensure their survival and that their enemies are defeated, and stay defeated. Barbarians are known for their quick tempers and ability to knock out opponents with single strikes.",
gameEffect = [[
<>-------------------------------------------------------------<> Base
Health 70, Energy 30
Heavy Weapons Skill +1
<>----------------------------------------------------------<> Levelup
Health +8, Energy +3
Food Consumption +1%
<>----------------------------------------------------------<> Special
Immune: Burdened & Grappled
Resist: Weakened & Injuries +25%
Specialisation: Axes, Maces & Fistclaws
Skill Equalize: Athleticism & Unarmed Combat
Your 2-Handed Weapon Attacks gain: Stun +15%
Leadership: gain the Warchief trait
<>-----------------------------------------------------------<> Magic
Spellbooks: Nil]],
onRecomputeStats = function(champion, level)
if level > 0 then
local lvl = champion:getLevel()
champion:addStatModifier("max_health", 70 + (lvl - 1) * 8)
champion:addStatModifier("max_energy", 30 + (lvl - 1) * 3)
champion:addStatModifier("food_rate", lvl)
end
end,
onReceiveCondition = function(champion, cond, level)
if level > 0 then
if cond and cond == "burdened" then
return false
end
if cond and (cond == "weakened" or string.match(cond, "_wound$")) then
if math.random() < 0.25 then
return false
end
end
end
end,
}
Code: Select all
------------------------------------------------------BATTLEMAGE
defineCharClass{
name = "battle_mage",
uiName = "Battle Mage",
optionalTraits = 2,
skillPoints = 2,
traits = { "correct_resistance", "hand_caster", "armor_expert"},
skills = { staves_runewands = 1}
}
defineTrait{
name = "battle_mage",
uiName = "Battle Mage",
iconAtlas = "mod_assets/textures/gui/legacy_custom_icons1.tga",
icon = 14,
description = "The Battle Mages of Old Amadacia are quite comfortable wielding front line Stave Weapons, as well as blasting with powerful Spells from afar. There are few Battlemages left worthy of the Title, but one day they hope to gather whats left of their Order and restore the School of Wizardry's former pressence and magnificence.",
gameEffect = [[
<>-------------------------------------------------------------<> Base
Health 40, Energy 60
Staff & Wand Skill +1
<>----------------------------------------------------------<> Levelup
Health +4, Energy +6
Elemental Resistances +1
<>----------------------------------------------------------<> Special
Specialisation: Staves
Stave Special Attack Energy Costs -25%
Stave Special Attack Buildup Times -50%
Equipped Stave Willpower bonus +50%
Equipped Armour Weight -50%
Leadership: Staff Defence extends to Party
<>-----------------------------------------------------------<> Magic
Spellbooks: Mage & Enchanter
You can Cast Spells without RuneItems]],
onRecomputeStats = function(champion, level)
if level > 0 then
local lvl = champion:getLevel()
champion:addStatModifier("resist_fire", lvl)
champion:addStatModifier("resist_shock", lvl)
champion:addStatModifier("resist_cold", lvl)
champion:addStatModifier("resist_poison", lvl)
champion:addStatModifier("max_health", 40 + (lvl-1) * 4)
champion:addStatModifier("max_energy", 60 + (lvl-1) * 6)
---------------------------------------------------------stave WIL +50%
if champion:getLevel() > 1 then
for slot = 1,2 do
local item = champion:getItem(slot)
if item and item:hasTrait("stave") then
if item.go.equipmentitem and item.go.equipmentitem:getWillpower() then
local w = item.go.equipmentitem:getWillpower()
champion:addStatModifier("willpower", math.floor(w / 2))
end
end
end
end
end
end,
}
Code: Select all
-------------------------------------------------------------MONK
defineCharClass{
name = "monk",
uiName = "Monk",
optionalTraits = 2,
skillPoints = 2,
traits = { "correct_resistance", "light_equipment"},
skills = {unarmed = 1}
}
defineTrait{
name = "monk",
uiName = "Monk",
iconAtlas = "mod_assets/textures/gui/legacy_custom_icons1.tga",
icon = 8,
description = "Monks hailing from the fabled Sun Temples devote their time and energy to honing fine physical and mental skills in peace and solitude. They ponder the mysteries of the mind and strive to overcome the meddlings of the physical planes. This isolates but also enlightens them, giving Monks access to truly marvellous abilities and self control.",
gameEffect = [[
<>------------------------------------------------------------<> Base
Health 60, Energy 40
Unarmed Combat Skill +1
<>---------------------------------------------------------<> Levelup
Health +6, Energy +4
Fire & Cold Resistances +1
<>---------------------------------------------------------<> Special
Immune: Insanity & Bloodlust
Resist: Blinded & Slowed +25%
Skill Equalize: Athleticism & Accuracy
Specilaisation: Fistclaws & Polearms
Agile + 2-Handed Fistclaws: Multistrike +5%
Reach + Polearm: Counterstrike Melee Attacks +10%
Light Equipment Restrictions
<>----------------------------------------------------------<> Magic
Level 7 + Meditation: Psionic Spellbook]],
onRecomputeStats = function(champion, level)
if level > 0 then
local lvl = champion:getLevel()
champion:addStatModifier("resist_fire", lvl)
champion:addStatModifier("resist_cold", lvl)
champion:addStatModifier("max_health", 60 + (lvl-1) * 6)
champion:addStatModifier("max_energy", 40 + (lvl-1) * 4)
end
end,
onReceiveCondition = function(champion, cond, level)
if level > 0 then
if cond and (cond == "blinded" or string.match(cond, "^slow_")) and math.random() <= 0.25 then
return false
end
if cond and (string.match(cond, "^bloodlust_") or cond == "insane") then
return false
end
end
end,
}