• 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.
  • 💡 We're thrilled to announce that our upcoming texturing contest is in the works, and we're eager to hear your suggestions! Please take this opportunity to share your ideas in this theme discussion thread for the Texturing Contest #34!
  • 🏆 Hive's 7th HD Modeling Contest: Icecrown Creature is now open! The frozen wastes of Icecrown are home to some of Azeroth’s most terrifying and resilient creatures. For this contest, your challenge is to design and model a HD 3D monster that embodies the cold, undead, and sinister essence of Icecrown! 📅 Submissions close on April 13, 2025. Don't miss this opportunity to let your creativity shine! Enter now and show us your frozen masterpiece! 🔗 Click here to enter!

[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?
 
Level 15
Joined
Nov 30, 2007
Messages
1,202
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
 

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,233
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)
 
Level 37
Joined
Mar 6, 2006
Messages
9,243
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
 
Level 33
Joined
Mar 27, 2008
Messages
8,035
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
 
Level 2
Joined
Aug 6, 2012
Messages
27
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.
Top