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 Famous series of Fantasy Real-time RPG with turn-based battles.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-04-2012, 03:33 AM
lukasztkd lukasztkd is offline
Approved Member
 
Join Date: May 2012
Posts: 4
Default Make digging at the battlefield faster

I found out digging chests at the battlefield pretty annoying. Its always a few seconds wasted for animation, as well as losing your pet's turn.. So I found the solution, maybe some of you will consider it useful.

Copy to some folder and extract orcs.kfs by zip or rar. Find file "addon_pet.lua", open it (notepad). Find line "function pet_digger()". Now change this :

Code:
function pet_digger()

	local target = Attack.get_target()

	local what, ischest
    if dig_cells[Attack.cell_id(target)] == DIGCELL_BOX then
        what = "pet_chest"; ischest = true
    else
		local pawns = {"altar_bad_statue", "altar_bomb", "altar_hollow", "altar_volcano"}
		what = pawns[Game.CurLocRand(1, table.getn(pawns))]
    end

	local startpos,startdir = Attack.get_spirit_cell()
------------------------ camera block --------------
	local photo = Attack.photogenic(target)

	if (Game.ArenaShape() ~= 5) or (Game.ArenaShape() ~= 2) then
	  if math.random(100) < 80 then
	    if photo == 1 then
              Attack.cam_track(0, 37, 70, 0, target, "cam_pet_attack_digger_centre.track" )
	    end
	    if photo == 0 then
	      if Game.ArenaShape() ~= 1 then
		if math.random(100) < 50 then
	          Attack.cam_track(0, 37, 70, 0, target, "cam_pet_attack_digger_centre.track" )
		else
		  Attack.cam_track(0, 37, 70, 0, target, "cam_pet_attack_digger.track" )
		end
	      end
	    end
	  end
	end
------------------------ end of camera -------------

	Attack.act_aseq( 0, "attack_digger" )
	Attack.act_rotate( Attack.aseq_time(0,"rs1"), Attack.aseq_time(0,"re1"), 0, target )
	Attack.act_move  ( Attack.aseq_time(0,"ms1"), Attack.aseq_time(0,"me1"), 0, target )
	local a=Attack.atom_spawn(target, Attack.aseq_time(0,"as1")-.1, what, 0)
	if not ischest then init_pawn(Attack.get_caa(a)) end
--	Attack.act_rotate( Attack.aseq_time(0,"rs2"), Attack.aseq_time(0,"re2"), 0, Attack.angleto(0,target) )
	Attack.act_move  ( Attack.aseq_time(0,"ms2"), Attack.aseq_time(0,"me2"), 0, startpos )
	Attack.act_rotate( Attack.aseq_time(0,"rs2"), Attack.aseq_time(0,"re2"), 0, startdir )

    local tx,ty,tz = Attack.act_get_center(a) -- çŕďîěčíŕĺě íŕ÷ŕëüíîĺ ďîëîćĺíčĺ
    Attack.act_move( Attack.aseq_time(0,"as1")-.1, Attack.aseq_time(0,"as1"), a, tx,ty,tz-2 )
    Attack.act_move( Attack.aseq_time(0,"as1")   , Attack.aseq_time(0,"ae1"), a, tx,ty,tz )

	dig_cells[Attack.cell_id(target)] = -dig_cells[Attack.cell_id(target)]
	
	Attack.log_label("use_pet_search_")
    pet_after_hit()

	return true

end
Into This :

Code:
function pet_digger()

	local target = Attack.get_target()

	local what, ischest
    if dig_cells[Attack.cell_id(target)] == DIGCELL_BOX then
        what = "pet_chest"; ischest = true
    else
		local pawns = {"altar_bad_statue", "altar_bomb", "altar_hollow", "altar_volcano"}
		what = pawns[Game.CurLocRand(1, table.getn(pawns))]
    end

	local a=Attack.atom_spawn(target, Attack.aseq_time(0,"as1")-.1, what, 0)
	if not ischest then init_pawn(Attack.get_caa(a)) end
	dig_cells[Attack.cell_id(target)] = -dig_cells[Attack.cell_id(target)]	
	
	Attack.log_label("use_pet_search_")
	

	return true

end
Save file. Paste it to "game folder/sessions/orcs/mods (if necessary, create it). If any problems will occur, simply delete the file from this folder.
I haven't found any problems with this soultion yet. Chests rapidly appear, and pet's turn is not wasted. Enjoy .
Reply With Quote
 


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 07:21 PM.


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