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

[Spell] Can anyone tell me if this is MUI?

Status
Not open for further replies.
Level 3
Joined
Sep 9, 2009
Messages
658
  • Hammer of Wrath
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Hammer of Wrath
    • Actions
      • Custom script: local unit udg_Unit
      • Custom script: local unit udg_Target
      • Custom script: local real udg_Damage
      • Set Unit = (Triggering unit)
      • Set Target = (Target unit of ability being cast)
      • Set Damage = (25.00 + ((Real((Level of Hammer of Wrath for Unit))) x 125.00))
      • Special Effect - Create a special effect attached to the origin of Target using Judgment of Light.mdx
      • Special Effect - Destroy (Last created special effect)
      • Wait 1.00 seconds
      • Set Location = (Position of Target)
      • Unit - Create 1 Dummy for (Owner of Unit) at Location facing Default building facing degrees
      • Unit - Add Hammer of Wrath (Stun) to (Last created unit)
      • Unit - Set level of Hammer of Wrath (Stun) for (Last created unit) to (Level of Hammer of Wrath for Unit)
      • Unit - Order (Last created unit) to Neutral - Firebolt Target
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Cause Unit to damage Target, dealing Damage damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_Location)
I tested this a few times but I just want to make sure. I need to know if this is MUI and if there are any leaks regarding the first three custom scripts.
 
Level 7
Joined
Jan 30, 2011
Messages
267
beside that it could be useful to use a unit recycle system, because units leak a very little bit (even if they get removed properly)
if that spell is being used really really often (several thousand times maybe) in 1 game, then it could cause lags in the end
 
Level 25
Joined
Jul 10, 2006
Messages
3,315
beside that it could be useful to use a unit recycle system, because units leak a very little bit (even if they get removed properly)
if that spell is being used really really often (several thousand times maybe) in 1 game, then it could cause lags in the end

Good point.

A common method around this is to create 1 dummy unit at map initialization, and use it for everything. If its cast point and backswing points are both 0.000, and the spells you cast with it have 0 cooldown and casting time, you can use the same dummy to cast any number of spells "instantly".

To move it into position, use
  • Custom script: call SetUnitX(udg_dummy, udg_x)
  • Custom script: call SetUnitY(udg_dummy, udg_y)
 
Level 3
Joined
Sep 9, 2009
Messages
658
Oh so what you guys are saying is that, at the very start I place a dummy unit in any part of my map and it'll just get teleported to where it's needed?

And for that issue, I suppose it could be fixed by removing the wait, but then the damage will be done before the sfx finishes. And that's the only reason I even triggered this spell instead of basing it off storm bolt in the first place :ogre_haosis:
 
Level 7
Joined
Jan 30, 2011
Messages
267
i dont think 1 dummy is enough
if you do:
-create dummy
-order spell
-remove dummy
without any waits inbetween, then nothing should happen (didnt test though)

EDIT: did a short test
when u remove the unit right after giving the order then nothing happens
if you just move the unit somewhere else then it seems to work sometimes and sometimes not
a 0 second wait after giving the order fixes it, of course
 
Level 21
Joined
Mar 27, 2012
Messages
3,232
i dont think 1 dummy is enough
if you do:
-create dummy
-order spell
-remove dummy
without any waits inbetween, then nothing should happen (didnt test though)

EDIT: did a short test
when u remove the unit right after giving the order then nothing happens
if you just move the unit somewhere else then it seems to work sometimes and sometimes not
a 0 second wait after giving the order fixes it, of course
*Waits are never shorter than 0.27 seconds. Elseway yeah.
 
Status
Not open for further replies.
Top