- Joined
- Sep 3, 2009
- Messages
- 458
Well This is My first Jass Spell. Can anyone comment on how I did? It's Pretty Simple.
Ice Nova
Creates nova of ice at a target location damaging enemy units.
Code:
Ice Nova
Creates nova of ice at a target location damaging enemy units.
Code:
JASS:
function Trig_Explode_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A00C'
endfunction
function Trig_Explode_Actions takes nothing returns nothing
//================================================
//Variable Setup
//================================================
local unit u = GetTriggerUnit()
local location Temploc = GetSpellTargetLoc()
local real x = GetLocationX( Temploc )
local real y = GetLocationY( Temploc )
local group enemies = CreateGroup()
local unit target
local effect nova = AddSpecialEffect( "Abilities\\Spells\\Undead\\FrostNova\\FrostNovaTarget.mdl", x, y )
call DestroyEffect( nova )
call GroupEnumUnitsInRangeOfLoc(enemies, Temploc, 300.0, null)
loop
set target = FirstOfGroup( enemies )
exitwhen target == null
if IsUnitEnemy( target, GetOwningPlayer(u)) then
call UnitDamageTarget( u, target, 250, true, false, ATTACK_TYPE_CHAOS, DAMAGE_TYPE_NORMAL, null)
endif
call RemoveLocation( Temploc )
call GroupRemoveUnit(enemies, target)
endloop
endfunction
//===========================================================================
function InitTrig_Explode takes nothing returns nothing
set gg_trg_Explode = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Explode, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Explode, Condition( function Trig_Explode_Conditions ) )
call TriggerAddAction( gg_trg_Explode, function Trig_Explode_Actions )
endfunction