• 🏆 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!

[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.
 
Level 8
Joined
Feb 15, 2009
Messages
463
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)
 
Level 7
Joined
Oct 8, 2008
Messages
200
Well it works xD, but like the main problem is still there. The spell keeps repeating itself for no reason.
 
Level 7
Joined
Oct 8, 2008
Messages
200
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
 
Level 7
Joined
Oct 8, 2008
Messages
200
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.
Top