- Joined
- Nov 28, 2008
- Messages
- 655
JASS:
function Trig_Holy_Light_JASS_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AHhb' ) ) then
return false
endif
return true
endfunction
function Trig_Holy_Light_JASS_Actions takes nothing returns nothing
local unit castingunit = GetTriggerUnit()
local unit targetunit = GetSpellTargetUnit()
local integer level = GetUnitAbilityLevel(castingunit,'AHhb')
local real damage = (level * -125.)
call UnitDamageTarget(castingunit,targetunit,damage,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_MAGIC,null)
endfunction
//===========================================================================
function InitTrig_Holy_Light_JASS takes nothing returns nothing
set gg_trg_Holy_Light_JASS = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Holy_Light_JASS, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Holy_Light_JASS, Condition( function Trig_Holy_Light_JASS_Conditions ) )
call TriggerAddAction( gg_trg_Holy_Light_JASS, function Trig_Holy_Light_JASS_Actions )
endfunction
The Straight GUI to JASS converted code:
JASS:
function Trig_Holy_Light_Copy_Copy_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 'AHhb' ) ) then
return false
endif
return true
endfunction
function Trig_Holy_Light_Copy_Copy_Actions takes nothing returns nothing
set udg_Level = GetUnitAbilityLevelSwapped(GetSpellAbilityId(), GetSpellAbilityUnit())
call UnitDamageTargetBJ( GetSpellAbilityUnit(), GetSpellTargetUnit(), ( -125.00 * I2R(udg_Level) ), ATTACK_TYPE_NORMAL, DAMAGE_TYPE_NORMAL )
endfunction
//===========================================================================
function InitTrig_Holy_Light_Copy_Copy takes nothing returns nothing
set gg_trg_Holy_Light_Copy_Copy = CreateTrigger( )
call DisableTrigger( gg_trg_Holy_Light_Copy_Copy )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Holy_Light_Copy_Copy, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Holy_Light_Copy_Copy, Condition( function Trig_Holy_Light_Copy_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Holy_Light_Copy_Copy, function Trig_Holy_Light_Copy_Copy_Actions )
endfunction
Am willing to learn, please show me my errors, be as honest as possible, I want to learn the RIGHT way.