Changing Diificulty Level

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
Frenchie
Posts: 219
Joined: Wed Oct 16, 2013 2:50 am

Changing Diificulty Level

Post by Frenchie »

For this script I assume that difficulty level is damage received (protection) and damage dealt (attack power). The protection bit already works, but I need to find the weapon attack type. Any suggestions to improve the script are welcome.

This is a rough incomplete script:

Code: Select all

function Harder()
- - protection increased
for i=1,4 do local ch = party.party:getChampion(i) ch:setBaseStat("protection",ch::getBaseStat*2)
end end
- - weapon attack power increased
for i=1,4 do local ch = party.party:getChampion(i)
for slot=1,2 do local ha = ch:getItem(slot)
- - check if hand is empty
if ha ~= nil then do
- - find weapon attack : meleeattack, rangedattack, throwattack, firearmattack (magic weapon = ranged?) getAttackType is not a real component
local at = ha.getAttackType local ap = ha.getAttacklPower
- - I have to remove item and make new one?
ch:removeItemFromSlot(slot) ch:insertItem(slot,spawn(ha).at:setAttackPower(ap*2))
end end end end end end
end
I don't know how to get the attack type from a weapon and I also couldn't find a magic weapon type ( = ranged?). Also I don't know whether I can increase the attack power of an equiped item or do I need to replace it? Of course there is also a function Easier(), but I wonder if I can make a single function Diff (up) / Diff (dn) and use a variable for multiplier " * " and divider " / " in a calculation (getBaseStat..up..2 and setAttackPower(ap..up..2) Of course I could use an If statement.
Post Reply