|
发表于 2008-8-22 23:04:25
|
显示全部楼层
[jass]
function JHFilter takes nothing returns boolean
return IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(udg_U_temp))and GetUnitAbilityLevel(GetFilterUnit(),'A001')==0 and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>1 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false
endfunction
function removeJH takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u = ConvertUnit( GetStoredInteger(CacheValue(), HandleName(t), "UTG"))
call UnitRemoveAbility( u, 'A001' )
call FlushStoredMission( CacheValue(), HandleName(t) )
call DestroyTimer( t )
set t = null
endfunction
function JHActions takes nothing returns nothing
local timer tt = CreateTimer()
local location p = GetUnitLoc(GetEnumUnit())
call UnitAddAbility( GetEnumUnit(), 'A001' )
call AddSpecialEffectLocBJ( p, "Abilities\\\\Spells\\\\Undead\\\\FrostNova\\\\FrostNovaTarget.mdl" )
call DestroyEffect( GetLastCreatedEffectBJ() )
call RemoveLocation(p)
set p = null
call UnitDamageTarget( udg_U_temp2, GetEnumUnit(), 200.00, false, false, ATTACK_TYPE_NORMAL, DAMAGE_TYPE_FIRE, WEAPON_TYPE_WHOKNOWS )
call StoreInteger( CacheValue(), HandleName(tt), "UTG", ConvertHandleInt(GetEnumUnit()) )
call TimerStart( tt, 3 , false, function removeJH )
set tt = null
//call UnitRemoveAbility( GetEnumUnit(), 'A001' )
endfunction
function boo takes nothing returns nothing
local timer t = GetExpiredTimer()
local unit u1 = ConvertUnit( GetStoredInteger(CacheValue(), HandleName(t), "UTG") )
local unit u2 = ConvertUnit( GetStoredInteger(CacheValue(), HandleName(t), "UBOO"))
local integer cs = GetStoredInteger(CacheValue(), HandleName(t), "INT")
local real angle = 0
local real tempX = 0
local real tempY = 0
local boolexpr lCheck=Condition(function JHFilter)
local group lGroup=CreateGroup()
set angle = GetUnitFacing(u2)
set tempX = GetUnitX( u2 ) + 23 * Cos( (3.14159/180) * angle )
set tempY = GetUnitY( u2 ) + 23 * Sin( (3.14159/180) * angle )
call SetUnitX( u2, tempX )
call SetUnitY( u2, tempY )
set cs = cs + 23
set udg_U_temp = u1
call GroupEnumUnitsInRange(lGroup,tempX,tempY,90,lCheck)
if(IsUnitGroupEmptyBJ(lGroup) == false) then
set udg_U_temp2 = u1
call ForGroupBJ(lGroup,function JHActions)
endif
call DestroyGroup(lGroup)
set lGroup = null
call StoreInteger( CacheValue(), HandleName(t), "INT", cs )
if(cs>546) then
call KillUnit(u2)
call FlushStoredMission( CacheValue(), HandleName(t) )
call DestroyTimer( t )
endif
set t = null
set u1 = null
set u2 = null
endfunction
function JHCheck takes nothing returns boolean
return GetSpellAbilityId()=='Aroa'
endfunction
function Trig_NewTrigger_001_Actions takes nothing returns nothing
local timer t
local integer xunhuan = 0
local location p2 = GetUnitLoc(GetTriggerUnit())
local real angle
loop
exitwhen xunhuan > 47
set t = CreateTimer()
set angle = ( ( I2R(xunhuan) + 1 ) * 7.5 )
call CreateNUnitsAtLoc( 1, 'ewsp', GetOwningPlayer(GetTriggerUnit()), p2, angle )
set xunhuan = xunhuan + 1
call StoreInteger( CacheValue(), HandleName(t), "UTG", ConvertHandleInt(GetTriggerUnit()) )
call StoreInteger( CacheValue(), HandleName(t), "UBOO", ConvertHandleInt(GetLastCreatedUnit()) )
call StoreInteger( CacheValue(), HandleName(t), "INT", 0 )
call TimerStart( t, .03, true, function boo )
set t = null
endloop
call RemoveLocation(p2)
set p2 = null
endfunction
//===========================================================================
function InitTrig_NewTrigger_001 takes nothing returns nothing
set gg_trg_NewTrigger_001 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_NewTrigger_001, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition(gg_trg_NewTrigger_001,Condition(function JHCheck))
call TriggerAddAction( gg_trg_NewTrigger_001, function Trig_NewTrigger_001_Actions )
endfunction
[/jass] |
|