| 10-23-2006, 03:17 PM | #1 |
How do i get a trigger only to run if a unit has a specific buff JASS:function Sudden_Shock_Conditions takes nothing returns boolean return GetSpellAbilityId()=='A002' endfunction function Sudden_Shock_Conditions2 takes nothing returns boolean return UnitHasBuffBJ(GetSpellTargetUnit(), 'B000') endfunction function Sudden_Shock_Actions takes nothing returns nothing local integer i = GetUnitAbilityLevel(GetSpellAbilityUnit(),'A002') call UnitDamageTarget(GetSpellAbilityUnit(),GetSpellTargetUnit(),50*i,true,false,ATTACK_TYPE_NORMAL,DAMAGE_TYPE_NORMAL,WEAPON_TYPE_WHOKNOWS) call AddSpecialEffect("Doodads\\Cinematic\\Lightningbolt\\Lightningbolt",GetUnitX(GetSpellTargetUnit()),GetUnitY(GetSpellTargetUnit())) call DisplayTextToForce(GetPlayersAll(),"Debug") call TriggerSleepAction(0.75) call DestroyEffect(GetLastCreatedEffectBJ()) endfunction function InitTrig_Sudden_Shock takes nothing returns nothing local trigger gg_trg_Sudden_Shock call TriggerRegisterAnyUnitEventBJ(gg_trg_Sudden_Shock,EVENT_PLAYER_UNIT_SPELL_CAST) call TriggerAddCondition(gg_trg_Sudden_Shock, Condition(function Sudden_Shock_Conditions)) call TriggerAddCondition(gg_trg_Sudden_Shock, Condition(function Sudden_Shock_Conditions2)) call TriggerAddAction(gg_trg_Sudden_Shock,function Sudden_Shock_Actions) call Preload("Doodads\\Cinematic\\Lightningbolt\\Lightningbolt") endfunction |
| 10-23-2006, 03:20 PM | #2 |
Is 'B000' applied by the spell being cast? If so, then that won't work since you are based on a Unit Begins Casting, not a Unit Starts the Effect of an Ability. So use Trigger: Unit - A unit Starts the effect of an ability |
| 10-23-2006, 05:54 PM | #3 |
No the Buff is cast by a different ability. Changed the Event anyway as it should be part of the effect. |
