游戏狂人
 
- 贡献度
- 109
- 金元
- 6787
- 积分
- 1125
- 精华
- 1
- 注册时间
- 2016-4-21

|
谢谢提醒,之前没有太仔细的测试,把归零放在了攻击之后,我拿代码放在闪避之后归零就没问题了。
function BeginBattle()
if unit.HasSkill("SkillTree144_002") then
item.AddBuffer("buffSkillTree144_002")
end
if unit.HasSkill("SkillTree144_003") then
item.AddBuffer("buffSkillTree144_003")
end
if unit.HasSkill("SkillTree144_004") then
item.AddBuffer("buffSkillTree144_004")
end
if unit.HasSkill("SkillTree144_005") then
item.AddBuffer("buffSkillTree144_005")
end
if unit.HasSkill("SkillTree144_006") then
item.AddBuffer("buffSkillTree144_006")
end
if unit.HasSkill("SkillTree144_007") then
item.AddBuffer("buffSkillTree144_007")
end
end
function CounterAttack (attackargs)
if unit.CounterAttackSkill.Id=="SkillTree144_000" then
property[Prop.SkillDamageFactor] = 50
end
end
function BeforeDamage(attacker, damage, info)
if unit.HasSkill("SkillTree144_002") then
if info.skill.HurtType == HurtType.Fight and unit.CounterAttackSkill.Id=="SkillTree144_000" then
if damage.isCounterAttack == true then
damage.isDodge = true
unit[Prop.CounterAttack] = 0
end
end
end
if unit.HasSkill("SkillTree144_003") then
if info.skill.HurtType == HurtType.Sword and unit.CounterAttackSkill.Id=="SkillTree144_000" then
if damage.isCounterAttack == true then
damage.isDodge = true
unit[Prop.CounterAttack] = 0
end
end
end
if unit.HasSkill("SkillTree144_004") then
if info.skill.HurtType == HurtType.Blade and unit.CounterAttackSkill.Id=="SkillTree144_000" then
if damage.isCounterAttack == true then
damage.isDodge = true
unit[Prop.CounterAttack] = 0
end
end
end
if unit.HasSkill("SkillTree144_005") then
if info.skill.HurtType == HurtType.Spear and unit.CounterAttackSkill.Id=="SkillTree144_000" then
if damage.isCounterAttack == true then
damage.isDodge = true
unit[Prop.CounterAttack] = 0
end
end
end
if unit.HasSkill("SkillTree144_006") then
if info.skill.HurtType == HurtType.Arrow and unit.CounterAttackSkill.Id=="SkillTree144_000" then
if damage.isCounterAttack == true then
damage.isDodge = true
unit[Prop.CounterAttack] = 0
end
end
end
if unit.HasSkill("SkillTree144_007") then
if info.skill.HurtType == HurtType.Short and unit.CounterAttackSkill.Id=="SkillTree144_000" then
if damage.isCounterAttack == true then
damage.isDodge = true
unit[Prop.CounterAttack] = 0
end
end
end
end
function AfterAttack()
property[Prop.SkillDamageFactor] = 0
end
|
|