Prometheus
Everything is mutable; nothing is sacred
- Reaction score
- 590
Rad has been helping me make a spell and I was working in JASS Shop Pro. I finished it and stuck it in my warcraft 3 trigger editor and it seemed to be errorless. I tried to save but then a lot of errors came up. It runs perfect according to JASS Shop Pro. I have KaTTana's System in my map if that makes a difference.
Code:
function Trig_Omni_Slash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A001'
endfunction
//======================================================================
function Trig_Omni_Slash_UnitIsDead takes nothing returns boolean
return (GetUnitState(GetFilterUnit(), UNIT_STATE_LIFE) >= 0) and (IsUnitType(GetFilterUnit(), UNIT_TYPE_STRUCTURE) == false)
endfunction
//======================================================================
function Trig_Omni_Slash_Actions takes nothing returns nothing
local unit Caster = GetSpellAbilityUnit()
local integer LevelofAbility = GetUnitAbilityLevelSwapped('A001', Caster)
local unit Target = GetSpellTargetUnit()
local real X = GetUnitX(Target)
local real Y = GetUnitY(Target)
local group NearbyUnits = CreateGroup()
local real X_C
local real Y_C
local boolexpr Filter = Condition( function Trig_Omni_Slash_UnitIsDead )
local integer Increment = 1
loop
exitwhen Increment > LevelofAbility*3
call SetUnitPositionLocFacingLocBJ( Caster, Location(X, Y), GetUnitLoc(Target) )
call SetUnitAnimation(Caster, "attack" )
call UnitDamageTargetBJ( Caster, Target, ( 50.00 * LevelofAbility ), ATTACK_TYPE_CHAOS, DAMAGE_TYPE_UNIVERSAL )
set X_C = GetUnitX(Caster)
set Y_C = GetUnitY(Caster)
call GroupEnumUnitsInRange( NearbyUnits, X_C, Y_C, 600, Filter)
set Target = GroupPickRandomUnit(NearbyUnits)
call GroupClear(NearbyUnits)
set Increment = Increment + 1
endloop
call DestroyBoolExpr(Filter)
endfunction
//======================================================================
function InitTrig_Omni_Slash takes nothing returns nothing
set gg_trg_Omni_Slash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Omni_Slash, EVENT_PLAYER_UNIT_SPELL_EFFECT )
call TriggerAddCondition( gg_trg_Omni_Slash, Condition( function Trig_Omni_Slash_Conditions ) )
call TriggerAddAction( gg_trg_Omni_Slash, function Trig_Omni_Slash_Actions )
endfunction