我想做个升起来然后降下去的技能.
我用别人的JASS修改了下....
技能能使人升起来. 但落不下去. 请问哪里需要修改. 帮忙指点下
我想要到一定时间后落下来. 我只能想到通过整数的变化来弄. 但是不会搞. 请帮下忙.
//======================================================
function chongzhuang takes nothing returns nothing//西门吹雪-跳跃
local timer localtimer = GetExpiredTimer()
local string str = I2S(H2I(localtimer))
local unit localunit = GetStoredUnit(str,"unit")
local player playerid
local group localgroup
local unit aim
local real x
local real y
local integer i
if(localunit == null)then//没有触发单位,则是周期事件
loop
set i = i+1
exitwhen i > 50
endloop
call SetUnitFlyHeight(localunit,0,400)
call DestroyTimer(localtimer)
endif
call SetUnitFlyHeight(localunit,0,400)
set localunit = null
set localtimer = null
endfunction
function Trig_Begin_Actions takes nothing returns nothing//主函数
local unit caster = GetTriggerUnit()
local unit aim
local unit localunit
local integer spellid
local item indexitem
local player playerid
local real x
local real y
local real angle
local real r
local real s
local integer index
local integer level
local timer localtimer
local location pos
local trigger localtrigger
local group localgroup
local group sumgroup
local rect localrect
local string str
if(GetUnitTypeId(caster) != 'z000')then
set spellid = GetSpellAbilityId()
if(spellid == 'A000')then//西门吹雪-跳跃
call UnitAddAbility(caster,'Amrf')
call SetUnitFlyHeight(caster,200,400)
set localtrigger = CreateTrigger()
call SetUnitUserData(caster,H2I(localtrigger))//把动态注册的触发绑定到单位的自定义值上
set str = I2S(H2I(localtrigger))//因为单位同一时间只可能放一个技能,所以在持续技能里面使用是不会冲突的
call StoreInteger(udg_GameCache,str,"unit",H2I(caster))//计时器绑定单位
call StoreInteger(udg_GameCache,str,"level",GetUnitAbilityLevel(caster,'A000'))//绑定技能等级
call TimerStart(localtimer,0.2,false,function chongzhuang)
endif
endif
set caster = null
endfunction
//===========================================================================
function InitTrig_Begin takes nothing returns nothing
set gg_trg_Begin = CreateTrigger()
set udg_indexA = 0
loop
call TriggerRegisterPlayerUnitEvent(gg_trg_Begin,Player(udg_indexA),EVENT_PLAYER_UNIT_SPELL_EFFECT,null)
set udg_indexA = udg_indexA + 1
exitwhen udg_indexA > 11
endloop
call TriggerAddAction(gg_trg_Begin,function Trig_Begin_Actions)
endfunction |