|
楼主 |
发表于 2008-12-19 23:04:14
|
显示全部楼层
[jass]哎呀,我还是发全部出来好了.这是模仿的 群魔践踏
下面的set i = R2I(GetRandomReal(1.00,9.00))将9改为8,就取不了最后那个...
function Trig_A01J_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A01J'
endfunction
function Trig_A01J_Bctions takes nothing returns nothing
local unit array ua
local integer r = 1
local integer i
loop
exitwhen r > 9
set i = R2I(GetRandomReal(1.00,9.00))
set ua = I2U(GetStoredInteger(GameCache(),I2S(H2I(GetExpiredTimer())),"UNIT"+I2S(i)))
if GetRandomInt(1,2) == 1 then
call SetUnitAnimation(ua,"attack slam")
else
call SetUnitAnimation(ua,"spell")
endif
set r = r+1
set ua = null
endloop
endfunction
function Trig_A01J_Actions takes nothing returns nothing
local unit u = GetTriggerUnit()
local unit ut = GetSpellTargetUnit()
local unit array ua
local timer t = CreateTimer()
local real ux = GetUnitX(ut)
local real uy = GetUnitY(ut)
local integer i = 1
local string s
call UnitAddType(ut,UNIT_TYPE_GIANT)
call PauseUnit(ut,true)
call SetUnitInvulnerable(ut,true)
call TriggerSleepAction(1.00)
loop
exitwhen i > 8
call DestroyEffect(AddSpecialEffect("Abilities\\\\Spells\\\\Undead\\\\AnimateDead\\\\AnimateDeadTarget.mdl",ux+100*Cos(45*i*3.14159/180),uy+100*Sin(45*i*3.14159/180)))
set i = i+1
endloop
set i = 1
call TriggerSleepAction(0.50)
loop
exitwhen i > 8
set ua = CreateUnit(GetOwningPlayer(u),'n001',ux+100*Cos(45*i*3.14159/180),uy+100*Sin(45*i*3.14159/180),45*i+180)
call UnitApplyTimedLife(ua,'BTLF',55)
call SetUnitVertexColor(ua,255,255,255,102)
call StoreInteger(GameCache(),I2S(H2I(t)),"UNIT"+I2S(i),H2I(ua))
set i = i+1
set ua = null
endloop
set i = 1
call TriggerSleepAction(0.10)
loop
exitwhen i > 8
set ua = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"UNIT"+I2S(i)))
call IssueImmediateOrderById(ua,852127)
call SetUnitAnimation(ua,"spell")
set i = i+1
set ua = null
endloop
call SetUnitAnimation(ut,"death")
set i = 1
call TriggerSleepAction(1.5)
loop
exitwhen i > 8
set ua = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"UNIT"+I2S(i)))
if GetRandomInt(1,2) == 1 then
call SetUnitAnimation(ua,"attack slam")
else
call SetUnitAnimation(ua,"spell")
endif
set i = i+1
set ua = null
call TriggerSleepAction(0.10)
endloop
set i = 1
call TriggerSleepAction(1.0)
call TimerStart(t,0.5,true,function Trig_A01J_Bctions)
call TriggerSleepAction(12.5)
call PauseTimer(t)
call DestroyTimer(t)
call TriggerSleepAction(1.5)
if GetRandomInt(1,2) == 1 then
set s = "attack slam"
else
set s = "spell"
endif
loop
exitwhen i > 8
set ua = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"UNIT"+I2S(i)))
call SetUnitAnimation(ua,s)
set i = i+1
set ua = null
endloop
set i = 1
call TriggerSleepAction(2.10)
call UnitRemoveType(ut,UNIT_TYPE_GIANT)
call PauseUnit(ut,false)
call SetUnitInvulnerable(ut,false)
call UnitDamageTarget(u,ut,8888.00,true,false,ATTACK_TYPE_HERO,DAMAGE_TYPE_UNKNOWN,WEAPON_TYPE_WHOKNOWS)
loop
exitwhen i > 8
set ua = I2U(GetStoredInteger(GameCache(),I2S(H2I(t)),"UNIT"+I2S(i)))
call RemoveUnit(ua)
call DestroyEffect(AddSpecialEffect("Abilities\\\\Spells\\\\Undead\\\\AnimateDead\\\\AnimateDeadTarget.mdl",ux+100*Cos(45*i*3.14159/180),uy+100*Sin(45*i*3.14159/180)))
set i = i+1
set ua = null
endloop
call SetSoundPosition(gg_snd_DuneWormDeath1,ux,uy,0.00)
call FlushStoredMission(GameCache(),I2S(H2I(t)))
set u = null
set ut = null
set t = null
endfunction
//===========================================================================
function InitTrig_A01J takes nothing returns nothing
set gg_trg_A01J = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_A01J,EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_A01J,Condition(function Trig_A01J_Conditions))
call TriggerAddAction(gg_trg_A01J,function Trig_A01J_Actions)
endfunction[/jass] |
|