We don't need to get the latest and most legendariest of weapons to pack the biggest punch.
Screenshot of a Shadowheart only wearing underwear (to show she didn't get any boosts from any equipment). And yes, I chose Shadowheart because I find her more pleasant to look at than my own character
Playing around, I found the
CharacterWeaponDamage()
function, and using Zanzer's code for adding boosts, I modified it and made the following script, which uses a nice array of the damage types and variables, so it's easy to change the values. Then simply concatenating it all into a final string that can be injected using Zanzer's code.
Code: Select all
[ENABLE]
{$lua}
if syntaxcheck then return end
local dmgType = {
"Bludgeoning"
,"Piercing"
,"Slashing"
,"Acid"
,"Cold"
,"Fire"
,"Force"
,"Lightning"
,"Necrotic"
,"Poison"
,"Psychic"
,"Radiant"
,"Thunder"
}
local dmgRoll = "12d12"
local dmgBonus = "20"
local wpnEnch = "20"
-- Combine everything to the AddBoosts string.
local boost = "WeaponProperty(Magical);WeaponEnchantment(".. wpnEnch .. ");"
for t = 1, #dmgType do
boost = boost .. "CharacterWeaponDamage(" .. dmgRoll .."+" .. dmgBonus .. ", " .. dmgType[t] .. ");"
end
local cmdCall = getAddress("cmdCall")
local cmdArgs = getAddress("cmdArgs")
local cmdStr1 = getAddress("cmdStr1")
local cmdStr2 = getAddress("cmdStr2")
PrepareCall("GetHostCharacter")
executeCodeEx(0, nil, cmdCall)
local player = readPointer(cmdArgs + 0x08)
player = readString(player, 256, false)
writeString(cmdStr1, player)
writeBytes(cmdStr1 + #player, 0)
writeString(cmdStr2, boost)
writeBytes(cmdStr2 + #boost, 0)
PrepareCall("AddBoosts")
writePointer(cmdArgs + 0x08, cmdStr1)
writePointer(cmdArgs + 0x18, cmdStr2)
writeQword(cmdArgs + 0x28, 0)
writeQword(cmdArgs + 0x38, 0)
executeCodeEx(0, nil, cmdCall)
{$asm}
assert(true)
[DISABLE]
Also created another version of
Zanzer's Add All Resistance
(he forgot
SpellResistance()
), except this is granting immunity instead of merely resistance. As before, it's modified to use an array and variables for easier modification.
Code: Select all
[ENABLE]
{$lua}
if syntaxcheck then return end
local resistance = {
"Bludgeoning",
"Piercing",
"Slashing",
"Acid",
"Cold",
"Fire",
"Force",
"Lightning",
"Necrotic",
"Thunder",
"Poison",
"Psychic",
"Radiant"
}
local spellResistance = true
--local resistanceLevel = "Resistant"
local resistanceLevel = "Immune"
local boost = ""
for r = 1, #resistance do
boost = boost .. "Resistance(" .. resistance[r] .. "," .. resistanceLevel .. ");"
end
if spellResistance then
boost = boost .. "SpellResistance(" .. resistanceLevel .. ");"
end
local cmdCall = getAddress("cmdCall")
local cmdArgs = getAddress("cmdArgs")
local cmdStr1 = getAddress("cmdStr1")
PrepareCall("GetHostCharacter")
executeCodeEx(0, nil, cmdCall)
PrepareCall("AddBoosts")
writePointer(cmdArgs + 0x18, cmdStr1)
writeString(cmdStr1, boost)
writeBytes(cmdStr1 + #boost, 0)
writeQword(cmdArgs + 0x28, 0)
writeQword(cmdArgs + 0x38, 0)
executeCodeEx(0, nil, cmdCall)
{$asm}
assert(true)
[DISABLE]