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

Planting Spell

Status
Not open for further replies.
Level 1
Joined
Jun 8, 2008
Messages
3
I have already requested this in the Introduction place, but I'll go into more detail here. I want an ability where if I target a spot, it "plants" a plant, then the plant will grow with trigger I add later on. But I can only target a certain terrain type, which I chose to be Village Crops, because it is a "planting" spell for a farmer.
 
Level 24
Joined
May 9, 2007
Messages
3,563
Will upload spell in one sec.

  • Plant
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Plant
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain type at (Target point of ability being cast)) Equal to Village - Crops
        • Then - Actions
          • Unit - Create 1 Plant for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
        • Else - Actions
          • Unit - Set mana of (Triggering unit) to ((Mana of (Triggering unit)) + 50.00)
          • Unit - Remove Plant from (Triggering unit)
          • Unit - Add Plant to (Triggering unit)
          • Game - Display to (Player group((Owner of (Triggering unit)))) the text: You can't plant the...

Hope that this helps. Map is attached as well. To make better you could have many if/then/else or multiple triggers creating different kinds of plants depending on terrain. Set refunded mana to the mana cost of spell.

This is the attached map. Demonstrates trigger,
View attachment 29853

Edit: Could add temp points then null them.
 
Last edited:
Level 28
Joined
Mar 25, 2008
Messages
2,955
  • Plant
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Plant
  • Actions
    • Set tempunit = (Casting Unit)
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Terrain type at (Target point of ability being cast)) Equal to Village - Crops
      • Then - Actions
        • Set temppoint1 = (target point of ability being cast)
        • Unit - Create 1 Plant for (Owner of (tempunit)) at temppoint1 facing Default building facing degrees
        • Custom script: call RemoveLocation (udg_temppoint1)
      • Else - Actions
        • Unit - Set mana of tempunit to ((Mana of tempunit) + 50.00)
        • Unit - Remove Plant from tempunit
        • Unit - Add Plant to tempunit
        • Game - Display to (Player group((Owner of (tempunit)))) the text: You can't plant the...
Here we go ;)
 
Level 9
Joined
May 27, 2006
Messages
498
Squiggy, your "fixed" trigger still leaks one location. And you dont have to set the caster to a variable. Moreover, you dont have to use Casting Unit. Just use Triggering Unit and it'll do fine, being both leakless and MUI.
 
Level 1
Joined
Jun 8, 2008
Messages
3
THANK YOU GUYS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

:grin::grin::grin::grin::grin::grin::grin::grin::grin::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd::xxd:

I LOVE YOU GUYS ! NOW I CAN FINISH MY GAME!
 
Status
Not open for further replies.
Top