Fulqrum Publishing Home   |   Register   |   Today Posts   |   Members   |   UserCP   |   Calendar   |   Search   |   FAQ

Go Back   Official Fulqrum Publishing forum > Fulqrum Publishing > King's Bounty > King's Bounty: The Legend > Mods

Mods Everything about mods

Reply
 
Thread Tools Display Modes
  #1  
Old 09-11-2010, 04:33 PM
AncientSion AncientSion is offline
Registered Member
 
Join Date: Sep 2010
Posts: 9
Default editing unit stats and spirit spells ?

I was able to edit some skills and spells, but i cant seem to find any files which refer to the stats of monster (like attack and defense, leadership cost etc).
In addition, i cant seem to find out how to control the damage output of spirit skills.
Can someone tell me where i can find them ?

Secondly, i would like to actually alter the way upgraded spells work. I know i can somehow (?) set the damage of lvl 1 magic axe, but i cant seem to find a formula or file which controls how level 2 magic axe builds upon it.

Lastly, i think this cant be done...but i would like to alter the GLORY skill. Instead of giving a static leadership increase, i would like to give like 10 %, 15 % and 20 % more leadership. But apparently this doesnt quite work like i intend it to be, it seems the % values are always based on the base stats, so glory 1 (10 %) for a mage would give him 10 % more leadership of his base (120). Can you make it so that the 10 % would be based on his current leadership (i.e. including level ups and flags found) ?
Any help is appreciated.
Reply With Quote
  #2  
Old 09-12-2010, 09:36 AM
AncientSion AncientSion is offline
Registered Member
 
Join Date: Sep 2010
Posts: 9
Default

Ok, i found out how to edit unit stats.

Still, i cant seem to edit the damage properties of spells, can someone PLEASE help me ?
Reply With Quote
  #3  
Old 10-04-2010, 02:56 AM
Puce Moose Puce Moose is offline
Approved Member
 
Join Date: Feb 2010
Posts: 45
Default

AncientSion,

I edited the Trap spell to make it deal a bit more damage, and I discovered something that may help you; the lvl_dmg entry. As an example, here's the relevant entry for the Trap spell:

params {
duration=3,4,5 // âðåìÿ æèçíè
int=0 // åñëè =1 òî èíòåëëåêò âëèÿåò íà äëèòåëüíîñòü çàêëèíàíèÿ
typedmg=physical
damage=70-170 // óðîí
lvl_dmg=200 // ïðèðîñò óðîíà ñ óðîâíåì â %
count=1,1,1 // íå èñïîëüçóåòñÿ
}


That lvl_dmg entry seems to adjust the damage based on the level of the spell. For example, at level 2 the spell would do 70-170 + (200+70,200+170), and level three would deal 70-170 + (200+70+200+170) + (200+70, 200+170). That *seems* to be how it's working, though I'm not 100% positive. Anyway, it's a good place to start.
Reply With Quote
  #4  
Old 10-16-2010, 12:56 PM
AncientSion AncientSion is offline
Registered Member
 
Join Date: Sep 2010
Posts: 9
Default

Thanks. Now, if someone would be able to tell us how exactly intelligence is working into the formula...there must be somewhere (perhpas in a more general file) the intelligence effect (i.e. +x % per intel and the +1 turns for x intel).

thanks though !
Reply With Quote
  #5  
Old 11-05-2010, 07:15 PM
MaroonMaurader MaroonMaurader is offline
Approved Member
 
Join Date: Jan 2010
Posts: 91
Default

In answer to your question about damage bonus from int and duration bonus...short answer is, you want to edit config.txt, specifically the part under "spell_power_config". By default in KB:TL, it will read:
spell_power_config {
int_power=10
int_duration=15
}

That means every point of intelligence boosts power by 10%, and 15 points of intelligence boost duration by 1.

If you want to edit it for just one spell, you can do that too. If you check out spells.lua, it gives you the actual function for each spell. For example, function spell_magic_axe_attack(lvl,dmgts) controls casts of Magic Pole-Axe.

The damage is found by another function call within function spell_magic_axe_attack:
local min_dmg,max_dmg,count = pwr_magic_axe(lvl)
That is, min damage and max damage are being returned by a function called "pwr_magic_axe" which takes the level string as input.

As you might expect, that function is in spells_power.lua. Full text included, edited to include my (painfully thorough and English) comments and remove the developers' (Russian) ones, as well as a little adjustment of white space.

--This is what my comments looks like!
function pwr_magic_axe(level)

--First up, get the basic min and max damage... you can edit this in the spells.txt file.
local min_dmg,max_dmg = text_range_dec(Logic.obj_par("spell_magic_axe","da mage"))

--Then it gets the spell level. That would be 1, 2, or 3 generally.
if tonumber(level)==0 or level==nil then
level=Obj.spell_level()
if level==0 then level=1 end
if Obj.where()==6 and Obj.spell_level()~=0 then level=level+1 end
else
level = tonumber(level)
end

--Figure out the player's bonus to spell damage. Destroyer skill is added to item bonuses.
--Example: With destroyer level 2 in KB:TL, and no items giving bonuses, this is 30.

local destroyer_skill=tonumber(skill_power2("destroyer", 1))+hero_item_count2("sp_spell_attack","count")

--Then figure out bonus to damage from intelligence.
--THIS is what you would edit to change how intelligence affects just one spell.
--Basic formula of the following: damage multiplier is 1 + (Bonus damage per point of int)*(Int).

local int_dmg = 1+tonumber(Game.Config("spell_power_config/int_power"))*HInt()/100
--Example: With default config.txt and intelligence of 15, this becomes:
--int_dmg = 1+10*15/100 = 2.5


--Then for every 7 points of int, you get ANOTHER 10% boost to damage!
int_dmg = int_dmg * (1+math.floor(HInt()/7)/10)
--With 15 int, this would be worth another 20%, so int_damage ends up:
--int_dmg = 2.5 * (1 + .2) = 3


--damages are multiplied by destroyer skill and int bonus, then multiplied by spell level.
--In the examples above (destroyer of 30, int_dmg is 3), at level 2, base damage would be multiplied by 7.8 total.

min_dmg = math.floor(min_dmg*(1+destroyer_skill/100)*int_dmg)*level
max_dmg = math.floor(max_dmg*(1+destroyer_skill/100)*int_dmg)*level

min_dmg=dmg_round(min_dmg)
max_dmg=dmg_round(max_dmg)

return min_dmg,max_dmg,level
end

So how could you change this? Here's an example of a (horrendously, terribly unbalanced) change you could make. If you replaced
local int_dmg = 1+tonumber(Game.Config("spell_power_config/int_power"))*HInt()/100
with
local int_dmg = 1+tonumber(Game.Config("spell_power_config/int_power"))/100
int_dmg = math.pow(int_dmg,HInt())
Now instead of each new point of intelligence adding 10% damage, each new point multiplies damage by another 10%. So at intelligence 1, you do 110% damage. At intelligence 2, you do 121% damage. At intelligence 3, you do 133% damage. By the time you get to intelligence 20, you're doing 672% damage (instead of 300%, as it's set up by default). As I said, it's not a very well-balanced change by itself. But if you had a few weeks to spare you could probably re-balance the whole game to adapt to that sort of change, and it might even be a more interesting mod as a result (who knows).
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright © 2007 Fulqrum Publishing. All rights reserved.