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, 02: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 11-20-2024, 01:25 PM
mark356 mark356 is offline
Registered Member
 
Join Date: Nov 2024
Posts: 1
Default 카지노사이트 추천

5카지노사이트 먹튀 검증 사이트, 카지노사이트 추천, 안전한 카지노사이트, 바카라사이트, 슬롯사이트, 보증업체 추천 및 각종 이벤트 정보카지노사이트 추천
Reply With Quote
  #3  
Old 02-09-2025, 12:30 PM
totoyo365 totoyo365 is offline
Registered Member
 
Join Date: Feb 2025
Posts: 1
Default ToToYo365

Totoyo365.com is an online platform that offers sports betting services, allowing users to place wagers on various sports events. 먹튀검증
Reply With Quote
  #4  
Old 04-06-2025, 10:31 AM
LutzO LutzO is offline
Registered Member
 
Join Date: Apr 2025
Location: Berlin
Posts: 7
Default

Wow, that sounds pretty tricky—I know the feeling when you're trying to tweak something and it just doesn’t behave the way you expect. I’m not much help with the code myself, but I really hope you figure it out soon!
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 09:56 AM.


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