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 > Adventure mode

Adventure mode All you want to know about adventure mode (may contain SPOILERS)

Reply
 
Thread Tools Display Modes
  #1  
Old 12-01-2008, 09:11 PM
Keneth Keneth is offline
Approved Member
 
Join Date: Nov 2008
Location: here and there
Posts: 378
Default

Hrm, I'm not completely certain if arena.lua was changed in the latest patch. But it should be fairly easy to copy the functions and make a new version of the file just in case.

Actually, you can probably do this yourself open arena.lua (found in ses.kfs) with a text editor and search for "calc_bonus()" then add the code in the next line like this:

Before:
Code:
function calc_bonus() --ftag:bonus

  local enemyHeroK = 1.5 + Game.Config( "enemy_hero_money_exp_bonus_k") * Logic.enemy_hero_level()
  if Logic.enemy_hero_level() == 0 then enemyHeroK = 1 end
After:
Code:
function calc_bonus() --ftag:bonus

  if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("alchemist"))*10) then
    Logic.hero_add_item("mana_potion")
  end
  if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("rage"))*10) then
    Logic.hero_add_item("rage_potion")
  end

  local enemyHeroK = 1.5 + Game.Config( "enemy_hero_money_exp_bonus_k") * Logic.enemy_hero_level()
  if Logic.enemy_hero_level() == 0 then enemyHeroK = 1 end
Save the file and put it back in or inside a kfs file in your mod folder. If you have trouble doing that much let me know and I'll help.

Last edited by Keneth; 12-01-2008 at 09:29 PM.
Reply With Quote
  #2  
Old 12-01-2008, 11:25 PM
Lari Lari is offline
Approved Member
 
Join Date: Nov 2008
Posts: 36
Default

Quote:
Originally Posted by Keneth View Post
After:
Code:
function calc_bonus() --ftag:bonus

  if (Game.Random(1,100) <= tonumber(Logic.hero_lu_skill("alchemist"))*10) then
    Logic.hero_add_item("mana_potion")
  end
Awesome answer.
Would this add the item at the end of combat? ->

Code:
function calc_bonus() --ftag:bonus
 
 if 1 then
   Logic.hero_add_item("the_boots_that_i_miss_to_complete_the_knight_set")
 end
Obviously i wll substitute the right name, after i look in item.txt. May i skip the "if 1 then" part?
Reply With Quote
  #3  
Old 12-01-2008, 11:41 PM
Keneth Keneth is offline
Approved Member
 
Join Date: Nov 2008
Location: here and there
Posts: 378
Default

I've never worked with Lua but I'm pretty sure that if statements are unnecessary unless you want a condition. Hence all you need to add is the call to Logic.hero_add_item() function (end is part of the if-then-else statement and is used instead of brackets to end a block so you don't need it either).
Reply With Quote
Reply

Thread Tools
Display Modes

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 04:40 PM.


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