HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

The Golden Arrows - Using black arrow as a spell base

11-22-2004, 11:07 PM#1
YellowSubmarine
So, my hero has a custom skill called "Golden Arrows," which will work sort of like an auto-Transmute; if a unit struck by a golden arrow dies, it will burst into a pile of gold to be added to the golden-arrow-shooter's stockpile.

The problem is that the gold is to be based off of the unit's gold value, which should not be a problem, as I have WE Unlimited which has that as a feature.

However, I'm befuddled trying to figure out which Event to use for the spell. A Unit Dies doesn't work because the unit is removed from the game to create the dummy summoned unit. A Unit Is Attacked doesn't really accomplish what I would like it to. A Unit Spawns a Summoned Unit seems like the answer, but has no way of recognizing the unit that the golden arrow struck; thus, I could not get its gold value.

Any tips? Perhaps the use of two triggers, one that will get the unit being golded and the other that will get the event of its death? I hate to use arrays for variables that could be locals, but I suppose I can.

Help is appreciated!

EDIT: I just tried to use the "Starts/Channels/etc. an Ability" event(s) to detect the object of the ability. The problem is that this only works when the arrows are cast manually-- autocast arrows are ignored. Any way to solve that? Thanks!
11-23-2004, 01:06 AM#2
duckduck
you could do it sorta like immolation. when they use the ability to activate gold arrows, your replace that ability with a passive golden arrow, and make the unit lose mana whenever it attacks. also add another ability to turn it off

NOTE: Golden Arrows (1) = an ability like berserk without buff/art
NOTE: Golden Arrows (2) = critical strike with 0% chance of dealing extra damage
NOTE: Golden Arrows (3) = an ability like berserk without buff/art

Trigger 1
Code:
Events:
  A unit starts the affect of an ability
Conditions:
  Ability being cast Equal to Golden Arrows
Actions:
  Disable Golden Arrows (1) for Owner of casting unit
  Enable Golden Arrows (2) for Owner of casting unit
Trigger 2
Code:
Events:
  A unit is attacked
Conditions:
  And
    Level of Golden Arrows (2) Equal to 1
    Mana of HERO Greater than or equal 7
Actions:
   Set mana of HERO to HERO - 7
   wutever~~~~~~
Trigger 3
Code:
Events:
  A unit starts the effect of an ability
Conditions
  Ability being cast Equal to Golden Arrows (3)
Actions:
  Disable Golden Arrows (2) for owner of casting unit
  Enable Golden Arrows (1) for owner of casting unit
11-23-2004, 09:02 PM#3
YellowSubmarine
Thanks for the idea, but that's really not the way I wanted to implement it; if nothing else is possible, I'll consider it.
11-23-2004, 09:32 PM#4
duckduck
found another way (not sure if it works)

Code:
Events:
  Unit is issued an order
Conditions:
  Issued order = dark ranger activate black arrow (or whatever the base spell is)
Actions:
  Set (boolean variable) to true

Code:
Events:
  A unit is attacked
Conditions:
  And
    (boolean variable) = true
    mana of HERO is greater than or equal to 7
Actions:
  wutever~~~

Code:
Events:
  Unit is issued an order
Conditions:
  Issued order = dark ranger deactivate black arrow (or whatever the base spell is)
Actions:
  Set (boolean variable) to false

(you must have "mana of HERO is greater than or equal to x" because then even if the mana is 0, the ability will work if this is not in place)
11-23-2004, 09:42 PM#5
YellowSubmarine
I had already tried something similar to this, and it didn't work-- however, you inspired me to try again, and things are running smoothly.

Thank you, duckduck. I would give you rep, but I already gave you rep for some other reason and I need to "spread it around" before I can aid you again. I'll +rep you next time I get the chance.