Romek
Super Moderator
- Reaction score
- 963
Add Effect Z
By Romek
By Romek
Foreward:
I needed something like this in a spell I was making recently. I'm aware that there is something like this on wc3jass.com; in fact, this is based on that. However, this uses vJass' nice global blocks and libraries. So no nulling or bj_globals involved.
Feel free to take these out of the library, and put them into whatever you want. I also don't want or care about credit.
The non-location function is more efficient, so use that instead of the loc one when possible.
What does this do?
It allows users to create effects with a height (Z).
The Code:
JASS:
library EffectZ
// _________________________________________
// +-----------------------------------------+
// | E F F E C T Z |
// +-----------------------------------------+
// | - Feel free to take these out of this |
// | library and put them directly into |
// | your code. |
// | - I don't care about credit. I haven't |
// | even included my name here. :] |
// +-----------------------------------------+
// ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
globals
private destructable D
private effect E
endglobals
function AddSpecialEffectZ takes string modelName, real x, real y, real z returns effect
set D = CreateDestructableZ( 039;OTip039;, x, y, z, 0., 1., 0)
set E = AddSpecialEffect(modelName, x, y)
call RemoveDestructable(D)
return E
endfunction
function AddSpecialEffectLocZ takes string modelName, location where, real z returns effect
set D = CreateDestructableZ( 039;OTip039;, GetLocationX(where), GetLocationY(where), z, 0., 1., 0)
set E = AddSpecialEffectLoc(modelName, where)
call RemoveDestructable(D)
return E
endfunction
endlibrary
I don't think a demo map is needed.