| 04-21-2007, 05:13 PM | #1 |
| 04-21-2007, 05:22 PM | #2 |
this will stop casting and attacking unit agains a unit with that buff. and cannot oocur same time on same unit, cus no untio can cast and attack at the same time |
| 04-21-2007, 05:31 PM | #3 |
I thought so, but no point in not asking. |
| 04-21-2007, 05:49 PM | #4 |
A trigger is an event listener, esentally. when an event happens, the condition is checked, then the action function is excecuted. So of course it should work, if all the event-response functions return null when the event(s) they corrospond to haven't happend. |
| 04-21-2007, 05:49 PM | #5 |
instead, i'll suggest you add these 2 ability to the unit - ethernal ('Aetl') - spell immune / spell resistance of 100% or just make the unit invulnerable ? O_o |
| 04-21-2007, 06:05 PM | #6 |
I don't want to make the unit invulnerable, and I'll explain why. The ability traps a unit for 7 seconds. it can't be attacked or targeted for any type of spell. After 7 seconds, 4 dummy units cast a damaging spell on it. (I added a check to ensure the spell will pass through this trigger). If I made the unit invulnerable, the dummies couldn't cast upon it. EDIT: Converted to JASS for optimization... I almost cried at how ugly it was. 5 or so functions, lots of BJ's, useless If thens.... here's the final result: JASS:function Blade_Cage_No_Attacks_Actions takes nothing returns nothing if ( GetUnitAbilityLevel(GetAttackedUnitBJ(), 'B00T') > 0 ) then call IssueImmediateOrder(GetAttacker(), "stop") endif if GetSpellAbilityId() != 'A020' and GetUnitAbilityLevel(GetSpellTargetUnit(), 'B00T') > 0 then call IssueImmediateOrder( GetSpellAbilityUnit(), "stop" ) endif endfunction //=========================================================================== function InitTrig_Blade_Cage_No_Attacks takes nothing returns nothing local trigger t = CreateTrigger() call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_ATTACKED ) call TriggerRegisterAnyUnitEventBJ(t, EVENT_PLAYER_UNIT_SPELL_CAST ) call TriggerAddAction( t, function Blade_Cage_No_Attacks_Actions ) set t = null endfunction |
| 04-22-2007, 07:23 AM | #7 |
*cough* remove the invulnerability before order the dummy to cast spell upon it -.-?? i cant figure out why is that not working... if i remember correctly, invulnerability does not remove buff like ensare or such... |
| 04-22-2007, 01:57 PM | #8 |
It's more precise and accurate to do it through this method. Plus, I can add error messages. |
