I tried a new logic to generate multistat items. It's mainly we use a base item and roll additionally stats on this.
The npc can be found in Stonehaven right side, where most npc shops are. Atm the gamble is limited to amulets, rings and leather pants. Players can buy up to 3 rolls and a max dice in relation to their main level.
Gambling with 3 rolls and a dice (1-110) is 99g. So watch your clicks if you gamble with bankcards.
The logic is very simple and basic. Items can be gambled up to +7 stats.
Here is table with current chances.
-- chance is the % chance in relation to the sum of all chances from this list
-- name is the lua name of the object attribute
-- lvl is the required lvl for each index (1, 2, ...)
-- factor is a factor for the value, no factor is same than factor 1
list_stats =
{
{chance = 5, name = "strength", lvl = { 4, 8, 16, 28, 44, 64, 88 } },
{chance = 5, name = "dexterity", lvl = { 4, 8, 16, 28, 44, 64, 88 } },
{chance = 5, name = "constitution", lvl = { 4, 8, 16, 28, 44, 64, 88 } },
{chance = 5, name = "wisdom", lvl = { 4, 8, 16, 28, 44, 64, 88 } },
{chance = 5, name = "charisma", lvl = { 4, 8, 16, 28, 44, 64, 88 } },
{chance = 5, name = "intelligence", lvl = { 4, 8, 16, 28, 44, 64, 88 } },
{chance = 5, name = "power", lvl = { 4, 8, 16, 28, 44, 64, 88 } },
{chance = 5, name = "armour_class", lvl = { 2,4,6,8,12,16,22,28,36,44,54,64,76,88 } },
{chance = 5, name = "weapon_class", lvl = { 2,4,6,8,12,16,22,28,36,44,54,64,76,88 } },
{chance = 5, name = "damage", factor = 0.3}, -- 110 roll would be 3.3 dps
{chance = 5, name = "max_hitpoints", factor = 2}, -- 110 roll would be +220 hp
{chance = 5, name = "hitpoints", factor = 1}, -- 110 roll would be +hp regen 110(11.0)
{chance = 5, name = "max_spellpoints", factor = 2},
{chance = 5, name = "spellpoints", factor = 1},
{chance = 5, name = "max_grace", factor = 2},
{chance = 5, name = "grace", factor = 1},
-- resists 110 roll would be 33 resists.
{chance = 1, name = "resist_impact", factor = 0.3},
{chance = 1, name = "resist_cleave", factor = 0.3},
{chance = 1, name = "resist_slash", factor = 0.3},
{chance = 1, name = "resist_pierce", factor = 0.3},
{chance = 1, name = "resist_cold", factor = 0.3},
{chance = 1, name = "resist_fire", factor = 0.3},
{chance = 1, name = "resist_electricity", factor = 0.3},
{chance = 1, name = "resist_poison", factor = 0.3},
{chance = 1, name = "resist_acid", factor = 0.3},
{chance = 1, name = "resist_sonic", factor = 0.3},
{chance = 1, name = "resist_channelling", factor = 0.3},
{chance = 1, name = "resist_corruption", factor = 0.3},
{chance = 1, name = "resist_psionic", factor = 0.3},
{chance = 1, name = "resist_light", factor = 0.3},
{chance = 1, name = "resist_shadow", factor = 0.3},
{chance = 1, name = "resist_lifesteal", factor = 0.3},
{chance = 1, name = "resist_aether", factor = 0.3},
{chance = 1, name = "resist_nether", factor = 0.3},
{chance = 1, name = "resist_chaos", factor = 0.3},
{chance = 1, name = "resist_death", factor = 0.3},
{chance = 1, name = "resist_weaponmagic", factor = 0.3},
{chance = 1, name = "resist_godpower", factor = 0.3},
{chance = 1, name = "resist_drain", factor = 0.3},
{chance = 1, name = "resist_depletion", factor = 0.3},
{chance = 1, name = "resist_countermagic", factor = 0.3},
{chance = 1, name = "resist_cancellation", factor = 0.3},
{chance = 1, name = "resist_confusion", factor = 0.3},
{chance = 1, name = "resist_fear", factor = 0.3},
{chance = 1, name = "resist_slow", factor = 0.3},
{chance = 1, name = "resist_paralyze", factor = 0.3},
{chance = 1, name = "resist_snare", factor = 0.3},
-- attack 110 roll would +11% attack
{chance = 1, name = "attack_impact", factor = 0.1},
{chance = 1, name = "attack_cleave", factor = 0.1},
{chance = 1, name = "attack_slash", factor = 0.1},
{chance = 1, name = "attack_pierce", factor = 0.1},
{chance = 1, name = "attack_cold", factor = 0.1},
{chance = 1, name = "attack_fire", factor = 0.1},
{chance = 1, name = "attack_electricity", factor = 0.1},
{chance = 1, name = "attack_poison", factor = 0.1},
{chance = 1, name = "attack_acid", factor = 0.1},
{chance = 1, name = "attack_sonic", factor = 0.1},
{chance = 1, name = "attack_channelling", factor = 0.1},
{chance = 1, name = "attack_corruption", factor = 0.1},
{chance = 1, name = "attack_psionic", factor = 0.1},
{chance = 1, name = "attack_light", factor = 0.1},
{chance = 1, name = "attack_shadow", factor = 0.1},
{chance = 1, name = "attack_lifesteal", factor = 0.1},
{chance = 1, name = "attack_aether", factor = 0.1},
{chance = 1, name = "attack_nether", factor = 0.1},
{chance = 1, name = "attack_chaos", factor = 0.1},
{chance = 1, name = "attack_death", factor = 0.1},
{chance = 1, name = "attack_weaponmagic", factor = 0.1},
{chance = 1, name = "attack_godpower", factor = 0.1},
{chance = 1, name = "attack_drain", factor = 0.1},
{chance = 1, name = "attack_depletion", factor = 0.1},
{chance = 1, name = "attack_countermagic", factor = 0.1},
{chance = 1, name = "attack_cancellation", factor = 0.1},
{chance = 1, name = "attack_confusion", factor = 0.1},
{chance = 1, name = "attack_fear", factor = 0.1},
{chance = 1, name = "attack_slow", factor = 0.1},
{chance = 1, name = "attack_paralyze", factor = 0.1},
{chance = 1, name = "attack_snare", factor = 0.1}
}
When a roll is to low, this leads to a fail. Same if it rolls an existing attribute and new roll would be a lower result. When we have 2 rolls on same attribute, logic takes the higher one.
This can be for sure improved. Also from codeside its possible to roll 10 times and we can also roll with dices>110 to increase chances for high level gear.
But adding multistat items will change the game balance for sure, so thats reason its atm limited to amulett, ring and a leather pant.
Command to roll an item is
roll_item(item, dice, rolls)
where item need to be an existing object and dice can max generate lvl 110 results and rolls is capped to 10.
Script is stats.lua and need to be implemented non modular like smith script. Perhaps later its better to change this to a modular implementation.