- Joined
- May 21, 2015
- Messages
- 70
is there something wrong with my code cannot semm to test it when i try to test(F9) in the WE, using JNGP, tried saving the map then manually opening through warcraft but no luck (this just a test because I'm still learning JASS right now) does anyone know what might be the problem?
map initialization trigger is present btw its a trigger which means i created a trigger then convert to custom text, erase all then paste this code.
map initialization trigger is present btw its a trigger which means i created a trigger then convert to custom text, erase all then paste this code.
JASS:
function Slash_Action takes nothing returns nothing
local unit caster = GetSpellAbilityUnit()
local location position = GetUnitLoc(caster)
local group g = CreateGroup()
local unit temp
local integer count = 5
call GroupEnumUnitsInRangeOfLoc(g, position, 600.0, null)
loop
set temp = FirstOfGroup(g)
exitwhen temp == null or count == 0
if IsUnitEnemy(temp, GetOwningPlayer(caster)) then
set temp_loc = GetUnitLoc(temp)
call SetUnitPositionLoc(caster, temp_loc)
call UnitDamageTarget(caster, temp, 100.0, true, false, ATTACK_TYPE_CHAOS, null)
set count = count - 1
endif
call GroupRemoveUnit(g, temp)
endloop
set position = null
set g = null
set temp = null
set temp_loc = null
endfunction
function Slash_Trigger takes nothing returns nothing
local trigger gg_trg_Slash = CreateTrigger()
call TriggerRegisterAnyUnitEventBJ(gg_trg_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT)
call TriggerAddCondition(gg_trg_Slash,Condition(function Slash_Condition))
call TriggerAddAction(gg_trg_Slash, function Slash_Action)
endfunction
Last edited: