• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Spell Help?

Status
Not open for further replies.
Level 8
Joined
Sep 9, 2007
Messages
114
Turn Coat: Basically turns up to 10 random enemy units across the map level 5 and below. If you have the food to support it. If you don't have enough food for a particular chosen unit then the unit would just become hostile to everyone. Can this be done with GUI at all?

Angelic Wrath: When spawned somewhere on the map any unit who comes within X range of spawned unit will have its current health chopped in half.

I would also like to give an auto cast damaging spell to a unit with no attack. Is there anyway that can be done?

and Last but not least:
Vicious Roots: Picks 15 random units from each player and immobilizes them with entangling roots. Can this be done?

Any and All help on the Spells above would be MUCH appriciated!
Thanks in advance HWS Community!
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
Can this be done with GUI at all?
Sure it can, why not?

Basically, in pseudocode your trigger would look like this:
  • set agroup = every unit on the map
  • set counter = 0 (counter being an integer)
  • for aninteger = 1 to 3 do
    • set aunit = random unit from agroup
    • unit group - remove aunit from agroup
    • if (integer condition - level of unit) of aunit < 6 then
      • change ownership of aunit to (yourplayer)
      • if (integer condition - food used of player) of yourplayer > max food of yourplayer then
        • change ownership of aunit to (hostile)
      • set counter = counter + 1
      • if (counter = 10) OR (aunit = no unit) then
        • set aninteger = 3
      • else
        • set aninteger = 1
When angelic wrath is spawned, make a new trigger and add the event "unit comes within range of last created unit", and as actions: set HP of triggering unit = HP / 2

Don't think so, unless you use a spell like "curse" (autocast on enemies), with short cooldown, and make a trigger that damages the target of the custom spell.

vicious roots: definately has been done somewhere in the spells section. Basically loop through each player (for playergroup), create a unitgroup containing 15 random units of this player, then make a dummy unit cast entangling roots on every unit in this group.
 
Level 8
Joined
Sep 9, 2007
Messages
114
Turn Coat: I'm still rather confused by how your explaining it
Angelic Wrath: Problem: I can only set Unit comes within range of (No Unit) I can't set it to last created unit
Damage units without attack: Awesome! thanks ^_^
Vicious Roots: This would conflict with Angelic Wrath if they were cast close to the same time. but other than that thanks much ^_^
 
Last edited:
Level 13
Joined
Nov 4, 2006
Messages
1,239
use a variable for Angelic Wrath:
Unit comes within range of <variable>

and a second trigger which makes you unit being the variable
  • variable trigger
  • Event
    • Unit - unit enters playable map area
  • Action
    • set <variable> = last created unit
the first trigger will then only work for the variable unit
 
Level 9
Joined
Oct 17, 2007
Messages
547
Angelic Wrath: I think you need to make a periodic trigger that fire every X seconds. Then add every unit within Y range to a TempUnitGroup and then pick every unit in that group and halve the hp.

Turn Coat: After you create 10 units make a trigger that checks the player available food, if it under the amount of food that those unit take up then use the trigger change owner to neutral hostile.
 
Level 21
Joined
Aug 21, 2005
Messages
3,699
I'll comment it, k? Note that the indentations are helpful to see what subactions are "inside" which actions.

  • set agroup = every unit on the map // agroup is a unit group containing every unit on the map
  • set counter = 0 (counter being an integer)
  • for aninteger = 1 to 3 do // this is a FOR integer var loop from 1 to 3
    • set aunit = random unit from agroup // pick one of all units on map (in agroup)
    • unit group - remove aunit from agroup (remove the unit from agroup so it can't be picked again)
    • if (integer condition - level of unit) of aunit < 6 then
      • change ownership of aunit to (yourplayer) // if the level of the random unit is 5 or less, change it to you
      • if (integer condition - food used of player) of yourplayer > max food of yourplayer then
        • change ownership of aunit to (hostile) // if your food, after gaining the new unit, exceeds the max, change it to hostile.
      • set counter = counter + 1 // counter keeps track of the # of units changed ownership
      • if (counter = 10) OR (aunit = no unit) then
        • set aninteger = 3 // if 10 units changed ownership or you checked every unit on the map ==> set aninteger = 3, this will exit the for aninteger loop, thus stop doing all those actions over and over
      • else
        • set aninteger = 1 // else, you're not finished yet and need to loop again.
Angelic Wrath: Problem: I can only set Unit comes within range of (No Unit) I can't set it to last created unit
I mean use the ACTION: trigger - add to (damage trigger) the event: unit comes within 256 of (last created unit) everytime you create a unit of angelic wrath type. this action allows you to add events to a trigger on the fly, during game. Basically, the damagetrigger would have no events at all at the start, and as actions: set HP of the triggering unit = HP / 2. when a wrath is summoned, this trigger gains the event "unit comes within 256 of wrath", and thus will run if you want it to run.

Unit comes within range of <variable>
Can't be done. Noobmapmaker has a good alternative though.
 

Rui

Rui

Level 41
Joined
Jan 7, 2005
Messages
7,550
Spell problems go on the Spells and Systems forum.
[self="http://www.hiveworkshop.com/forums/forumdisplay.php?f=309"]
spellsandsystems.gif
»»» Spells and Systems
[/self]
Talk regarding custom created spells and systems takes place in here. Get help creating a spell or implementing a system etc.
Do NOT request for help or talk about spell-creation in the World Editor Help Zone. Spell-matters go on the Spells and Systems, which has it's link above.
~Thread Moved
 
Status
Not open for further replies.
Top