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

[Solved] Goblin landmines - target self, but get exp

Status
Not open for further replies.
Level 25
Joined
Mar 29, 2020
Messages
1,465
hey there,

I'm making a spell where i'd like to have the hero set goblin landmines that the triggering player can't see, and that will target and harm his units, but when they kill enemy units he should still get the experience. any way to do that?
 

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,386
Try triggering the creation/detonation of the mines.

How you could do it:
1) Create a custom landmine ability that targets a Point.
2) When you cast the spell, create a custom hostile-owned mine at the Point that has X attack range, X being the "Detonation Radius".
3) Link the Casting Player to the Mine using a Unit Indexer. (Player variable)
4) Then create a new Trigger with the Event "A unit is attacked", and check if it's the mine that's attacking.
5) If it is, change the owner of the mine to the Casting Player (reference the Player variable we made earlier)
6) Then pick every unit within X range of the mine, X being the "Explosion AoE", and have the mine damage the picked units.
7) Finally, kill the mine.

This should result in an invisible mine that damages everything around it, friend or foe. It'll also reward exp/bounty to the creator of the mine upon killing enemies.
 
Last edited:

Uncle

Warcraft Moderator
Level 70
Joined
Aug 10, 2018
Messages
7,386
It's just a neutral hostile unit that autoattacks nearby enemies. It doesn't have any of the old landmine functionality.

If you don't kill the mine it will sit there attacking things forever.

Also, you may want to adjust it's attack so it launches it's attack immediately (you could toy around with this), but make the damage point have a delay, this way it's destroyed before it's attack ever finishes.

This will result in the attacked unit never getting hit by the autoattack but still setting off the "A unit is attacked" event.

It's essentially an invisible, neutral hostile-owned Serpent Ward, that is triggered to explode when it attacks an enemy.
 
Last edited:
Status
Not open for further replies.
Top