• Check out the results of the Techtree Contest #19!
  • Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[JASS] Old Ability work before patch now it just keeps repeating itself

Status
Not open for further replies.
Level 7
Joined
Oct 8, 2008
Messages
200
JASS:
function Trig_KunaiDropHiraishin_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction


function Trig_KunaiDropHiraishin_Actions takes nothing returns nothing
local location a = GetUnitLoc(GetTriggerUnit())
    call CreateItemLoc( 'I001', a )
    set udg_HeroYondaimeHiraishinKunaiItem = GetLastCreatedItem()
    call SetItemInvulnerableBJ( udg_HeroYondaimeHiraishinKunaiItem, true )
    call RemoveLocation( a )
    set a = null
        call UnitRemoveAbilityBJ( 'A003', GetTriggerUnit() )
    call UnitAddAbilityBJ( 'A00G', GetTriggerUnit() )
        set udg_HeroYondaimeHiraishinKunaiInt = 0
endfunction

//===========================================================================
function InitTrig_KunaiDropHiraishin takes nothing returns nothing
    local trigger KunaiDropHiraishin = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( KunaiDropHiraishin, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( KunaiDropHiraishin, Condition( function Trig_KunaiDropHiraishin_Conditions ) )
    call TriggerAddAction( KunaiDropHiraishin, function Trig_KunaiDropHiraishin_Actions )
    set KunaiDropHiraishin = null
endfunction

I am still a noob at JASS. This worked fine before the patch ruin it somehow.
 
JASS:
function Trig_KunaiDropHiraishin_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A003'
endfunction


function Trig_KunaiDropHiraishin_Actions takes nothing returns nothing
    local unit u = GetTriggerUnit()
    local location a = GetUnitLoc(u)

    set udg_HeroYondaimeHiraishinKunaiItem = CreateItemLoc( 'I001', a )
    call SetItemInvulnerableBJ( udg_HeroYondaimeHiraishinKunaiItem, true )
    
    call UnitRemoveAbility(u ,'A003')
    call UnitAddAbility(u ,'A00G' )
    set udg_HeroYondaimeHiraishinKunaiInt = 0
    call RemoveLocation( a )
    set a = null
endfunction

//===========================================================================
function InitTrig_KunaiDropHiraishin takes nothing returns nothing
    local trigger t = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( t, Condition( function Trig_KunaiDropHiraishin_Conditions ) )
    call TriggerAddAction( t, function Trig_KunaiDropHiraishin_Actions )

endfunction

the ItemInvunerableBJ is stil there coz i dont know the native now without looking it up but the trigger should work as it is(if you use coordinates and JNGP u can get tis faster but it will work now for what you want to do it)
 
Well it works xD, but like the main problem is still there. The spell keeps repeating itself for no reason.
 
From what I can tell as soon as the other ability is added after the 1st one is remove it is used. The same thing with the other ability. That's all I can tell
 
Umm I don't feel comfortable to put my map on the web yet. So here's a bit more detail explanation as soon as the ability is added it is used. I think it might be the ability I base the spell on ( its a self cast ability it was base on)
 
Status
Not open for further replies.
Back
Top