- Joined
- Feb 22, 2013
- Messages
- 161
Hello everyone, I am trying to make a spell called Deep Freeze that is cast at ground and has a certain area of affect. Here is the code.
Now the problem is, is when I try and save or test the map JassHelper detects a syntax error but doesn't do anything else and freezes the editor. JassHelper acts like it's doing something but never does. What's going on?
I've deleted JNGP and re-installed it multiple times and I have the Blizzardmodding site version too, so I'm stumped.
JASS:
scope DeepFreeze initializer DeepFreeze_onInit
//===================================
//============START SETUP============
//===================================
globals
private constant integer ABILITY_ID = 'D000' // Raw ability id
private constant real RADIUS = 384.00 // Area of affect range
private constant integer STUN_DURATION = 4 // Duration of stun when cast
private constant string AOE_EFFECT = "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl" // Special effect used
private group _targets
private boolexpr _bool
endglobals
// Damage dealt to enemies
private function DeepFreeze__damage takes integer level returns real
return level * 50
endfunction
private function DeepFreeze__targets takes unit target returns boolean
return (GetWidgetLife(target) > 0.405) and (IsUnitType(target, UNIT_TYPE_STRUCTURE) == false) and (IsUnitType(target, UNIT_TYPE_MAGIC_IMMUNE) == false)
endfunction
//===================================
//=============END SETUP=============
//===================================
private function DeepFreeze_pickTargets takes nothing returns boolean
return DeepFreeze__targets(GetFilterUnit())
endfunction
// Checks the ability being cast
private function DeepFreeze__conditions takes nothing returns integer
return GetSpellAbilityId() == ABILITY_ID
endfunction
// Actions that occur after ability is cast
private function DeepFreeze_onCall takes nothing returns nothing
local real spellLocX = GetSpellTargetX()
local real spellLocY = GetSpellTargetY()
local unit _caster = GetTriggerUnit()
local integer level = GetUnitAbilityLevel(_caster, ABILITY_ID)
local unit f
call GroupEnumUnitsInRange(_targets, spellLocX, SpellLocY, RADIUS, _bool)
loop
set f = FirstOfGroup(_targets)
exitwhen f == null
call GroupRemoveUnit(_targets, f)
if IsUnitEnemy(f, GetOwningPlayer(_caster)) then
call PauseUnit(f, true)
endif
endloop
set _caster = null
endfunction
// Initialization of our spell
private function DeepFreeze_onInit takes nothing returns nothing
local trigger deepFreezeTrigger = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(deepFreezeTrigger, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(deepFreezeTrigger, Condition(function DeepFreeze__conditions))
call TriggerAddAction(deepFreezeTrigger, function DeepFreeze_onCall)
set _targets = CreateGroup()
set _bool = Condition(function DeepFreeze_pickTargets)
call Preload(AOE_EFFECT)
endfunction
endscope
Now the problem is, is when I try and save or test the map JassHelper detects a syntax error but doesn't do anything else and freezes the editor. JassHelper acts like it's doing something but never does. What's going on?
I've deleted JNGP and re-installed it multiple times and I have the Blizzardmodding site version too, so I'm stumped.