Dryvnt
New Member
- Reaction score
- 10
Hey all! Before i start to address what i need help for, i first wanna say for all that remember me, that the first time i was here, i failed, bigtime... But now i am back and i have learned abit more patience, gotten more writing skills and simply, gotten smarter :thup:
So heres my problem, i am making this spell, that i need to use local variables for. But the problem is i FAIL at JASS, but i tried, but the spell wont work :banghead:. The spell is going to go like this
1. I cast the spell on an enemy
2. A dummy unit spawns and cast's a lookalike spell (without a new dummy unit ofc)
Here's my code
So heres my problem, i am making this spell, that i need to use local variables for. But the problem is i FAIL at JASS, but i tried, but the spell wont work :banghead:. The spell is going to go like this
1. I cast the spell on an enemy
2. A dummy unit spawns and cast's a lookalike spell (without a new dummy unit ofc)
Here's my code
JASS:
function Trig_Main_Conditions takes nothing returns boolean
if ( not ( GetSpellAbilityId() == 039;A001039; ) ) then
return false
endif
return true
endfunction
function Trig_Main_Func002001003 takes nothing returns boolean
return ( GetOwningPlayer(GetEnumUnit()) != GetOwningPlayer(GetSpellAbilityUnit()) )
endfunction
function Trig_Main_Func002A takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local unit victim = GetSpellTargetUnit()
local location targetpoint = GetSpellTargetLoc()
local unit dummy
call CreateNUnitsAtLoc( 1, 039;h000039;, GetOwningPlayer(caster), targetpoint, 0.00 )
set dummy = GetLastCreatedUnit()
call UnitAddAbilityBJ( 039;A000039;, dummy )
call SetUnitAbilityLevelSwapped( 039;A000039;, dummy, GetUnitAbilityLevelSwapped(039;A001039;, caster) )
call IssueTargetOrderBJ( GetLastCreatedUnit(), "thunderbolt", victim )
call UnitApplyTimedLifeBJ( 2.00, 039;BTLF039;, dummy )
endfunction
function Trig_Main_Actions takes nothing returns nothing
local location targetpoint = GetSpellTargetLoc()
call ForGroupBJ( GetUnitsInRangeOfLocMatching(500.00, targetpoint, Condition(function Trig_Main_Func002001003)), function Trig_Main_Func002A )
endfunction
//===========================================================================
function InitTrig_Main takes nothing returns nothing
set gg_trg_Main = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Main, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Main, Condition( function Trig_Main_Conditions ) )
call TriggerAddAction( gg_trg_Main, function Trig_Main_Actions )
endfunction