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

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:
 
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