Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Nazgul Hero Spells (War of the Ring)

Discussion in 'Triggers & Scripts' started by HerrDave, Jan 4, 2019.

  1. HerrDave

    HerrDave

    Joined:
    Dec 23, 2013
    Messages:
    1,095
    Resources:
    165
    Models:
    137
    Icons:
    20
    Skins:
    8
    Resources:
    165
    Working on my War of the Ring map, I have found that I need a very, very specific hero spell.

    Green = Finished
    Red = Unfinished
    Orange = In-game skills I've tried to edit

    Nazgul Lord
    Dark Binding - Transforms specific unit into Black Rider permanently, max 8
    Shadow Walk - Teleports self and nearby Black Riders to specific building
    Aura of Weakness - Reduce enemy armour
    Wrath of the Nine - Stampede w/ spirits


    Dark Binding - I've tried using polymorph, but I can't get it to only target wraiths and transformed units cannot attack

    Dark Binding - I've tried editing Bear Form to be castable on targets, not one's self, but couldn't find the field


    Shadow Walk - I've tried editing Mass Teleport, but I cannot make it only affect certain units nor target the specific building

    Shadow Walk - I've experimented with Dark Summoning, but I can't reverse it to pull the caster and specific unit types around the caster to the specific building.
     
  2. Jake Kessler

    Jake Kessler

    Joined:
    Apr 4, 2010
    Messages:
    271
    Resources:
    5
    Maps:
    4
    Tutorials:
    1
    Resources:
    5
    Dark Binding: I suggest basing it on Dark Conversion (Mal'ganis ability from the Human campaign). Dark Conversion lets you set a target race, not a specific unit type, but you can make this work by making your target unit (Wraith?) a race that is otherwise unused, such as Demon or Commoner.
    Note that Dark Conversion puts the target unit to sleep for a short time before transforming them, but you can play with durations and buffs to make this look how you like.

    Shadow Walk: I recommend doing this with triggers, honestly.
    Make a targeted spell (based on anything really), give it extremely long range, and make it only able to target player-owned buildings. Then make a trigger as follows:
    (Events) A unit casts a spell
    (Conditions) Spell being cast equal to Shadow Walk
    (Actions) Pick all units of type Black Rider within some range of caster, Move picked unit instantly to position of target unit of spell being cast, Move casting unit instantly to position of target unit of spell being cast

    ^^^ Note to avoid memory leaks, use variables for the position of the caster, the position of the target, and the unit group of Black Riders near the caster. Then clean up those variables at the end of the trigger. See: Basic Memory Leaks

    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Shadow Walk
    • Actions
      • Set SWCasterLoc = (Position of (casting unit))
      • Set SWTargetLoc = (Position of (target unit of ability being cast))
      • Set SWGroup = (Units within 900.00 of SWCasterLoc matching (Unit type of matching unit = Black Rider))
      • Unit Group - Pick every unit in SWGroup and do (Actions)
        • Loop - Actions
          • Move Picked unit instantly to SWTargetLoc
      • Move (Casting unit) instantly to SWTargetLoc
      • Custom script: call DestroyGroup(udg_SWGroup)
      • Custom script: call RemoveLocation(udg_SWCasterLoc)
      • Custom script: call RemoveLocation(udg_SWTargetLoc)
     
    Last edited: Jan 4, 2019
  3. HerrDave

    HerrDave

    Joined:
    Dec 23, 2013
    Messages:
    1,095
    Resources:
    165
    Models:
    137
    Icons:
    20
    Skins:
    8
    Resources:
    165
    How do I set up those variables?

    I'm not terribly skilled with scripts..
     
  4. Jake Kessler

    Jake Kessler

    Joined:
    Apr 4, 2010
    Messages:
    271
    Resources:
    5
    Maps:
    4
    Tutorials:
    1
    Resources:
    5
    Inside the trigger editor:

    upload_2019-1-4_15-21-54.png
     
  5. xISLx

    xISLx

    Joined:
    Nov 7, 2014
    Messages:
    200
    Resources:
    0
    Resources:
    0
    Oh wow, I get a chance to help HerrDave
    So it's a spell that transforms one unit (of a specific unit type) into another?

    Let's imagine that night elven Druids of the Claw couldn't turn into Bears on their own, and that they would require a little bit of help from the outside
    • Dark Binding Cast
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Ability being cast) Equal to Dark Binding
        • (Unit-type of (Target unit of ability being cast)) Equal to Druid of the Claw (Night Elf Form)
      • Actions
        • Unit - Add Bear Form to (Target unit of ability being cast)
        • -------- ^ Make sure that they don't have that ability by default --------
        • Unit - Order (Target unit of ability being cast) to Night Elf Druid Of The Claw - Bear Form

    That's bassically all. It's the easiest and the fastest solution I could come up with :D
    There might be issues when, let's say, the targeted unit is silenced or stunned, or is unable to immediately cast the spell for any other reason
    You should also tick the "Permanent" morphing flag for the bear form ability in the Object Editor

    Also here's the trigger to stop the spell from having any effect on other units
    • Dark Binding Debugg
      • Events
        • Unit - A unit Begins casting an ability
      • Conditions
        • (Ability being cast) Equal to Dark Binding
        • (Unit-type of (Target unit of ability being cast)) Not equal to Druid of the Claw (Night Elf Form)
      • Actions
        • Unit - Order (Casting unit) to Stop
        • -------- insert error text here --------
        • Game - Display to (All players) the text: Lorem ipsum

    If you need more help or details, feel free to ask
    I'll be glad to help! :)
     
    Last edited: Jan 4, 2019