• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Spell] Summon unit, drain mana over time trigger.

Status
Not open for further replies.
Level 7
Joined
Aug 30, 2013
Messages
96
(First, sorry for my english)
Hi, i need a help with creating spell, im not the best in making triggers so this is why im posting this thread.
So i have a unit with a spell "Summon Wolf" it drains mana over time, until 0, then summoned unit disappears. Caster is a normal mage unit, like Necromancer or Banshe, so there can be many Wolfs in the same time, but 1 caster can have only one wolf. If caster dies, the wolf will also die. And of course if wolf dies the mana will stop draining.

Can someone help me, and create this spell? I would be very grateful.
 
Level 19
Joined
Apr 21, 2013
Messages
1,194
You should check how to make a spell MUI. I cant send links cuz im on phone.

The main thing you should focus is;

1)Create the wolf where you want when the spell is cast.
2)Start a loop to trigger mana draining.
3)In the loop, check if the caster is alive and if the wolf is alive. If one of these conditions are met stop the loop.
 
Level 12
Joined
Jun 15, 2016
Messages
472
You can also use a custom Immolation ability to continually drain your mana, that way you will also have control whether to summon or unsummon the wolf, and you can have only one for each unit. It works with one unit, but I'm not sure about how to make it MUI, though...
 

Attachments

  • Wolf Summon.w3x
    17.4 KB · Views: 27
Level 39
Joined
Feb 27, 2007
Messages
5,013
Easiest solution would be adding in a unit indexer. Save the caster and wolf in separate unit arrays using each other's index as the array index. then you have 4 events you must detect:

  1. Immolate is cast (you might have to detect it by the immolate (could be immolateon) order, not spell cast event):

    create Wolf
    set Mage_Unit[index of created wolf] = caster
    set Wolf_Unit[index of caster] = created wolf
  2. Caster type unit dies, kill Wolf_Unit[index of caster]
  3. Wolf type unit dies, order Caster_Unit[index of dying wolf] to immolateoff (maybe unimmolate honestly I don't remember)
  4. Unit is ordered to immolateoff, if it has an associated wolf then remove it.
 
Level 11
Joined
Jun 2, 2004
Messages
849
Might need to do some extra things if Resurrection exists in the map. One could kill the wolf (to stop the mana drain) and then revive it, unless the wolf is set to not be resurrectable in the object editor.
 
Status
Not open for further replies.
Top