• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

juggernaut's omnislash

Status
Not open for further replies.
Level 1
Joined
May 6, 2006
Messages
3
I downloaded the omnislash ability made by emjlr3 and i was wondering how to change the amount of omnislash hits.
 
Level 1
Joined
May 6, 2006
Messages
3
function Trig_Omnislash_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A005'
endfunction

function Unit_Group takes nothing returns boolean
return GetBooleanAnd( IsUnitAliveBJ(GetFilterUnit()) == true, IsUnitEnemy(GetFilterUnit(), GetOwningPlayer(GetTriggerUnit())) == true )
endfunction

function Trig_Omnislash_Actions takes nothing returns nothing
local unit Caster = GetTriggerUnit()
local integer i = 0
local group UnitGroup
local unit TargetRandom
local unit Target = GetSpellTargetUnit()
local effect Phoenix
local location R
local real Damage = 100
local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('A005', Caster) * 2 )
call TriggerSleepAction( 0.20 )
call SelectUnitRemove( Caster )
call SetUnitVertexColor( Caster, 150, 150, 150, 150 )
call SetUnitInvulnerable( Caster, true )
set Phoenix = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl",Caster,"weapon" )
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", Caster, "chest" ))
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(GetUnitLoc(Target), 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), GetUnitLoc(Target)) )
call UnitDamageTarget( Caster, Target, Damage, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
call SetUnitAnimation( Caster, "attack" )
call TriggerSleepAction( 0.25 )
call SelectUnitRemove( Caster )
loop
set i = i + 1
exitwhen i > Amount
set UnitGroup = GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(Caster), Condition(function Unit_Group))
if ( IsUnitGroupEmptyBJ(UnitGroup) == false ) then
set TargetRandom = GroupPickRandomUnit(UnitGroup)
set R = GetUnitLoc(TargetRandom)
call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", Caster, "chest" ))
call SetUnitPositionLocFacingBJ( Caster, PolarProjectionBJ(R, 50.00, GetRandomDirectionDeg()), AngleBetweenPoints(GetUnitLoc(Caster), GetUnitLoc(TargetRandom)) )
call UnitDamageTarget( Caster, TargetRandom, Damage, false, true, ATTACK_TYPE_HERO, DAMAGE_TYPE_NORMAL, WEAPON_TYPE_AXE_MEDIUM_CHOP )
call SetUnitAnimation( Caster, "attack" )
call RemoveLocation ( R )
call TriggerSleepAction( 0.25 )
call SelectUnitRemove( Caster )
else
endif
call DestroyGroup(UnitGroup)
endloop
call SelectUnitForPlayerSingle( Caster, GetTriggerPlayer() )
call SetUnitInvulnerable( Caster, false )
call SetUnitVertexColor( Caster, 255, 255, 255, 255 )
call DestroyEffect( Phoenix )
set Phoenix = null
set Caster = null
set UnitGroup = null
set TargetRandom = null
set Target = null
set Amount = 0
set R = null
set Damage = 0
endfunction

//===========================================================================
function InitTrig_Omnislash takes nothing returns nothing
set gg_trg_Omnislash = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Omnislash, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_Omnislash, Condition( function Trig_Omnislash_Conditions ) )
call TriggerAddAction( gg_trg_Omnislash, function Trig_Omnislash_Actions )
endfunction
 
Level 3
Joined
Mar 2, 2006
Messages
40
local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('A005', Caster) * 2 )
GetUnitAbilityLevelSwapped('A005', Caster) gets the level of omnislash. The rest is simple math.

P.S : lol, i edited my post 3 times before realizing bbcode was disabled :x
 
Status
Not open for further replies.
Top