[Request]Custom Abilities

GameOver[GR]

New Member
Reaction score
11
Another ability i imagined :)

Ability Info
Targets allowed : enemy (creep , hero , even air mobs)
When casting to the enemy stun him for 3.5 seconds,
Blink Caster to the unit and order him to hit the unit
set Caster's attack speed = 300 % for 3 seconds.


Thanks in addition because i know you will help :D

Last Created Ability [ On My Own ]

Code:
function Trig_MassEntangle_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AC44' ) ) then
        return false
    endif
    return true
endfunction

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

function Trig_MassEntangle_Func003A takes nothing returns nothing
    call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetTriggerUnit()), GetUnitLoc(GetEnumUnit()), bj_UNIT_FACING )
    call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
    call IssueTargetOrderBJ( GetLastCreatedUnit(), "entanglingroots", GetEnumUnit() )
endfunction

function Trig_MassEntangle_Actions takes nothing returns nothing
    call ForGroupBJ( GetUnitsInRangeOfLocMatching(600.00, GetUnitLoc(GetTriggerUnit()), Condition(function Trig_MassEntangle_Func003001003)), function Trig_MassEntangle_Func003A )
endfunction

//===========================================================================
function InitTrig_MassEntangle takes nothing returns nothing
    set gg_trg_MassEntangle = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_MassEntangle, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( gg_trg_MassEntangle, Condition( function Trig_MassEntangle_Conditions ) )
    call TriggerAddAction( gg_trg_MassEntangle, function Trig_MassEntangle_Actions )
endfunction
 

GameOver[GR]

New Member
Reaction score
11
ok i when someone helps me with the current request i will add the next here :)

By the way guys i found how to create Omnislash with Jass
Here it is :

Code:
function Trig_Omnislash_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A055'        
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 = 250 
    local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('A055', Caster) * 3 )
    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
 

T.s.e

Wish I was old and a little sentimental
Reaction score
133
Omnislash is ancient, it is actually looked down upon to create another omnislash. Integers, reals, strings, booleans and players do not need to be nulled either. Give me some time and I'll see if I can make your request, it will require vJass and the struct attachment system HSAS though.
 

Dryvnt

New Member
Reaction score
10
You missed alot of location leaks, now the code should be leak free AFAIK... Great spell otherwise ! :D

JASS:
function Trig_Omnislash_Conditions takes nothing returns boolean
    return GetSpellAbilityId() == 'A055'        
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 = AddSpecialEffectTarget("Abilities\\Weapons\\PhoenixMissile\\Phoenix_Missile.mdl",Caster,"weapon" )
    local location R
    local real Damage = 250 
    local integer Amount = 1 + ( GetUnitAbilityLevelSwapped('A055', Caster) * 3 )
    local location Targetpoint = GetUnitLoc(Target)
    local location Polar = PolarProjectionBJ(Targetpoint, 50, GetRandomDirectionDeg())
    local location Casterpoint = GetUnitLoc(Caster)
    local location Targetrandompoint
    call TriggerSleepAction( 0.20 )
    call SelectUnitRemove( Caster )
    call SetUnitVertexColor( Caster, 150, 150, 150, 150 )
    call SetUnitInvulnerable( Caster, true )
    //call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl", Caster, "chest" )) //What is this for? All you do is to create and then right after delete it?
    call SetUnitPositionLocFacingBJ( Caster, Polar,  AngleBetweenPoints(Casterpoint, Targetpoint))
    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, Casterpoint, 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 RemoveLocation(Polar)
                call RemoveLocation(Targetrandompoint)
                call RemoveLocation(Casterpoint)
                set Casterpoint = GetUnitLoc(Caster)
                set Polar = PolarProjectionBJ(Targetpoint, 50, GetRandomDirectionDeg())
                set Targetrandompoint = GetUnitLoc(TargetRandom)
                call SetUnitPositionLocFacingBJ( Caster, Polar, AngleBetweenPoints(Casterpoint, Targetrandompoint) )
                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 ) 
    call RemoveLocation(Polar)
    call RemoveLocation(Targetrandompoint)
    call RemoveLocation(Casterpoint)
    call RemoveLocation(Targetpoint)
    set Targetpoint = null
    set Casterpoint = null
    set Targetrandompoint = null
    set Casterpoint = null
    set Phoenix = null    
    set Caster = null     
    set UnitGroup = null
    set TargetRandom = null
    set Target = null    
    set R = null
endfunction

