找回密码
 点一下
查看: 1234|回复: 6

请教,献祭加到单位上没反应??

[复制链接]
发表于 2008-10-10 20:31:58 | 显示全部楼层 |阅读模式
如题,原来刚做的时候好好的,后来不小心把地图搞坏了,还好j文件还在,就重新导入了一遍,结果发现原本单位加上献祭有伤害效果,现在没了........测试了几遍以后发现如果不PauseUnit有效果,PauseUnit以后就没反应了.......RP问题??

(Abi)--> 'A00Y' 本技能ID
(Abi)--> 'A00X' 辅助献祭技能ID

其他无视就行了,,,,,,,,

[jass]
library bomb
    globals
        private unit array Bomb_Unit_Array
    endglobals
   
    private function H2I takes handle h returns integer
        return h
        return 0
    endfunction
   
    function Bomb_Run takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local integer i = GetStoredInteger(udg_GC,I2S(H2I(t)),"counter")-1
        local real height = 0
        local real randomx = GetRandomReal(-450,450)
        local real randomy = GetRandomReal(-450,450)
        call StoreInteger(udg_GC,I2S(H2I(t)),"counter",i)
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",(GetUnitX(Bomb_Unit_Array[0])+randomx),(GetUnitY(Bomb_Unit_Array[0])+randomy)))
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl",(GetUnitX(Bomb_Unit_Array[0])+randomx),(GetUnitY(Bomb_Unit_Array[0])+randomy)))
        if (i!=0) then
            set i = 0
            loop
                set i = i + 1
                exitwhen i > 20
                    set height = GetUnitFlyHeight(Bomb_Unit_Array)
                    if ( height > 2000 ) then
                        call SetUnitFlyHeight(Bomb_Unit_Array,0,0)
                    else
                        call SetUnitFlyHeight(Bomb_Unit_Array,height+70,0)
                    endif
            endloop
        else
            call PauseTimer(t)
            call FlushStoredMission(udg_GC,I2S(H2I(t)))
            call DestroyTimer(t)
            set Bomb_Unit_Array[21] = CreateUnit(Player(PLAYER_NEUTRAL_PASSIVE),'h00E',GetUnitX(Bomb_Unit_Array[0]),GetUnitY(Bomb_Unit_Array[0]),0)
            loop
                set i = i + 1
                exitwhen i > 21
                    call KillUnit(Bomb_Unit_Array)
                    set Bomb_Unit_Array = null
            endloop
            call PauseUnit(Bomb_Unit_Array[0],false)
            call SetUnitTimeScale(Bomb_Unit_Array[0],1)
            call UnitRemoveAbility(Bomb_Unit_Array[0],'ACmi')
            call UnitRemoveAbility(Bomb_Unit_Array[0],'A00W')
            call UnitRemoveAbility(Bomb_Unit_Array[0],'A00X')
            set Bomb_Unit_Array[0] = null
        endif
        set t = null
    endfunction
   
    function Bomb_Create takes timer t returns nothing
        local location tp = Location(GetStoredReal(udg_GC,I2S(H2I(t)),"LocX"),GetStoredReal(udg_GC,I2S(H2I(t)),"LocY"))
        local integer i = 0
        loop
            set i = i + 1
            exitwhen i > 20
                set Bomb_Unit_Array = CreateUnit(GetOwningPlayer(Bomb_Unit_Array[0]),'h00G',GetLocationX(tp),GetLocationY(tp),0)
                call SetUnitFlyHeight(Bomb_Unit_Array,I2R(i*100),0)
                call TriggerSleepAction(.01)
        endloop
        call RemoveLocation(tp)
        call StoreInteger(udg_GC,I2S(H2I(t)),"counter",60)
        call TimerStart(t,.05,true,function Bomb_Run)
        set t = null
        set tp = null
    endfunction
   
    function Bomb_Timer takes nothing returns nothing
        local timer t = GetExpiredTimer()
        local integer i = GetStoredInteger(udg_GC,I2S(H2I(t)),"counter")-1
        local integer counter = 70 - i
        local real height = GetUnitFlyHeight(Bomb_Unit_Array[1]) + 50
        local real x = 0
        local real y = 0
        local location tp = Location(GetStoredReal(udg_GC,I2S(H2I(t)),"LocX"),GetStoredReal(udg_GC,I2S(H2I(t)),"LocY"))
        local location tp2 = null
        call StoreInteger(udg_GC,I2S(H2I(t)),"counter",i)
        if (i!=0) then
            set i = 0
            loop
                set i = i + 1
                exitwhen i > 35
                    set tp2 = PolarProjectionBJ(tp,500,I2R((counter+i)*10))
                    set x = GetLocationX(tp2)
                    set y = GetLocationY(tp2)
                    call RemoveLocation(tp2)
                    call SetUnitX(Bomb_Unit_Array,x)
                    call SetUnitY(Bomb_Unit_Array,y)
                    call SetUnitFlyHeight(Bomb_Unit_Array,height-25*i,0)
                    set tp2 = PolarProjectionBJ(tp,500,I2R((counter+i)*10-120))
                    set x = GetLocationX(tp2)
                    set y = GetLocationY(tp2)
                    call RemoveLocation(tp2)
                    call SetUnitX(Bomb_Unit_Array[i+35],x)
                    call SetUnitY(Bomb_Unit_Array[i+35],y)
                    call SetUnitFlyHeight(Bomb_Unit_Array[i+35],height-25*i,0)
                    set tp2 = PolarProjectionBJ(tp,500,I2R((counter+i)*10+120))
                    set x = GetLocationX(tp2)
                    set y = GetLocationY(tp2)
                    call RemoveLocation(tp2)
                    call SetUnitX(Bomb_Unit_Array[i+70],x)
                    call SetUnitY(Bomb_Unit_Array[i+70],y)
                    call SetUnitFlyHeight(Bomb_Unit_Array[i+70],height-25*i,0)
            endloop
        else
            call PauseTimer(t)
            loop
                set i = i + 1
                exitwhen i > 105
                    call KillUnit(Bomb_Unit_Array)
                    set Bomb_Unit_Array = null
            endloop
            call Bomb_Create.execute(t)
        endif
        call RemoveLocation(tp)
        set t = null
        set tp = null
        set tp2 = null
    endfunction
   
    function Trig_Bomb_Conditions takes nothing returns boolean
        if ( not ( GetSpellAbilityId() == 'A00Y' ) ) then
            return false
        endif
        return true
    endfunction
   
    function Trig_Bomb_Actions takes nothing returns nothing
        local timer t = CreateTimer()
        local integer i = 70
        local location tp = GetUnitLoc(GetTriggerUnit())
        local location tp2 = null
        local real randomx = 0
        local real randomy = 0
        if (GetUnitState(GetTriggerUnit(),UNIT_STATE_LIFE)<= 0) then
            return
        endif
        call StoreInteger(udg_GC,I2S(H2I(t)),"counter",i)
        call StoreReal(udg_GC,I2S(H2I(t)),"LocX",GetLocationX(tp))
        call StoreReal(udg_GC,I2S(H2I(t)),"LocY",GetLocationY(tp))
        set Bomb_Unit_Array[0] = GetTriggerUnit()
        call PauseUnit(Bomb_Unit_Array[0],true)
        call UnitAddAbility(Bomb_Unit_Array[0],'A00W')
        call TriggerSleepAction(0)
        call SetUnitTimeScale(Bomb_Unit_Array[0],0)
        call UnitAddAbility(Bomb_Unit_Array[0],'Amrf')
        call SetUnitInvulnerable(Bomb_Unit_Array[0],true)
        call SetUnitFlyHeight(Bomb_Unit_Array[0],1400,2500)
        call TriggerSleepAction(.47)
        call SetUnitFlyHeight(Bomb_Unit_Array[0],0,2500)
        call TriggerSleepAction(.28)
        call SetUnitInvulnerable(Bomb_Unit_Array[0],false)
        call UnitRemoveAbility(Bomb_Unit_Array[0],'Amrf')
        call UnitAddAbility(Bomb_Unit_Array[0],'ACmi')
        call UnitAddAbility(Bomb_Unit_Array[0],'A00X')
        call SetUnitAbilityLevel(Bomb_Unit_Array[0],'A00X',GetUnitAbilityLevel(Bomb_Unit_Array[0],'A00Y'))
        call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\Thunderclap\\ThunderClapCaster.mdl",GetUnitX(Bomb_Unit_Array[0]),GetUnitY(Bomb_Unit_Array[0])))
        call PauseUnit(Bomb_Unit_Array[0],true)
        set i = 0
        loop
            set i = i + 1
            exitwhen i > 35
                set tp2 = PolarProjectionBJ(tp,500,I2R(i*10))
                set Bomb_Unit_Array = CreateUnit(GetOwningPlayer(Bomb_Unit_Array[0]),'h00F',GetLocationX(tp2),GetLocationY(tp2),0)
                call RemoveLocation(tp2)
                set tp2 = PolarProjectionBJ(tp,500,I2R(i*10-120))
                set Bomb_Unit_Array[i+35] = CreateUnit(GetOwningPlayer(Bomb_Unit_Array[0]),'h00F',GetLocationX(tp2),GetLocationY(tp2),0)
                call RemoveLocation(tp2)
                set tp2 = PolarProjectionBJ(tp,500,I2R(i*10+120))
                set Bomb_Unit_Array[i+70] = CreateUnit(GetOwningPlayer(Bomb_Unit_Array[0]),'h00F',GetLocationX(tp2),GetLocationY(tp2),0)
                call RemoveLocation(tp2)
        endloop
        call TimerStart(t,.05,true,function Bomb_Timer)
        set i = 0
        loop
            set i = i + 1
            exitwhen i > 40
                set randomx = GetRandomReal(-450,450)
                set randomy = GetRandomReal(-450,450)
                call DestroyEffect(AddSpecialEffect("Objects\\Spawnmodels\\Other\\NeutralBuildingExplosion\\NeutralBuildingExplosion.mdl",(GetLocationX(tp)+randomx),(GetLocationY(tp)+randomy)))
                call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Other\\Doom\\DoomDeath.mdl",(GetLocationX(tp)+randomx),(GetLocationY(tp)+randomy)))
                call DestroyEffect(AddSpecialEffect("Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl",(GetLocationX(tp)+randomx),(GetLocationY(tp)+randomy)))
                call TriggerSleepAction(.01)
        endloop
        call RemoveLocation(tp)
        set tp = null
        set tp2 = null
    endfunction
    //==========================================================================================
    function InitTrig_Bomb takes nothing returns nothing
        set gg_trg_Bomb = CreateTrigger()
        call TriggerRegisterAnyUnitEventBJ(gg_trg_Bomb , EVENT_PLAYER_UNIT_SPELL_EFFECT)
        call TriggerAddCondition(gg_trg_Bomb , Condition(function Trig_Bomb_Conditions))
        call TriggerAddAction(gg_trg_Bomb , function Trig_Bomb_Actions)
    endfunction
endlibrary
[/jass]
发表于 2008-10-10 22:30:45 | 显示全部楼层
可以发下地图吗
回复

使用道具 举报

 楼主| 发表于 2008-10-11 16:08:33 | 显示全部楼层
再补充一下,是永久的献祭

d1.w3x

93 KB, 下载次数: 10

回复

使用道具 举报

发表于 2008-10-11 20:46:44 | 显示全部楼层
打不开
回复

使用道具 举报

 楼主| 发表于 2008-10-11 20:59:04 | 显示全部楼层
咳.......用了支持vjass的UI就打不开么.........

UI:http://www.islga.org/bbs/read.php?tid=10914

谢谢......
回复

使用道具 举报

发表于 2008-10-11 22:30:10 | 显示全部楼层
永久的献祭 明显目标允许不对
勾上 地面 ,有机生物
,,,,,
回复

使用道具 举报

 楼主| 发表于 2008-10-11 23:40:38 | 显示全部楼层
没用.......再说目标允许和是否PauseUnit好像没什么关系.......为什么Pause之前/后献祭有效,Pause时无效......
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-7-21 08:21 , Processed in 0.032203 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

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