jazz

3plX

New Member
Reaction score
3
JASS:
function Trig_Omnislash_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'Afod'        
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 = 12
    local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('Afod', Caster) * 2 )
    call TriggerSleepAction( 0.15 )
    call SelectUnitRemove( Caster )
    call SetUnitVertexColor( Caster, 150, 150, 150, 150 )
    call SetUnitInvulnerable( Caster, true )    
    set Phoenix = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile_mini.mdl",Caster,"chest" )
    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.15 )
    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.15 )
                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_Rogue_Killing_Spree takes nothing returns nothing
    set gg_trg_Rogue_Killing_Spree = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Rogue_Killing_Spree, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_Rogue_Killing_Spree, Condition( function Trig_Omnislash_Conditions ) )
    call TriggerAddAction( gg_trg_Rogue_Killing_Spree, function Trig_Omnislash_Actions )
endfunction


this spell works, but there is one small problem,
when you cast it and press "S" (stop) button like 0.5 sec later
spell won't have a cooldown

i know how to fix it, but i don't know how :\
Pause a Caster when he begins to cast a spell
but i have no idea how
could someone please do that for me (i could have done it myself, but i don't understand jazz)
+rep
 

Fire-Wolf

S.P.D Smoke Pot Daily, Legalize It!
Reaction score
54
instead of spell cast use "unit starts the effects of an ability"(not sure how this is in Jass, I would have to look at it.) almost always for custom spells, and its Jass not Jazz
 

Gwypaas

hook DoNothing MakeGUIUsersCrash
Reaction score
50
It's very had to code in jazz, you play it with musical instruments FYI.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top