|
楼主 |
发表于 2009-3-13 00:18:53
|
显示全部楼层
[codes=jass]
//===========================================================================
function LoreleiGetHitWhenFlying3 takes nothing returns nothing
local string tHandle = H2S(GetExpiredTimer())
local unit hero = GetStoredUnit(tHandle, "Hero")
local unit caster = CreateUnit(GetOwningPlayer(hero), udg_SpellCaster, GetUnitX(hero), GetUnitY(hero), bj_UNIT_FACING)
call UnitApplyTimedLife(caster, 'BTLF', 2)
call UnitAddAbility(caster, 'A039')
call IssueTargetOrder(caster, "thunderbolt", hero)
call KillTimer(GetExpiredTimer())
call EnableTrigger(udg_loreleiSkillTwoTrigger)
set hero = null
set caster = null
endfunction
//===========================================================================
function LoreleiGetHitWhenFlying2 takes nothing returns nothing
local string tHandle = H2S(GetExpiredTimer())
local unit hero = GetStoredUnit(tHandle, "Hero")
local timer t
local real damage = GetStoredRealSimple(tHandle, "Damage")
call IssueImmediateOrder(hero, "unravenform")
if damage != 0 then
set t = CreateTimer()
call StoreHandle(H2S(t), "Hero", hero)
call TimerStart(t, 0.25, false, function LoreleiGetHitWhenFlying3)
else
call EnableTrigger(udg_loreleiSkillTwoTrigger)
endif
call KillTimer(GetExpiredTimer())
set hero = null
set t = null
endfunction
//===========================================================================
function LoreleiGetHitWhenFlying takes nothing returns nothing
local string tHandle = H2S(GetTriggeringTrigger())
local unit hero = GetStoredUnit(tHandle, "Hero")
local timer t = CreateTimer()
call SetPlayerAbilityAvailable(GetOwningPlayer(hero), 'A03H', true)
call StoreHandle(H2S(t), "Hero", hero)
call StoreRealSimple(H2S(t), "Damage", GetEventDamage())
call TimerStart(t, 0.01, false, function LoreleiGetHitWhenFlying2)
call KillTrigger(GetTriggeringTrigger())
set hero = null
set t = null
endfunction
//===========================================================================
function LoreleiSkillTwoConditions takes nothing returns boolean
return GetSpellAbilityId() == 'A03H'
endfunction
//===========================================================================
function LoreleiSkillTwoActions takes nothing returns nothing
local unit hero = GetTriggerUnit()
local trigger t = CreateTrigger()
local string tHandle = H2S(t)
local integer time
local integer level = GetUnitAbilityLevel(hero, 'A03H')
call DisableTrigger(udg_loreleiSkillTwoTrigger)
if level < 3 then
set time = level * 10
else
set time = (level - 2) * 45
endif
call SetPlayerAbilityAvailable(GetOwningPlayer(hero), 'A03H', false)
call StoreHandle(tHandle, "Hero", hero)
call TriggerRegisterTimerEvent(t, time, false)
call TriggerRegisterUnitEvent(t, hero , EVENT_UNIT_DAMAGED)
call TriggerAddAction(t, function LoreleiGetHitWhenFlying)
set hero = null
set t = null
endfunction
//===========================================================================
function LoreleiSkillTwoTrigger takes nothing returns nothing
set udg_loreleiSkillTwoTrigger = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(udg_loreleiSkillTwoTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(udg_loreleiSkillTwoTrigger, Condition(function LoreleiSkillTwoConditions))
call TriggerAddAction(udg_loreleiSkillTwoTrigger, function LoreleiSkillTwoActions)
if udg_DEBUG_ON == true then
call BJDebugMsg("夜雀技能2装载完毕")
endif
endfunction
[/codes]
通過點擊取消烏鴉形態還原,單位會在空中轉向至左下……如何解決
如果改為使用取消單位觸碰,改變飛行高度的模擬方法,如果改變單位初始速度?
另外話說怎么使用代碼高亮…… |
|