Code: Select all
function newChampion()
newguy = {
name = "Taghor", -- just a name
race = "Insectoid", -- must be one of: Human, Minotaur, Lizardman, Insectoid
class = "Mage", -- must be one of: Figther, Rogue, Mage or Ranger
sex = "male", -- must be one of: male, female
level = 3, -- character's level
portrait = "mod_assets/textures/portraits/taghor.dds", -- must be 128x128 dds file
-- allowed skills: air_magic, armors, assassination, athletics, axes, daggers,
-- dodge, earth_magic, fire_magic, ice_magic, maces, missile_weapons, spellcraft,
-- staves, swords, throwing_weapons and unarmed_combat
skills = { fire_magic = 10, earth_magic = 20, air_magic = 30, ice_magic = 40 },
-- allowed traits: aggressive, agile, athletic, aura, cold_resistant, evasive,
-- fire_resistant, fist_fighter, head_hunter, healthy, lightning_speed,
-- natural_armor, poison_resistant, skilled, strong_mind, tough
-- Traits must be specified in quotes.
-- Typically each character has 2 traits, but you can specify more or less.
traits = { "lightning_speed", "tough", "skilled", "head_hunter", "aura" },
health = 80, -- Maximum health
current_health = 70, -- Current health
energy = 300, -- Maximum energy
current_energy = 250, -- Current energy
strength = 12, -- Strength
dexterity = 11, -- Dexterity
vitality = 10, -- Vitality
willpower = 9, -- Willpower
protection = 25, -- protection
evasion = 30, -- evasion
-- Resist fire/cold/poison/shock (remember that those values will be modified by bonuses
-- from fire, cold, poison or shock magic
resist_fire = 11,
resist_cold = 22,
resist_poison = 33,
resist_shock = 44,
-- items: Notation item_name = slot. Slots numbering: 1 (head), 2 (torso), 3 (legs), 4 (feet),
-- 5 (cloak), 6 (neck), 7 (left hand), 8 (right hand), 9 (gaunlets), 10 (bracers), 11-31 (backpack
-- slots) or 0 (any empty slot in backpack)
-- Make sure you put things in the right slot. Wrong slot (e.g. attempt to try boots on head)
-- will make the item spawn to fail.
items = { battle_axe = 0, lurker_hood = 1, lurker_vest = 2, lurker_pants = 3, lurker_boots = 4 },
-- food: 0 (starving) to 1000 (just ate the whole cow)
food = 100
}
-- Call addChampion method. It will add new guy to the party if there are suitable slots and will
-- display a GUI prompt selecting a party member to drop if your party is already 4 guys
gw_party.addChampion(newguy)
end
Here's how the old and new champions look like: items view, stats view.
Note that specific values here are used as examples and not necessarily make much sense.
The example is available in grimwidgets repo. See new_champion script.