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

A complicated spell + a question regarding the data shown in Help

Status
Not open for further replies.

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Hey there!

I'm trying to do a spell that might get complicated. It is an instant ability (meaning, it activates as soon as you click the button, examples in WC3 would be War Stomp, Water Elemental or Berserk) that gives a hero a buff and, while the buff lasts, the hero will have a chance (let's say 20%) of moving (either instantly or with a sonic speed) to another target and attacking it (with no weapon cooldown between the killing blow and the attack on the new victim).

But I have another question about the Help guide. It's that guide that shows a race's units and what units they're good against or bad against. My question is: can we have them in two separate "sections", for example, can I have the Zealot in Protoss Units and Terran Units?

Thank you in advance, don't be afraid to post!
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,258
I'm trying to do a spell that might get complicated. It is an instant ability (meaning, it activates as soon as you click the button, examples in WC3 would be War Stomp, Water Elemental or Berserk) that gives a hero a buff and, while the buff lasts, the hero will have a chance (let's say 20%) of moving (either instantly or with a sonic speed) to another target and attacking it (with no weapon cooldown between the killing blow and the attack on the new victim).

Well it took me a many hours, a lot of blood and many drinks but I think I did something like what you want.

Say hello to...

Omni Berserk
Gives the unit a 50% that fatal blows will cause it to instantly teleport to a random enemy unit within a 10 unit area and cooldown its attack. Duration and cooldown are 10 seconds.

High chance and low cooldown is for proof of concept. Implimentation should probably give better cooldown ratio or lower chance. Note how the Dark Templar unit chain attacks.

The ability uses no triggers at all (only data). Comes complete with blink graphics and sound during teleports.

The mechanics of how it works... (This took me a while).
1. Give the caster a buff which runs 2 when damaging a unit.
2. When damaging a unit, give that unit a 1 second buff to detect when it dies (also runs the chance roll) which runs 3.
3. Run an area search for 1 random unit which is passed to 4 but only if the killing unit has the buff.
4. Teleport the killing unit (which has the ability in effect due to 3 filtering for it) to the random unit and give the killing unit the buff 5.
5. The buff gives the killing unit an insane attack rate (cooling its attack down near instantly) for 1 second or until it damages a unit which cases 6 to run.
6. Remove the buff in 5 from the unit restoring its attack to normal.

Took me a while to impliment as well. Had to learn what a few fields do which took offtopic experimentation. Eg, the Fatal damage flag in buff behaviours tests if the damage is fatal only to the owner of the buff so cannot be used to detect fatal blows when damaging another unit (but can if the unit damages itself).

Possible improvements are restricting the scope of the buff but that is largly implimentation specific.
 

Attachments

  • Omni Berserk.SC2Map
    25.9 KB · Views: 111
  • Like
Reactions: Rui
Status
Not open for further replies.
Top