|
发表于 2008-9-12 21:12:04
|
显示全部楼层
我真的不行了,求求你帮我看看吧!!!
按照boy大人您的意思,全局函数没有了
[jass]
function Trig_BSXX2_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A03R' ) ) then
return false
endif
return true
endfunction
function JHFilter takes nothing returns boolean
local string s = H2S(GetExpiredTimer() )
local location p
local unit u = GetUnit(s, "Source")
local group g = GetGroup(s,"damaged")
local real DM = (GetUnitAbilityLevel(u, 'A03R')*15+ 0.7*(GetUnitUserData(u)))
if(IsUnitInGroup(GetFilterUnit(), g) == false and IsUnitEnemy(GetFilterUnit(),GetOwningPlayer(u))and GetUnitState(GetFilterUnit(),UNIT_STATE_LIFE)>1 and IsUnitType(GetFilterUnit(),UNIT_TYPE_STRUCTURE)==false ) then
call GroupAddUnit(g, GetFilterUnit())
call CDamage(u,GetFilterUnit(),DM)
set p = Location(GetUnitX(GetFilterUnit()),GetUnitY(GetFilterUnit()))
call CreateNUnitsAtLocFacingLocBJ( 1, 'e005', GetOwningPlayer(u), p,p)
call UnitAddAbility( GetLastCreatedUnit(), 'A03Q' )
call IssueTargetOrder( GetLastCreatedUnit(), "ensnare", GetFilterUnit() )
call UnitApplyTimedLifeBJ( 4.00, 'BTLF', GetLastCreatedUnit() )
call RemoveLocation(p)
set p = null
endif
set u = null
set g = null
return false
endfunction
function IceAC takes nothing returns nothing
local string s = H2S(GetExpiredTimer() )
local unit u = GetUnit(s,"Source")
local location p
local real DM = (GetUnitAbilityLevel(u, 'A03R')*15+ 0.7*(GetUnitUserData(u)))
local boolexpr lCheck
local unit dmg
local real angle = GetUnitFacing(GetEnumUnit())
local real tempX = GetUnitX( GetEnumUnit() ) + 15 * Cos( (3.14159/180) * angle )
local real tempY = GetUnitY( GetEnumUnit() ) + 15 * Sin( (3.14159/180) * angle )
local group lGroup2 = GetGroup(s,"damaged")
local group lGroup = CreateGroup()
set lCheck=Condition(function JHFilter)
call GroupEnumUnitsInRange(lGroup,tempX,tempY,50,lCheck)
set lGroup = null
call DestroyGroup(lGroup)
call SetUnitX( GetEnumUnit(), tempX )
call SetUnitY( GetEnumUnit(), tempY )
endfunction
function IceTimer takes nothing returns boolean
local timer t = GetExpiredTimer()
local integer i
local string s = H2S(t)
local group g = GetGroup(s, "CasterGroup")
local unit u = GetUnit(s,"source")
set i = GetStoredInteger(CacheValue(),H2S(t),"cishu") + 1
call StoreInteger( CacheValue(), H2S(t), "cishu", i )
if i > 25 then
call DestroyGroup(g)
call FlushStoredMission( CacheValue(), HandleName(t) )
call DestroyTimer(t)
else
call ForGroup(g, function IceAC)
endif
set t=null
return false
endfunction
function IceSpell takes nothing returns nothing
local unit source = GetTriggerUnit()
local group g = CreateGroup()
local group g2 = CreateGroup()
local unit u
local real x = GetUnitX(source)
local real y = GetUnitY(source)
local integer i = 0
local integer num = 48
local timer t = CreateTimer()
local string s = H2S(t)
loop
exitwhen i > num
set u = CreateUnit(GetOwningPlayer(source),'e00C', x, y, 360*i/num)
call UnitApplyTimedLife( u, 'BTLF', 0.60 )
call GroupAddUnit(g, u)
set i = i + 1
endloop
call SetHandle(s, "CasterGroup",g)
call SetHandle(s, "Source", source)
call SetHandle(s,"damaged",g2)
call StoreInteger( CacheValue(), H2S(t), "cishu", 0 )
//call TriggerRegisterTimerEvent(t, 0.03, true)
//call TriggerAddCondition(t, Condition(function IceTimer))
call TimerStart(t, .03 , true, function IceTimer )
set t = null
set u = null
set source = null
set g = null
endfunction
//===========================================================================
function InitTrig_BSXX2 takes nothing returns nothing
set gg_trg_BSXX2 = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_BSXX2, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_BSXX2, Condition( function Trig_BSXX2_Conditions ) )
call TriggerAddAction( gg_trg_BSXX2, function IceSpell )
endfunction
[/jass] |
|