How can I make a...

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

darkxion
Member
Posts: 57
Joined: April 26th, 2007, 7:53 pm

How can I make a...

Post by darkxion »

I want to make a trigger that will remove the effects of an ability before another ability is used...to be more clear, a trigger that will....cancel out something like item temporary invulnerability on activation of another ability (an attack). Being able to become invulnerable right before using a specific ability is causing a bit of a glitch.

Would this work, more or less?

Code: Select all

function Trig_noglitching_Func003001 takes nothing returns boolean
return ( GetSpellAbilityId() == 'A08D' )
endfunction
function Trig_noglitching_Func003002 takes nothing returns boolean
return ( GetSpellAbilityId() == 'A048' )
endfunction
function Trig_noglitching_Conditions takes nothing returns boolean
if ( not GetBooleanOr( Trig_noglitching_Func003001(), Trig_noglitching_Func003002() ) ) then
return false
endif
return true
endfunction
function Trig_noglitching_Actions takes nothing returns nothing
call UnitRemoveBuffBJ( 'Bvul', GetTriggerUnit() )
call UnitRemoveBuffBJ( 'B00C', GetTriggerUnit() )
endfunction
function InitTrig_noglitching takes nothing returns nothing
local trigger gg_trg_noglitching=null
set gg_trg_noglitching = CreateTrigger(  )
call TriggerRegisterAnyUnitEventBJ( gg_trg_noglitching, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_noglitching, Condition( function Trig_noglitching_Conditions ) )
call TriggerAddAction( gg_trg_noglitching, function Trig_noglitching_Actions )
endfunction
and just add call InitTrig_noglitching() to the function main?
User avatar
Xantan
Honorary wc3edit.net Traitor
Posts: 2507
Joined: February 1st, 2007, 4:11 pm
Location: NEVADA

Re: How can I make a...

Post by Xantan »

I don't understand why you don't test it and just ask for help when results show a fail, but yeah, I think it would work.


If it doesn't work, or if you find theres too many abilities/things getting in the way

there is a remove all buffs trigger as well, or if you messed something else up, just ask for more help...
darkxion
Member
Posts: 57
Joined: April 26th, 2007, 7:53 pm

Re: How can I make a...

Post by darkxion »

I was just a bit unsure, when I asked, I hadn't done the above trigger yet, afterwards I did, but I thought it might break a different trigger, and it did, but that one I fixed by just changing the drop item off hero part to remove item. ^_^