• 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.

Problem with trigger/custom ability

Status
Not open for further replies.
Level 5
Joined
Aug 2, 2015
Messages
69
Ive been struggling to make the Ice block ability from wow for my hero. (Hero creates an ice block around him self making him imune for a few secs)

Basicly Ive used a the divine shield ability as an base changing the buff to Frost wyrms Freeze effect.

Here's my trigger :

function Trig_IB_Conditions takes nothing returns boolean
if ( not ( UnitHasBuffBJ(gg_unit_H00J_0005, 'B001') == true ) ) then
return false
endif
return true
endfunction
function Trig_IB_Actions takes nothing returns nothing
call DisableTrigger( GetTriggeringTrigger() )
call PauseUnitBJ( true, gg_unit_H00J_0005 )
call TriggerSleepAction( 10.00 )
call PauseUnitBJ( false, gg_unit_H00J_0005 )
call EnableTrigger( GetTriggeringTrigger() )
endfunction
//===========================================================================
function InitTrig_IB takes nothing returns nothing
set gg_trg_IB = CreateTrigger( )
call TriggerRegisterUnitEvent( gg_trg_IB, gg_unit_H00J_0005, EVENT_UNIT_SPELL_FINISH )
call TriggerAddCondition( gg_trg_IB, Condition( function Trig_IB_Conditions ) )
call TriggerAddAction( gg_trg_IB, function Trig_IB_Actions )
endfunction

The result is currently hero has block for 10s and is imune , pause goes off after 10s but block and imune is still there making him able to move for another 15 or 20s. Ive ofcourse set the right numbers within the ability and such.

Wheres the wrong step ?
 
Level 30
Joined
Feb 18, 2014
Messages
3,623
When you pause a unit that is under the effect of an ability you are also pausing the effect duration which is why the unit remain block/imune a few seconds after you unpause it. In order to fix that you have to change the ability duration to 0.01 (Don't use 0 because that will make the effect permanent)
 

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,866
Try to avoid using Pause. Use a Dummy unit and order it to Stun your Hero after casting the spell.
  • Ice Block
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Ice Block
    • Actions
      • Set VariableSet TempPoint = (Position of (Triggering unit))
      • Unit - Create 1 Dummy for (Triggering player) at TempPoint facing Default building facing degrees
      • Unit - Add Ice Block Stun to (Last created unit)
      • Unit - Order (Last created unit) to Human Mountain King - Storm Bolt (Triggering unit)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Custom script: call RemoveLocation (udg_TempPoint)
      • Wait 0.00 seconds
      • Unit - Add Invulnerable (Neutral) to (Triggering unit)
      • Wait 10.00 seconds
      • Unit - Remove Invulnerable (Neutral) from (Triggering unit)
 

Attachments

  • Ice Block Example.w3m
    18.7 KB · Views: 8
Status
Not open for further replies.
Top