• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Omnislash [JASS]

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.
Easy to implement Omnislash

Quickly move around the battlefield, slashing many enemies. You become invulnerable while Omnislashing.
Level 1 - Attacks 3 times.
Level 2 - Attacks 5 times.
Level 3 - Attacks 8 times.
How to implement

* Just open object editor and press (ctrl+D) and replace your ability ID in that lines.

return GetSpellAbilityId() == 'A001'
local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('A001', Caster) * 2 )

JASS:
function Trig_Omnislash_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A001'        
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('A001', 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


Enjoy.

Keywords:
Charge, Slash, Powerful, Juggernaut, Yurnero, Blademaster, Dancing, Battle, Fatal, Fury, Wrath, Rage, Master, Slayer, Hunter, Fanatic, Super.
Contents

Omnislash (Map)

Reviews
20:01, 5th Oct 2010 busterkomo: Switch from using locations to coordinates. Stop using BJs (GetUnitAbilityLevelSwapped, for example).

Moderator

M

Moderator

20:01, 5th Oct 2010
busterkomo:
  • Switch from using locations to coordinates.
  • Stop using BJs (GetUnitAbilityLevelSwapped, for example).
 
Level 11
Joined
Oct 19, 2008
Messages
284
How many more of Omnislash will we end up having here?
I'm sure this can't be approved because it's been posted so many times.
Listen man, but if you want to do a spell from dota, give something new and not always one and the same.This spell has been modeled, but a million times.

I know there is another Omnislash, but I did this because it is very easy to implement on the map.

+1 and it's not GUI... it's JASS

Not GUI? You know what is GUI? LoL
 
Top