• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

[Spell] need help with a summoning spell

Status
Not open for further replies.
Level 2
Joined
Aug 6, 2012
Messages
27
Hey guys I recently created a skill such that:

- My hero summons a monster
- If each one of two die, the another will die together

( this skill works like the skill of Hero Meepo in DotA )

I've tried to deal with but still unsuccessful

Can anyone help me?
 
Dont forget to add the original unit at start and everytime it revives to meepoGroup.

  • Untitled Trigger 001
    • Events
      • Unit - A unit Spawns a summoned unit
    • Conditions
    • Actions
      • Set tempUnit = (Summoned unit)
      • Unit Group - Add tempUnit to meepoGroup
      • Set tempUnit = No unit
  • Untitled Trigger 002
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in meepoGroup and do (Actions)
        • Loop - Actions
          • Set tempUnit = (Picked unit)
          • Unit - Kill tempUnit
      • Set tempUnit = No unit
 
id use a hashtable for that.

  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_hash = InitHashtable()
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Bear
    • Actions
      • Set loc = (Position of (Triggering unit))
      • Unit - Create 1 Bear (Level 1) for Player 1 (Red) at loc facing Default building facing degrees
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(GetTriggerUnit()), 1, GetTriggerUnit())
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(GetTriggerUnit()), 2, bj_lastCreatedUnit)
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(bj_lastCreatedUnit), 1, bj_lastCreatedUnit)
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(bj_lastCreatedUnit), 2, bj_lastCreatedUnit)
      • Custom script: call RemoveLocation(udg_loc)
  • Untitled Trigger 003
    • Events
      • Unit - A unit Dies
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Bear (Level 1)
          • (Unit-type of (Triggering unit)) Equal to Mountain King
    • Actions
      • Custom script: call KillUnit(LoadUnitHandle(udg_hash, GetHandleId(GetTriggerUnit()), 1)
      • Custom script: call KillUnit(LoadUnitHandle(udg_hash, GetHandleId(GetTriggerUnit()), 2)
 
I improved Chaosy's triggers a bit.
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_hash = InitHashtable()
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Bear
    • Actions
      • Set loc = (Position of (Triggering unit))
      • Unit - Create 1 Bear (Level 1) for Player 1 (Red) at loc facing Default building facing degrees
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(GetTriggerUnit()), 0, bj_lastCreatedUnit)
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(bj_lastCreatedUnit), 0, GetTriggerUnit())
      • Custom script: call RemoveLocation(udg_loc)
  • Untitled Trigger 003
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Custom script: if HaveSavedHandle(udg_hash, GetHandleId(GetTriggerUnit()), 0) then
      • Custom script: call KillUnit(LoadUnitHandle(udg_hash, GetHandleId(GetTriggerUnit()), 0)
      • Custom script: endif
 
I improved Maker's triggers a bit.
  • Untitled Trigger 001
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: set udg_hash = InitHashtable()
  • Untitled Trigger 002
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Bear
    • Actions
      • Set Caster = (Triggering unit)
      • Set loc = (Position of Caster)
      • Unit - Create 1 Bear (Level 1) for (Triggering player) at loc facing Default building facing degrees
      • Set Summon = (Last created unit)
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(udg_Caster), 0, udg_Summon)
      • Custom script: call SaveUnitHandle(udg_hash, GetHandleId(udg_Summon), 0, udg_Caster)
      • Custom script: call RemoveLocation(udg_loc)
  • Untitled Trigger 003
    • Events
      • Unit - A unit Dies
    • Conditions
    • Actions
      • Set Caster = (Triggering unit)
      • Custom script: if HaveSavedHandle(udg_hash, GetHandleId(udg_Caster), 0) then
      • Custom script: call KillUnit(LoadUnitHandle(udg_hash, GetHandleId(udg_Caster), 0)
      • Custom script: endif
 
Waiting for someone wanting to improve defskull's trigger a bit ;))

I just try this one and see it is quite easy but still take effect :D

  • sea1
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Summon Sea Elemental
    • Actions
      • Set loc_1 = (Position of (Triggering unit))
      • Set waterOwner = (Triggering unit)
      • Unit - Create 1 Summoner for (Triggering player) at loc_1 facing Default building facing degrees
      • Set water = (Last created unit)
      • Unit Group - Add water to Group
      • Unit Group - Add waterOwner to Group
  • sea2
    • Events
      • Unit - A unit Dies
    • Conditions
      • ((Triggering unit) is in Group) Equal to True
    • Actions
      • Unit Group - Pick every unit in Group and do (Unit - Explode (Picked unit))
 
Status
Not open for further replies.
Back
Top