![]() |
|
King's Bounty: Crossworlds The expansion to the award-winning King’s Bounty: Armored Princess. |
|
Thread Tools | Display Modes |
#2
|
|||
|
|||
![]()
OK, I think I found a real fix now. The only thing that needs to be changed is the orcs_common.lua file in sessions -> orcs -> orcs.kfs
You have to go to the part of the file that says: local rep=25 while bonus_onstart>0 and table.getn(rageable_orcs)>0 do rep=rep-1 if rep>0 then for i=1,table.getn(rageable_orcs) do local rnd = Game.Random(1,3) if rnd>bonus_onstart then rnd=bonus_onstart end local trophy = Attack.val_restore(i,"trophy") if trophy==nil then trophy=0 end local trophy_max = tonumber(orc_trophy_gen_max(i)) if trophy<trophy_max then trophy = trophy + rnd bonus_onstart = bonus_onstart - rnd end if trophy>trophy_max then bonus_onstart=bonus_onstart+(trophy-trophy_max) trophy=trophy_max table.remove(rageable_orcs,i) end Attack.val_store(i,"trophy",trophy) end else bonus_onstart=0 end end This is the code that is supposed to give the onslaught bonus but it doesn't work. I replaced it with this instead: while bonus_onstart>0 and table.getn(rageable_orcs)>0 do local n = Game.Random(1,table.getn(rageable_orcs)) local rnd_target = rageable_orcs[n] local trophy = Attack.val_restore(rnd_target,"trophy") if trophy==nil then trophy=0 end local trophy_max = tonumber(orc_trophy_gen_max(rnd_target)) if (trophy+1) <= trophy_max then trophy = trophy + 1 bonus_onstart = bonus_onstart - 1 Attack.val_store(rnd_target,"trophy",trophy) else if (trophy+1)>=trophy_max then table.remove(rageable_orcs,n) end end end And it seems to work now. The new code accurately gives a random amount to each orc because it hands out each point one by one. With 20 points from onslaught it will pick somebody at random for the 1st point, then somebody at random for the 2nd, and so on, until all of them are used. Also, I'm pretty sure this was the intended behavior, because the original code says: if trophy>trophy_max then bonus_onstart=bonus_onstart+(trophy-trophy_max) In other words, if the code had worked, they didn't intend the adrenaline to be wasted. If it goes over the max, they meant to give it back to use on someone else. Last edited by jelly man; 01-11-2019 at 07:07 AM. |
|
|