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: Crossworlds > Mods

Mods King's Bounty: Crossworlds Mods

Reply
 
Thread Tools Display Modes
  #1  
Old 10-24-2011, 03:06 AM
Loopy Loopy is offline
Approved Member
 
Join Date: Mar 2011
Posts: 71
Default Need help modding battle rewards

I'm trying to mod my game so that instead of needing to dig for treasure you are instead automatically rewarded with whatever would have been dug up. I'm really noob at programming so I'm having some problems since lots of stuff can't be straight copied from the dig function to battle rewards function. The Original dug-chest spawning function looks like this:

Code:
function custom_genbox( racemask ) -- äëÿ ñóíäóêîâ äðàêîí÷èêà

  local K = Boxgen.rnd(100)

  K = K - 5
  if K < 0 then
    local r = Boxgen.rnd(3)

    if r == 0 then
      Boxgen.parcount( "rune_might", "1" )
    elseif r == 1 then
      Boxgen.parcount( "rune_magic", "1" )
    else
      Boxgen.parcount( "rune_mind", "1" )
    end

    return true
  end

  K = K - 5
  if K < 0 then
    local r = Boxgen.rnd(100)

    if r < 50 then
      Boxgen.parcount( "crystals", "1" )
    elseif r < 80 then
      Boxgen.parcount( "crystals", "2" )
    elseif r < 95 then
      Boxgen.parcount( "crystals", "3" )
    else
      Boxgen.parcount( "crystals", "5" )
    end

    return true
  end

  K = K - 15
  if K < 0 then -- ïðîñòîé ñâèòîê

    local r = Boxgen.rnd(100)
    local count = 3
    if r < 80 then
      count = 1
    elseif r < 95 then
      count = 2
    end

    if not Boxgen.scroll( Game.MapLocDifficulty(), count ) then
      -- cant add scroll, add money
      Boxgen.parcount( "money", "*7" ) -- ãåíåðèì äåíåã Mini,Small,Average
    end

    return true
  end

  K = K - 3
  if K < 0 then -- ìàãèÿ ñòðàíñòâèé

    if not Boxgen.scroll( ) then
      -- cant add scroll, add money
      Boxgen.parcount( "money", "*7" ) -- ãåíåðèì äåíåã Mini,Small,Average
    end

    return true
  end

  -- Boxgen.parcount( "money", "*7" ) -- ãåíåðèì äåíåã Mini,Small,Average
  local r = Boxgen.rnd(100)
	if r < 40 then
  	Boxgen.parcount( "money", "*1" ) -- ãåíåðèì äåíåã Mini
	elseif r < 75 then
  	Boxgen.parcount( "money", "*2" ) -- ãåíåðèì äåíåã Small
	else
		Boxgen.parcount( "money", "*4" ) -- ãåíåðèì äåíåã Average
	end


  return true

end
While my added-in section (to the bottom of function calc_bonus( fake_win )) is
Code:
for i=1, 4 do
  local K = Game.Random(1,100)

  if K < 5 then
    local r = Game.Random(1,3)

    if r == 0 then
      Bonus.add("rune_might",1)
    elseif r == 1 then
      Bonus.add("rune_magic",1)
    else
      Bonus.add("rune_mind",1)
    end

   elseif K < 10 then
		local r = Game.Random(1,100)

		if r < 50 then
			Bonus.add( "crystals", "1" )
		elseif r < 80 then
			Bonus.add( "crystals", "2" )
		elseif r < 95 then
			Bonus.add( "crystals", "3" )
		else
			Bonus.add( "crystals", "5" )
		end
	elseif K < 25 then
		local r = Game.Random(1,100)
		local count = 3
		if r < 80 then
			count = 1
		elseif r < 95 then
			count = 2
		end

		--if not Boxgen.scroll( Game.MapLocDifficulty(), count ) then
			-- cant add scroll, add money
		Bonus.add( "money", common_update_money( gold )*7 ) -- ãåíåðèì äåíåã Mini,Small,Average
		--end
	elseif K < 28 then -- ìàãèÿ ñòðàíñòâèé

		--if not Boxgen.scroll( ) then
			-- cant add scroll, add money
		Bonus.add( "money", common_update_money( gold )*7 ) -- ãåíåðèì äåíåã Mini,Small,Average
    else
		local r = Game.Random(1,100)
		if r < 40 then
			Bonus.add( "money", common_update_money( gold )*1 ) -- ãåíåðèì äåíåã Mini
		elseif r < 75 then
			Bonus.add( "money", common_update_money( gold )*2 ) -- ãåíåðèì äåíåã Small
		else
			Bonus.add( "money", common_update_money( gold )*4 ) -- ãåíåðèì äåíåã Average
		end

    end
  end
I need to know how to create scrolls for the character, the money and run creation work fine already.

Also, I need to know how to get the number of chests that are in the area (dependent on the pet digging level + the item that gives dig spots), I have it forced to 4 rewards at the moment but the original pet function uses

Code:
	local limits = {tonum(Attack.get_custom_param("green")), tonum(Attack.get_custom_param("red"))}
	if hero_item_count("sp_pet_digger")>0 then
		limits[1] = limits[1] + 1
		limits[2] = limits[2] + 1
	end
Which also doesn't work for me.


Anyone here who can help me with this?
Reply With Quote
  #2  
Old 05-11-2024, 02:17 PM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default

I have a weakness for cream-filled cakes. There's just something so indulgent about biting into a dessert oozing with creamy goodness. Retro Heart Cake
Reply With Quote
  #3  
Old 05-22-2024, 09:08 AM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default egref

Stay a measure before online scammers with MTPolicee.com, your trusted eat and run verification site. We're here to make certain that internet transactions are at ease and reliable. 먹튀검증업체
Reply With Quote
  #4  
Old 05-25-2024, 09:43 AM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default greg

I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... Random generator tools
Reply With Quote
  #5  
Old 05-25-2024, 11:44 AM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default

I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... crazy monkey free play
Reply With Quote
  #6  
Old 05-25-2024, 11:53 AM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default

This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: Font finder
Reply With Quote
  #7  
Old 05-25-2024, 11:59 AM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. visit website
Reply With Quote
  #8  
Old 05-29-2024, 01:21 PM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default

I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. fina metal fabrication brooklyn
Reply With Quote
  #9  
Old 05-29-2024, 01:26 PM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default

You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this... staten island restaurants
Reply With Quote
  #10  
Old 05-30-2024, 06:54 AM
ghori92 ghori92 is offline
Approved Member
 
Join Date: Mar 2024
Posts: 2,032
Default

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! 토토사이트
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 10:36 PM.


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