- UID
- 4963262
- 主题
- 18
- 阅读权限
- 20
- 帖子
- 194
- 精华
- 0
- 积分
- 107
- 金钱
- 993
- 荣誉
- 1
- 人气
- 0
- 在线时间
- 292 小时
- 评议
- 0
- 帖子
- 194
- 精华
- 0
- 积分
- 107
- 金钱
- 993
- 荣誉
- 1
- 人气
- 0
- 评议
- 0
|
autumner 发表于 2013-2-4 09:47 
楼主,看了你几个帖子,觉得这方面应该很强悍。
借个地方问下,我想把原来复仇天使的技能改成群体的,参照 ...
scripted {
no_hint=1 // 啥意思,赋值,0,1有什么区别?<-------------------这个没什么意义,hint是指提示跟说明,不影响任何的使用,0就是否false,1就是是true值,基本的编程知识
script_attack=spell_angel_avenger_attack
script_calccells=calccells_all_ally <----------------------------这个只是判定条件,你也可以改成calccells_all_enemy,这个意思就变成对全体敌人有效,但是要让魔法使用到群体,其实是上面的sript_attack的描述,则个要在spells.lua里面找,但貌似复仇天使的是AP版本才加的,所以后来是变成addon_spells.lua里面的描述才能找到。
attack_cursor=magicstick
ad_factor=0 // use attack/defense
nfeatures=magic_immunitet<----------------------------------------这里提示一下,你可以在自建的兵种的unit_features里面加上自己的特性,例如god,human2之类的,然后你再在一些会伤害到自己人的群体魔法里面的nfeatures里面加上god,human2这样,你的魔法就不会伤害到自己了。
ai_ignore=1 //这个又是什么,目标忽略?<---------------------电脑忽略,你可以看到如时空回流这些魔法,也是有这个段落的,所以AI从来没用过。
}
params {
damage=240-360
type=bonus
typedmg=magic
lvl_dmg=240
duration=4,5,6
int=0
}
如果你要修改成群体魔法,你要将addon_spells.lua的这一段攻略了,我觉得麻烦就没弄(老实说我也不太懂,因为我不是学编程出身的,只是因为国外的恩赐的开放性,我也看得懂一些英文所以才弄的)。我目前已经弄到兵种可以使用这个增益魔法了(方法跟我这段时间的一样),我也曾经想弄一个群体的魔法盾或者群体的复仇天使,考虑是可以参考如加速这些群体魔法的方法。你也可以去弄一下,我想应该是没有问题的。
-- ***********************************************
-- * Angel-Avenger
-- ***********************************************
function spell_angel_avenger_attack()
local level=Obj.spell_level()<-----------------------------------------------这里你改成3的话,就是3级的复仇天使了
if level==0 then level=1 end
local target = Attack.get_target()
Attack.act_del_spell(target,"spell_angel_avenger")
local duration = tonumber("0" .. text_dec(Logic.obj_par("spell_angel_avenger","duration"),level))
if Logic.obj_par("spell_angel_avenger","int")=="1" then
duration = duration + math.floor(HInt()/tonumber(Game.Config("spell_power_config/int_duration")))
end
Attack.act_apply_spell_begin( target, "spell_angel_avenger", duration, false )
Attack.act_posthitslave(target, "post_spell_angel_avenger", duration)
local min_dmg, max_dmg = pwr_angel_avenger(level)
Attack.act_spell_param(target, "spell_angel_avenger", "damage", min_dmg.."-"..max_dmg)
Attack.act_apply_spell_end()
Attack.atom_spawn(target, 0, "magic_avenger",Attack.angleto(target))
return true
end
function find_unit_by_uid(uid)
for i=1, Attack.act_count()-1 do
if Attack.act_uid(i) == uid then return i end
end
end
function post_spell_angel_avenger(damage,addrage,attacker,receiver,minmax,userdata)
local spell = "spell_angel_avenger"
if Attack.act_is_spell(receiver,spell) then
if minmax == 0 then
if Attack.get_caa(attacker) ~= nil and not Attack.act_ally(attacker, Attack.act_belligerent(receiver)) then -- 羼腓 ?礤 耧咫?- 铗忮鬣屐, 怛铕? 镳钼屦赅 - 黩钺?礤 铗忮鬣螯 疋铊?
local dmg_type = Logic.obj_par(spell,"typedmg")
local a = Attack.atom_spawn(attacker, 0, "angel_avenger")
Attack.val_store(a, "damage", Game.CurLocRand(text_range_dec(Attack.act_spell_param(receiver, spell, "damage"))))
Attack.val_store(a, "dmg_type", dmg_type)
Attack.val_store(a, "belligerent", Attack.act_belligerent(receiver)) -- 潆 镳噔桦钽?鲡弪??腩沐
Attack.val_store(a, "receiver_uid", Attack.act_uid(receiver))
Attack.val_store(a, "target_uid", Attack.act_uid(attacker))
Attack.val_store(a, "creator", "magic") -- 潆 耱囹桉蜩觇 镱耠?犷
Attack.resort(Attack.get_caa(a))
end
-- Attack.act_posthitslave(receiver,"post_spell_angel_avenger",0)
end
else
Attack.act_posthitslave(receiver,"post_spell_angel_avenger",0)
end
return damage
end
function angel_avenger_attack()
Attack.log_label('null')
local act = find_unit_by_uid(Attack.val_restore("target_uid"))-- Attack.get_caa(Attack.get_cell(0))
if act ~= nil then
local a = Attack.atom_spawn(act, 0, "magic_lightning")
Attack.atk_set_damage(Attack.val_restore("dmg_type"), Attack.val_restore("damage"))
common_cell_apply_damage(act, Attack.aseq_time(a, "x"))
Attack.log_label('')
local receiver = find_unit_by_uid(Attack.val_restore("receiver_uid"))
if receiver ~= nil then
local spell = "spell_angel_avenger"
local dur = Attack.act_spell_duration(receiver, spell)
if dur <= 1 then
Attack.act_posthitslave(receiver,"post_spell_angel_avenger",0)
Attack.act_del_spell( receiver, spell )
else
Attack.act_spell_duration(receiver, spell, dur-1)
end
end
end
Attack.act_remove(0, 0)
return true
end
|
|