- Joined
- Jun 17, 2014
- Messages
- 236
hello hive, i come here because i need help with my script.
everything just working properly, but the
here is the code :
everything just working properly, but the
private timer why = CreateTimer( )
is not runninghere is the code :
JASS:
library felpower
globals
private constant integer SPELL_ID = 'ADEM' //INSERT SPELL ID
private constant real DURATION = 15.
private unit caster
private player array z
private constant string soundname = "war3mapImported\blablacapskjdiuoqwehsa7fbgt76awetr"
private constant real IMMDAMAGE = 50.
private constant real ANIM_DUR = 1.2
private constant integer AB_ID1 = 'ADPI'
private constant integer IMM = 'e0IM'
private constant integer AB_ID2 = 0
private constant integer AB_ID3 = 0
private unit dum1
private timer why = CreateTimer( )
endglobals
struct roarfelpower
static method con takes nothing returns boolean
local timer casttime = CreateTimer( )
local real x
local real y
local sound cc
local group kz = CreateGroup( )
local unit p
local player enemy
if GetSpellAbilityId( ) == SPELL_ID then
set caster = GetTriggerUnit( )
set x = GetUnitX( caster )
set y = GetUnitY( caster )
set enemy = GetOwningPlayer( caster )
// IF UNIT LESS THAT CRITICAL
set cc = CreateSound( soundname, false, false, true, 12700, 12700, "" )
call StartSound( cc )
call KillSoundWhenDone( cc )
call PauseUnit( caster, true )
call SetUnitAnimationByIndex( caster, /* some integer anim */ 17 )
call PauseUnit( caster, false )
call PauseUnit( caster, true )
call DestroyGroup( kz )
call TimerStart( casttime, ANIM_DUR, false, function thistype.onCast2 )
endif
set cc = null
set kz = null
set p = null
set enemy = null
return false
endmethod
static method onCast2 takes nothing returns nothing
local timer dur = CreateTimer( )
call PauseUnit( caster, false )
set dum1 = CreateUnit( Player( 15 ), IMM, GetUnitX( caster ), GetUnitY( caster ), 0. )
call UnitAddAbility( caster, AB_ID1 )
call TimerStart( why, 0.2, true, function thistype.Immo )
call TimerStart( dur, DURATION, false, function thistype.onExpire )
call DestroyTimer( GetExpiredTimer( ) )
endmethod
static method Immo takes nothing returns nothing
local group kz
local unit p
local real t
local real u
local real k
call BJDebugMsg( R2S( t ) )
if GetUnitAbilityLevel( caster, AB_ID1 ) != 0 then
call BJDebugMsg( R2S( t ) )
set t = t + 0.2
call SetUnitX( dum1, GetUnitX( caster ) )
call SetUnitY( dum1, GetUnitY( caster ) )
if t == 1. then
set kz = CreateGroup( )
call GroupEnumUnitsInRange( kz, GetUnitX( caster ), GetUnitY( caster ), 300., null )
loop
set p = FirstOfGroup( kz )
exitwhen p == null
call GroupRemoveUnit( kz, p )
if IsUnitEnemy( p, GetOwningPlayer( caster ) ) and GetUnitState( p, UNIT_STATE_LIFE ) > 0 then
call UnitDamageTarget( caster, p, IMMDAMAGE, false, true, ATTACK_TYPE_MAGIC, DAMAGE_TYPE_MAGIC, WEAPON_TYPE_WHOKNOWS )
endif
endloop
call DestroyGroup( kz )
endif
else
set t = 0
call KillUnit( dum1 )
call PauseTimer( GetExpiredTimer( ) )
endif
set p = null
set kz = null
endmethod
static method onExpire takes nothing returns nothing
call UnitRemoveAbility( caster, AB_ID1 )
call DestroyTimer( GetExpiredTimer( ) )
endmethod
static method onInit takes nothing returns nothing
local trigger t = CreateTrigger( )
local integer i = 0
loop
exitwhen i > 15
call TriggerRegisterPlayerUnitEvent( t, Player( i ), EVENT_PLAYER_UNIT_SPELL_EFFECT, null )
set i = i + 1
endloop
call TriggerAddCondition( t, function thistype.con )
endmethod
endstruct
endlibrary
//SPECIAL EVENT GARROSH
//Code indented using The_Witcher's Script Language Aligner
//Download the newest version and report bugs at www.hiveworkshop.com