• 🏆 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!

Gaze of Medusa Spell v1.2

This bundle is marked as pending. It has not been reviewed by a staff member yet.
  • Like
Reactions: IRoILaurentiu
Turn enemies into stone. They will stay still forever... or until Medusa decide to break those statues because she dont like their look anymore.

Based on Charm with simple trigger to do the magic.

Updated to v1.2
v. 1.2
- removed variable - it was not needed in the end
- turning enemy to stone grants small amount of XP based on targets level
- spell can not target neutrals (so you will not waste mana on already petrified units). You may change it in object editor.
- fixed name change

v. 1.1
- statues now become buildings, so you can see them trough FoV
- statues have their defense changed to Fortified and armor to Stone so they will sound properly when attacked
- added some more victims to test on
- nerfed Medusas attack, so she will not kill creeps with arrows
- units turned to stone are renamed to "Petrified (unit name)"
- changed visual effect to something more reasonable
- modified trigger to be safer for multiplayer instances
Contents

Gaze of Medusa Spell (Map)

Level 4
Joined
Feb 3, 2020
Messages
25
Thanks for comment. Dynamic indexing seems like overengineering to me, since this is targeted spell with (almost) instant effect. Wait is there to prevent original Charm spell effect to mess with trigger and Dynamic indexing would not help that.

Anyway, I have changed it to be staticaly indexed (instanced in array indexed by casting unit owning player) so it should be pretty much safe for multiplayer now.

Also, I have tweaked some effects and made statues to act more like statues.
 
Level 39
Joined
Feb 27, 2007
Messages
4,989
The spell can still fail if you group-cast the ability with multiple units or are extremely fast casting it an additional time during the wait. Waits have a minimum duration of ~0.27s so that will not be a 0.01. For that matter you could put a 0 wait and it would be the same duration. There are a few options I would recommend:
  • Don’t base the spell on Charm. Base it on Channel or something else, then you don’t have to worry about this and use the wait.
  • Use a locally shadowed global to store the unit during the wait: local udg_
  • Use a simple but clever GUI wait indexing method with 2 counter variables:
  • Set C1 = C1 + 1
  • Set UnitArray[C1] = the unit
  • Wait 0.00 seconds
  • Set C2 = C2 + 1
  • Unit - Kill UnitArray[C2]
  • If (All conditions are true) then do (Actions) else (Actions)
    • If - Conditions
      • C1 equal to C2
    • Then - Actions
      • Set C1 = 0
      • Set C2 = 0
    • Else - Actions
 
Level 4
Joined
Feb 3, 2020
Messages
25
The spell can still fail if you group-cast the ability with multiple units or are extremely fast casting it an additional time during the wait. Waits have a minimum duration of ~0.27s so that will not be a 0.01. For that matter you could put a 0 wait and it would be the same duration. There are a few options I would recommend:
  • Don’t base the spell on Charm. Base it on Channel or something else, then you don’t have to worry about this and use the wait.
  • Use a locally shadowed global to store the unit during the wait: local udg_
  • Use a simple but clever GUI wait indexing method with 2 counter variables:
  • Set C1 = C1 + 1
  • Set UnitArray[C1] = the unit
  • Wait 0.00 seconds
  • Set C2 = C2 + 1
  • Unit - Kill UnitArray[C2]
  • If (All conditions are true) then do (Actions) else (Actions)
    • If - Conditions
      • C1 equal to C2
    • Then - Actions
      • Set C1 = 0
      • Set C2 = 0
    • Else - Actions

Local variables seems like best solution to me right now. Thanks for that idea!

About different base spell - is there something else than Charm and Hex what limits casting by level of target? Because this is what I see as key feature.
 
Top