- Joined
- Nov 20, 2010
- Messages
- 10
Allright.. so after my first 2 days of learning JASS and experiment with a trigger, I encountered something that I can't even think of wrong. No errors appeared, it's just that the timerstart function doesn't work at all.
can any1 help me?
PLZZ help..
pls help...
can any1 help me?
JASS:
function Trig_edit_charge_of_faith_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'A002' ) ) then
return false
endif
return true
endfunction
function condition_group takes nothing returns boolean
return ( IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(udg_Charge_faith_caster)) == true )
endfunction
function damage2 takes nothing returns nothing
loop
set udg_Charge_group = GetUnitsInRangeOfLocMatching(512, udg_Charge_faith_target, Condition(function condition_group))
call UnitDamageTargetBJ( udg_Charge_faith_caster, GetEnumUnit(), ( 5.00 * I2R(GetUnitLevel(udg_Charge_faith_caster))) , ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
set udg_Charge_start_int = udg_Charge_start_int + 1
set udg_Charge_degree = udg_Charge_degree + 10
call TriggerSleepAction( 0.01)
exitwhen udg_Charge_start_int > udg_Charge_end_int
endloop
endfunction
function damage_callback takes nothing returns nothing
call AddSpecialEffectLocBJ( PolarProjectionBJ(udg_Charge_faith_target, 100, udg_Charge_degree), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call DestroyEffectBJ(GetLastCreatedEffectBJ())
call AddSpecialEffectLocBJ( PolarProjectionBJ(udg_Charge_faith_target, 200, udg_Charge_degree), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call DestroyEffectBJ(GetLastCreatedEffectBJ())
call AddSpecialEffectLocBJ( PolarProjectionBJ(udg_Charge_faith_target, 300, udg_Charge_degree), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call DestroyEffectBJ(GetLastCreatedEffectBJ())
call AddSpecialEffectLocBJ( PolarProjectionBJ(udg_Charge_faith_target, 400, udg_Charge_degree), "Abilities\\Spells\\Human\\ThunderClap\\ThunderClapCaster.mdl" )
call DestroyEffectBJ(GetLastCreatedEffectBJ())
endfunction
function Trig_edit_charge_of_faith_Actions takes nothing returns nothing
local unit udg_Charge_faith_caster
local unit centre
local location udg_Charge_faith_target
local integer udg_Charge_degree
local integer udg_Charge_start_int
local integer udg_Charge_end_int
local unit unit1
local unit unit2
local unit unit3
local unit unit4
local unit unit5
local unit unit6
local unit unit7
local unit unit8
local unit unit9
local group udg_Charge_group
local lightning effect1
local lightning effect2
local lightning effect3
local lightning effect4
local lightning effect5
local lightning effect6
local lightning effect7
local lightning effect8
local lightning effect9
local timer udg_Charge_timer = CreateTimer()
set udg_Charge_faith_caster = GetSpellAbilityUnit()
set udg_Charge_faith_target = GetSpellTargetLoc()
set udg_Charge_degree = 0
set udg_Charge_start_int = 0
set udg_Charge_end_int = 180
set udg_Charge_group = GetUnitsInRangeOfLocMatching(512, udg_Charge_faith_target, Condition(function condition_group))
call CreateNUnitsAtLoc( 1, 'h004', Player(11),udg_Charge_faith_target, bj_UNIT_FACING )
set centre = GetLastCreatedUnit()
call TriggerSleepAction(2.00)
call SetUnitTimeScalePercent(centre, 0.00 )
call TimerStart(udg_Charge_timer, 0.25, true, function damage_callback)
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 0) , bj_UNIT_FACING )
set unit1 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit1), GetUnitLoc(centre) )
set effect1 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 45) , bj_UNIT_FACING )
set unit2 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit2), GetUnitLoc(centre) )
set effect2 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 90) , bj_UNIT_FACING )
set unit3 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit3), GetUnitLoc(centre) )
set effect3 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 135) , bj_UNIT_FACING )
set unit4 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit4), GetUnitLoc(centre) )
set effect4 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 180) , bj_UNIT_FACING )
set unit5 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit5), GetUnitLoc(centre) )
set effect5 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 225) , bj_UNIT_FACING )
set unit6 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit6), GetUnitLoc(centre) )
set effect6 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 270) , bj_UNIT_FACING )
set unit7 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit7), GetUnitLoc(centre) )
set effect7 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 315) , bj_UNIT_FACING )
set unit9 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit9), GetUnitLoc(centre) )
set effect9 = GetLastCreatedLightningBJ()
call CreateNUnitsAtLoc( 1, 'h003', GetOwningPlayer(udg_Charge_faith_caster),PolarProjectionBJ(udg_Charge_faith_target, 500, 360) , bj_UNIT_FACING )
set unit8 = GetLastCreatedUnit()
call AddLightningLoc( "HWPB", GetUnitLoc(unit8), GetUnitLoc(centre) )
set effect8 = GetLastCreatedLightningBJ()
call ForGroupBJ( udg_Charge_group, function damage2)
set udg_Charge_degree = 0
set udg_Charge_start_int = 0
call RemoveLocation( udg_Charge_faith_target)
call RemoveUnit(unit1)
call RemoveUnit(unit2)
call RemoveUnit(unit3)
call RemoveUnit(unit4)
call RemoveUnit(unit5)
call RemoveUnit(unit6)
call RemoveUnit(unit7)
call RemoveUnit(unit8)
call RemoveUnit(unit9)
call DestroyLightning( effect1)
call DestroyLightning( effect2)
call DestroyLightning( effect3)
call DestroyLightning( effect4)
call DestroyLightning( effect5)
call DestroyLightning( effect6)
call DestroyLightning( effect7)
call DestroyLightning( effect8)
call DestroyLightning( effect9)
set udg_Charge_faith_caster = null
set unit1 = null
set unit2 = null
set unit4 = null
set unit3 = null
set unit5 = null
set unit6 = null
set unit7 = null
set unit8 = null
set unit9 = null
endfunction
//===========================================================================
function InitTrig_edit_charge_of_faith takes nothing returns nothing
set gg_trg_edit_charge_of_faith = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_edit_charge_of_faith, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_edit_charge_of_faith, Condition( function Trig_edit_charge_of_faith_Conditions ) )
call TriggerAddAction( gg_trg_edit_charge_of_faith, function Trig_edit_charge_of_faith_Actions )
endfunction
pls help...