//===========================================================================
function InitTrig_Omnislash takes nothing returns nothing
    local trigger Omnislash = CreateTrigger()
    call TriggerRegisterAnyUnitEventBJ( Omnislash, EVENT_PLAYER_UNIT_SPELL_CAST )
    call TriggerAddCondition( Omnislash, Condition( function Trig_Omnislash_Conditions ) )
    call TriggerAddAction( Omnislash, function Trig_Omnislash_Actions )
    set Omnislash = null
endfunction


Edit: Use JASS tags instead of code tags
 

GameOver[GR]

New Member
Reaction score
11
hey man i did not want you to check my omnislash i just want you to try helping me a little and not playing around , so if you want to help me give me the Jass for the spell i asked you
 

Dryvnt

New Member
Reaction score
10
Oh sry :/... Just wanted to help you get better at JASS... By learning you that you missed some leaks, because i saw you had removed all other leaks... :( Sry if you was offended by that...
 

GameOver[GR]

New Member
Reaction score
11
no man it is ok but i did not asked you to help me clean leaks i just want you to try my ability now ok?

Here you can check for leaks if you want ^^
also i think this is the start :

Code:
function Trig_Untitled_Trigger_001_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'AHtb' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call AddSpecialEffectTargetUnitBJ( "overhead", GetTriggerUnit(), "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" )
    call SetUnitPositionLoc( GetTriggerUnit(), GetUnitLoc(GetSpellTargetUnit()) )
    call IssueTargetOrderBJ( GetTriggerUnit(), "attack", GetSpellTargetUnit() )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_SPELL_ENDCAST )
    call TriggerAddCondition( gg_trg_Untitled_Trigger_001, Condition( function Trig_Untitled_Trigger_001_Conditions ) )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction
 

Azlier

Old World Ghost
Reaction score
461
JASS:

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
local location TargetLoc = GetUnitLoc(GetSpellTargetUnit())
local unit TrigUnit = GetTriggerUnit()
if GetSpellAbilityId() != 'AHtb' then
    call DestroyEffect(AddSpecialEffectTarget( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" , TrigUnit, "overhead" ))
    call SetUnitPositionLoc(TrigUnit, TargetLoc )
    call IssueTargetOrder(TrigUnit, "attack", GetSpellTargetUnit())
endif
call RemoveLocation(TargetLoc)
set TargetLoc = null
set TrigUnit = null
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Untitled_Trigger_001, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction


I don't even know if it's any good, since I don't have Warcraft to compile it. But, I guess it was good practice for me.
 

GameOver[GR]

New Member
Reaction score
11
1rst) locals should be before if .......
2) it is not working.

So i still need Work For this ability

Thanks for trying but it is NOT working
 

Azlier

Old World Ghost
Reaction score
461
Gah! You're right! That proves that I am still 100% JASS noob. Fixed it... I think.
 

GameOver[GR]

New Member
Reaction score
11
call IssueTargetOrder(TrigUnit, "attack", GetSpellTargetUnit()
this is error Syntax Error

hmm you think i am noob ? look at what you have write man :

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
local location TargetLoc = GetUnitLoc(GetSpellTargetUnit())
local unit TrigUnit = GetTriggerUnit()
if GetSpellAbilityId() != 'AHtb' then
call DestroyEffect(AddSpecialEffectTargetUnit( "Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" , TrigUnit, "overhead" ))

Call destroy yea how to destroy something there is not in the map?

and wtf is this :

endif
call RemoveLocation(TargetLoc)

That i request or i said i do not know good jass does not mean that i can not read too.Your text it noob my friend call destroy without creating? how is that possible?

So i still need Work For this ability

Thanks for trying but it is NOT working
 

Azlier

Old World Ghost
Reaction score
461
hmm you think i am noob ?

At what point did I ever call you a noob?

The DestroyEffect(AddSpecialEffect... Is just a shortened form of creating the effect and destroying it on the next line. I took it directly from AceHart's optimized Heal All spell.

end if means else if.
Erm, what?

call IssueTargetOrder(TrigUnit, "attack", GetSpellTargetUnit())

I made a mistake there, forgot a ) at the end. I hope it works now.
 

GameOver[GR]

New Member
Reaction score
11
man are you sure you can do it? you tried 3 time until now and you made 3 times errors or forgot something here is the next error :

call DestroyEffect(AddSpecialEffectTargetUnit("Abilities\\Spells\\NightElf\\Blink\\BlinkCaster.mdl" , TrigUnit , "overhead"))

Undeclared function AddSpecialEffectTargetUnit.
Also error with this variable : set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
 
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