找回密码
 点一下
查看: 2540|回复: 1

技能出错.J盲请求告诉哪里错了.如何解决.

[复制链接]
发表于 2009-1-24 06:55:28 | 显示全部楼层 |阅读模式
我想做个升起来然后降下去的技能.
我用别人的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
发表于 2009-1-25 01:45:41 | 显示全部楼层
好多变量 而且是没有用到的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-2 14:54 , Processed in 0.171929 second(s), 18 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表