View Single Post
  #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