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 01-03-2009, 01:09 PM
The Rider The Rider is offline
Approved Member
 
Join Date: Jun 2008
Posts: 76
Default Random rune after a battle

Hi all,
I was trying to change the existing mod that gives mana or rage potion after a battle. My idea was to give with a small chance depending on the hero skill trophies a random rune. I tried two variants of that without success.
that was the old code:
Code:
 if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("alchemist"))*10) then
    Logic.hero_add_item("mana_potion")
  end
I first changed it to that, since the runes are considered items in the game:
Code:
 if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("charm"))*5) then
    Logic.hero_add_item("rune_might")
  end
than I tried that, following the logic from the level up of the hero:
Code:
if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("charm"))*5) then
    Logic.hero_add_item(1,"rune_might",might)
  end
but nothing happens...
any ideas?
Reply With Quote
  #2  
Old 01-03-2009, 01:34 PM
Keneth Keneth is offline
Approved Member
 
Join Date: Nov 2008
Location: here and there
Posts: 378
Default

Hrm, try this one:
Code:
Logic.hero_lu_item("rune_might","count",1)
Also, that's insanely overpowered, it's 25-75 extra runes,
Reply With Quote
  #3  
Old 01-03-2009, 02:19 PM
The Rider The Rider is offline
Approved Member
 
Join Date: Jun 2008
Posts: 76
Default

I will do further balance, for the moment I just want to make it work thanks I will try what you suggest
Reply With Quote
  #4  
Old 01-03-2009, 03:19 PM
The Rider The Rider is offline
Approved Member
 
Join Date: Jun 2008
Posts: 76
Default

actually your code was making the ammount of might runes always 1. it required a little tweaking to add 1 rune and it looks like that:
Code:
local rune_might_count = Logic.hero_lu_item("rune_might","count")
                Logic.hero_lu_item("rune_might","count",rune_might_count+1)
but thanks a lot for the help, now it works
Reply With Quote
  #5  
Old 01-03-2009, 03:59 PM
The Rider The Rider is offline
Approved Member
 
Join Date: Jun 2008
Posts: 76
Default

so the final code looks like that and most important it works
it gives 3.33% chance for a random rune per trophy level skill plus another 3.33% per iron fist/rune stone/high magic (max 20% chance for a rune after a battle)
Code:
 if (Game.Random(1,90) <= tonumber(Logic.hero_lu_skill("charm"))*3+Logic.hero_lu_skill("iron_fist"))*3+Logic.hero_lu_skill("rune_stone"))*3+Logic.hero_lu_skill("hi_magic"))*3) then
local random_rune = Game.Random(1,9)
if random_rune >= 7 then
local rune_might_count = Logic.hero_lu_item("rune_might","count")
                Logic.hero_lu_item("rune_might","count",rune_might_count+1)
elseif random_rune >= 4 then
local rune_mind_count = Logic.hero_lu_item("rune_mind","count")
                Logic.hero_lu_item("rune_mind","count",rune_mind_count+1)
elseif random_rune >= 1 then
local rune_magic_count = Logic.hero_lu_item("rune_magic","count")
                Logic.hero_lu_item("rune_magic","count",rune_magic_count+1)
  end
  end
Attached Files
File Type: zip mod_16b7_eng_bonus_rune.zip (26.1 KB, 146 views)

Last edited by The Rider; 01-03-2009 at 05:21 PM. Reason: added a file
Reply With Quote
  #6  
Old 01-03-2009, 04:51 PM
Keneth Keneth is offline
Approved Member
 
Join Date: Nov 2008
Location: here and there
Posts: 378
Default

Yeah, I figured it either sets to 1 or adds 1 but I haven't had time to check, glad you've made it work.

But it's still overpowered.
Reply With Quote
  #7  
Old 01-09-2009, 04:08 AM
sanjak sanjak is offline
Registered Member
 
Join Date: Dec 2008
Posts: 6
Default

um.... Could you please tell me how to open these file as text files?
Reply With Quote
  #8  
Old 01-09-2009, 01:14 PM
Keneth Keneth is offline
Approved Member
 
Join Date: Nov 2008
Location: here and there
Posts: 378
Default

Open With -> Choose Program... -> Notepad/Wordpad/Other

OR

Double click on the file -> Select the program from a list -> Notepad/Wordpad/Other

LUA is a text file, KFS is an archive file.
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 02:00 AM.


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