• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

My spell-based attack system is stuffed :(

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
I made a spell based attack system for my map. You use it, then it replaces the ability with a dummy saying that it's cooling down, then it waits cooldown[player number of owner of (casting unit)] and replaces the dummy with the real ability, then you're ready to go again :D

the problem is, it only works for red. When any other players use it they get stuck in the cooldown and dont come out.

i wrote this at 11:00 at night so the trigger might not be an exact replica, but there arent any problems with the triggering as far as i can see :p

  • Event:
  • A unit starts the effect of an ability
  • Conditions:
  • Ability being cast equal to attack
  • Actions:
  • Set Temppoint1[player number of (owner of(casting unit) = position of casting unit
  • Set Temppoint2[player number of (owner of(casting unit) = position of casting unit
  • sets unit groups, damages them, makes floating text etc.
  • remove leaks
  • Unit - add Attack cooldown to (casting unit)
  • Unit - remove Attack from (casting unit)
  • Wait (cooldown[player number of(owner of(casting unit))] seconds
  • Unit - remove Attack cooldown from (casting unit)
  • Unit - add Attack to (casting unit)
thanks for any help :cool:
 
Level 21
Joined
Aug 9, 2006
Messages
2,384
I made one, here:


View attachment Attack.w3x

I hope it helps you, it is a spell based attack system, it might give you an idea.

And the problem with your stuff is: casting unit vanishes after a short wait, it is just a temporary save for the casting unit, I would recommend a array of units saving the attacking units and emulating the cooldown with a array of integers or reals which count down the cooldown.

And just as a information: use indexing and such for a MUI solution.
 
Status
Not open for further replies.
Top