CR init

Events


Map initialization

Conditions

Actions


Hashtable - Create a hashtable


Set CR_hash = (Last created hashtable)


Set CR_area[1] = 550.00


Set CR_area[2] = 550.00


Set CR_area[3] = 550.00


Set CR_leach[1] = 0.03


Set CR_leach[2] = 0.05


Set CR_leach[3] = 0.10


Set CR_damage[1] = 50.00


Set CR_damage[2] = 75.00


Set CR_damage[3] = 100.00


Set CR_speed = 7.00


Set CR_ability = Corruption


Set CR_missile_number = 15


Set CR_effect = Abilities\Weapons\GargoyleMissile\GargoyleMissile.mdl


Set CR_detect_range = 50.00


Set CR_attack_type = Spells


Set CR_damage_type = Magic


-------- Do not modify bellow. --------


Set CR_SaveUsage = 4
CR cast

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to CR_ability

Actions


Custom script: local integer h


Custom script: local integer calc


Set CR_unit = (Triggering unit)


Custom script: set h = GetHandleId(udg_CR_unit)


For each (Integer A) from 1 to CR_missile_number, do (Actions)



Loop - Actions




Custom script: set calc = udg_CR_SaveUsage * bj_forLoopAIndex




Set CR_angle = ((360.00 / (Real(CR_missile_number))) x (Real((Integer A))))




Custom script: call SaveReal(udg_CR_hash, h, calc + 1, udg_CR_angle)




Custom script: call SaveReal(udg_CR_hash, h, calc + 2, GetUnitX(udg_CR_unit))




Custom script: call SaveReal(udg_CR_hash, h, calc + 3, GetUnitY(udg_CR_unit))


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(CR_group is empty) Equal to True



Then - Actions




Trigger - Turn on CR loop <gen>



Else - Actions


Unit Group - Add CR_unit to CR_group
CR loop

Events


Time - Every 0.03 seconds of game time

Conditions

Actions


Unit Group - Pick every unit in CR_group and do (Actions)



Loop - Actions




Custom script: local integer h




Custom script: local integer calc




Set CR_unit = (Picked unit)




Custom script: set h = GetHandleId(udg_CR_unit)




Custom script: set udg_CR_loc = Location(LoadReal(udg_CR_hash, h, udg_CR_SaveUsage + 2), LoadReal(udg_CR_hash, h, udg_CR_SaveUsage + 3))




For each (Integer CR_loop_integer) from 1 to CR_missile_number, do (Actions)





Loop - Actions






Custom script: set calc = udg_CR_SaveUsage * udg_CR_loop_integer






Custom script: set udg_CR_angle = LoadReal(udg_CR_hash, h, calc + 1)






Custom script: set udg_CR_distance = LoadReal(udg_CR_hash, h, calc + 4) + udg_CR_speed






Custom script: call SaveReal(udg_CR_hash, h, calc + 4, udg_CR_distance)






Set CR_loc2 = (CR_loc offset by CR_distance towards CR_angle degrees)






Special Effect - Create a special effect at CR_loc2 using CR_effect






Special Effect - Destroy (Last created special effect)






Custom script: set bj_wantDestroyGroup = true






Unit Group - Pick every unit in (Units within CR_detect_range of CR_loc2 matching (((Matching unit) belongs to an enemy of (Owner of CR_unit)) Equal to True)) and do (Actions)







Loop - Actions








Custom script: local integer h = GetHandleId(udg_CR_unit)








Custom script: local boolean b = LoadBoolean(udg_CR_hash, h, GetHandleId(GetEnumUnit()))








Custom script: if not b then








Set MS_Source1 = (Picked unit)








Custom script: call SaveBoolean(udg_CR_hash, h, GetHandleId(udg_MS_Source1), true)








Unit - Cause CR_unit to damage MS_Source1, dealing CR_damage[(Level of CR_ability for CR_unit)] damage of attack type CR_attack_type and damage type CR_damage_type








Set MS_Target1 = CR_unit








Set MS_Heal1 = ((Max life of (Picked unit)) x CR_leach[(Level of CR_ability for CR_unit)])








Trigger - Run CR Missile Settings <gen> (ignoring conditions)








Trigger - Run CreateMissile <gen> (checking conditions)








Custom script: endif






Custom script: call RemoveLocation(udg_CR_loc2)




Custom script: call RemoveLocation(udg_CR_loc)




If (All Conditions are True) then do (Then Actions) else do (Else Actions)





If - Conditions






CR_distance Greater than or equal to CR_area[(Level of CR_ability for CR_unit)]





Then - Actions






Custom script: call FlushChildHashtable(udg_CR_hash, h)






Unit Group - Remove CR_unit from CR_group






If (All Conditions are True) then do (Then Actions) else do (Else Actions)







If - Conditions








(CR_group is empty) Equal to True







Then - Actions








Trigger - Turn off (This trigger)







Else - Actions





Else - Actions
| Name | Contridution |
Killcide | GIF preview |
Redscores | Missile System |