HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

spell help

04-13-2010, 12:14 PM#1
icarus
Can anyone help me create two spells I'm working on, I've got stuck.

The first one, I'm trying make the ability knock the target back away from the caster.

The second one, I'm trying to knock a target up into the air (I tried adjust flying height but it didn't do anything, I presume because it's not a flying unit).

Any help would be much appreciated.

Thanks in advance

Icarus
04-13-2010, 07:02 PM#2
Anitarf
For the first spell, I recommend you take a look at Rising_Dusk's Knockback System; it should make the effect of your spell a simple matter of one function call.

For the second spell, the problem is indeed the fact that you are trying to do it on a ground unit. There is a workaround, though: the Warcraft III Ability Guide explains how (just search the tutorial for "Amrf").
04-13-2010, 09:38 PM#3
BuRnInSpartan
so you basically wanna copy the dota spells? Spirit breakers knockback and tidehunter or sandking or demon witch spells that spike the unit upward?
04-13-2010, 10:21 PM#4
Ammorth
Quote:
Originally Posted by BuRnInSpartan
so you basically wanna copy the dota spells? Spirit breakers knockback and tidehunter or sandking or demon witch spells that spike the unit upward?

More like, "so you basically wanna copy spells dota copied from the mapping community?"

Believe it or not, DotA was not the grand designer of everything wc3. Many of the ideas were taken from the community or from blizzard themselves (which isn't a bad thing).
04-14-2010, 02:03 AM#5
BuRnInSpartan
either way... is that what you wanted?
04-14-2010, 09:48 AM#6
icarus
no, in fact I'm doing a Naruto map, and the knockback is for Rasengan and the knock up thing is for Naruto Rendan and Shishi Rendan.

Never actually played DotA but I have heard that it's got some inventive abilities.

(and thanks Anitorf)

Icarus

EDIT: after reading the Knockback system... I've been working with GUI and I don't know JASS so I might have some problem converting the abilities to suit it, but I'll try.
04-14-2010, 10:57 AM#7
icarus
ummm, does the Raven Form thing have to be done with JASS too? cos' I did the GUI equivalent and it doesn't work?

(Sorry about all this, I'm still very much a n00b when it comes to triggering)
04-14-2010, 12:41 PM#8
Kueken
You just need to add the ability raven form, remove it again and after this you can alter the flying heigth. Everything easily doable in Gui.
04-14-2010, 04:19 PM#9
Ammorth
I believe the flight thing in GUI is under "Animations - Unit Flying Height" but a quick search would find it for you.

As Kueken said, you add the ability raven form ability (the one that morphs a medhiva to a crow) and remove it. The unit will not be a flying unit, but can now change its flying height.

The knockback system isn't too bad. Take a look at the test map and how it is used there. If after poking around you still can't figure it out, post here exactly what you don't know (providing examples is the best) and someone will help you.
04-14-2010, 04:54 PM#10
icarus
There is no raven form, I assume people mean crow form(which has the same order ID) but when I add and remove it, then set flying height, nothing happens.
04-14-2010, 05:34 PM#11
Kueken
Just tested it, it works as intended in Gui. Used trigger:
Trigger:
Unit - Add Crow Form to TempUnit
Unit - Remove Crow Form from TempUnit
Animation - Change TempUnit flying height to 256.00 at 0.00
and it flies.
Your problem lies elsewhere.
04-14-2010, 05:40 PM#12
icarus
ok, thanks, I guess I'll have to try and fathom this myself
04-14-2010, 06:13 PM#13
Anitarf
The only way for it not to work that I can think of is if you edited the crow form ability to morph into a non-flying unit (since that's the important part that makes this trick work, the ability has to morph the unit into a flying unit).
04-15-2010, 08:17 AM#14
Kueken
Or some sort of Ensnare/Entangle based abilities (sometimes they seem to be able to prevent unit fly height changes permanently)
05-10-2010, 03:29 AM#15
_too
I hope this is close enough. Untested ...but should work.
////////////////////////////////////////////
globals
gamecache GC=InitGameCache("GC.w3v")
endglobals
function h2i takes handle h returns integer
return h
return 0
endfunction
function i2u takes integer i returns unit
return i
return null
endfunction
function GetPolarX takes real x,real d,real a returns real
return x+d*Cos(a*3.14159/180)
endfunction
function GetPolarY takes real y,real d,real a returns real
return y+d*Sin(a*3.14159/180)
endfunction
function UnitTimedMove takes nothing returns nothing
local timer t=GetExpiredTimer()
local unit u=i2u(GetStoredInteger(GC,I2S(h2i(t)),"u"))
local real du=GetStoredReal(GC,I2S(h2i(t)),"du")
local real di=GetStoredReal(GC,I2S(h2i(t)),"di")
local real a=GetStoredReal(GC,I2S(h2i(t)),"a")
call SetUnitPosition(u,GetPolarX(GetUnitX(u),di,a),GetPolarY(GetUnitY(u),di,a))
call SetUnitFlyHeight(u,GetUnitFlyHeight(u)+10,1000)
if TimerGetElapsed(t)>=du then
call FlushStoredMission(GC,I2S(h2i(t)))
call DestroyTimer(t)
endif
set t=null
set u=null
endfunction
//call UnitAbilityBack(GetSpellTargetUnit(),Duration,Distance,Angle)
function UnitAbilityBack takes unit u,real du,real di,real a returns nothing
local timer t=CreateTimer()
call UnitAddAbility(u,'Amrf')
call UnitRemoveAbility(u,'Amrf')
call TimerStart(t,0.03,true,function UnitTimedMove)
call StoreInteger(GC,I2S(h2i(t)),"u",h2i(u))
call StoreReal(GC,I2S(h2i(t)),"du",du)
call StoreReal(GC,I2S(h2i(t)),"di",di/du*0.03)
call StoreReal(GC,I2S(h2i(t)),"a",a)
set t=null
endfunction
///////////////////////////