- UID
- 1264148
- 主题
- 0
- 阅读权限
- 20
- 帖子
- 233
- 精华
- 0
- 积分
- 147
- 金钱
- 488
- 荣誉
- 3
- 人气
- 1
- 在线时间
- 14 小时
- 评议
- 0
- 帖子
- 233
- 精华
- 0
- 积分
- 147
- 金钱
- 488
- 荣誉
- 3
- 人气
- 1
- 评议
- 0
|
原帖由 niallain 于 2010-11-6 17:51 发表 
我很想问楼主在挖宝龙先前的版本中如何每10智力战场多出一个陷阱!
修改addon_arena.lua的set_trap_to_arena()函数,
function set_trap_to_arena()
-- 羼腓 羼螯 犷耨 磬 囵屙?- 磬恹?礤 疣犷蜞弪 铗 沭艴?镱溧朦
if Attack.get_boss() ~= nil then return end
--DCatcher: random traps based on hero intelligence
local count_trap = hero_item_count2("sp_set_trap","count") + Game.CurLocRand(1,math.max(3,math.floor(HInt()/10)))
if count_trap>0 then
local duration = 1000
local temp_trap = {}
local added_cells = {}
for i=1,Attack.act_count()-1 do
if string.find(Attack.act_name(i), "^arena_tower") then return end -- 磬 囵屙圊 镳邃戾蝾?腩怏?礤 耱噔桁
if Attack.act_enemy(i) then
local dir = wrap(Attack.cell_dir(i), 6)
local c = Attack.cell_adjacent(i, dir) -- 徨疱?耦皴漤 觌弪牦, 镱 磬镳噔脲龛?忡汶溧 怵嚆?(铐 怦邈溧 耢铗痂?磬 磬 忸轳赅)
for i=2,4 do -- 漕徉怆屐 觌弪觇, 磬麒磬 ?2 镱 4-簋 聍栩? 铗 怵嚆?
c = Attack.cell_adjacent(c, dir)
if empty_cell(c) and not added_cells[Attack.cell_id(c)] then table.insert(temp_trap, c); added_cells[Attack.cell_id(c)] = true end
end
end
end
for i=1,count_trap do
if table.getn(temp_trap) == 0 then break end
local trap_place = Game.CurLocRand(1,table.getn(temp_trap))
local set_position = temp_trap[trap_place]
local trap = Attack.atom_spawn(set_position, 0, "trap")
Attack.act_aseq(trap,"appear")
Attack.cell_set_trap(set_position, trap)
local min_dmg,max_dmg=pwr_trap(3)
Attack.val_store( trap, "min", min_dmg )
Attack.val_store( trap, "max", max_dmg )
Attack.val_store( trap, "level", 3 )
Attack.val_store( trap, "time_last", duration)
table.remove(temp_trap,trap_place)
end
Attack.log("add_blog_trapper")
end
return true
end |
|