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

[Trigger] Werewolf transformation

Status
Not open for further replies.
Level 2
Joined
Dec 9, 2008
Messages
9
I'm trying to make a trigger that transforms a unit into a werewolf during the night:

  • Night2
    • Events
      • Game - The in-game time of day becomes Equal to 18.00
    • Conditions
    • Actions
      • Set BjarturNormalPoint = (Position of BjarturNormal)
      • Set BjarturWereWolfPoint = (Position of BjarturWereWolf)
      • Special Effect - Create a special effect at BjarturNormalPoint using Abilities\Spells\NightElf\BattleRoar\RoarCaster.mdl
      • Special Effect - Destroy (Last created special effect)
      • Unit - Change ownership of BjarturWereWolf to (Owner of BjarturNormal) and Change color
      • Unit - Change ownership of BjarturNormal to Neutral Passive and Change color
      • Unit - Move BjarturNormal instantly to BjarturWereWolfPoint
      • Unit - Move BjarturWereWolf instantly to BjarturNormalPoint
      • Hero - Set BjarturWereWolf experience to (Hero experience of BjarturNormal), Hide level-up graphics
      • Unit - Set level of Lycanthropy (Bjartur) for BjarturWereWolf to (Level of Lycanthropy (Bjartur) for BjarturNormal)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • AttributeLearned Equal to True
        • Then - Actions
          • Unit - Set level of Attribute Bonus for BjarturWereWolf to (Level of Attribute Bonus for BjarturNormal)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BiteLearned Equal to True
        • Then - Actions
          • Unit - Set level of Bite (Bjartur) for BjarturWereWolf to (Level of Bite (Bjartur) for BjarturNormal)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ReturnAtOnceLearned Equal to True
        • Then - Actions
          • Unit - Set level of Return at once (Bjartur) for BjarturWereWolf to (Level of Return at once (Bjartur) for BjarturNormal)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • JumpLearned Equal to True
        • Then - Actions
          • Unit - Set level of Jump (Bjartur) for BjarturWereWolf to (Level of Jump (Bjartur) for BjarturNormal)
        • Else - Actions
      • Unit - Create 1 Dummy (Locust) (All) for (Owner of BjarturWereWolf) at (Center of BjarturDummy <gen>) facing Default building facing degrees
      • Set BjarturDummyAura = (Last created unit)
      • Unit - Add Lycanthropy Dummy (Bjartur) to BjarturDummyAura
      • Unit - Set level of Lycanthropy Dummy (Bjartur) for BjarturDummyAura to (Level of Lycanthropy (Bjartur) for BjarturNormal)
      • Hero - Modify unspent skill points of BjarturWereWolf: Set to (Unspent skill points of BjarturNormal) points
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Give (Item carried by BjarturNormal in slot (Integer A)) to BjarturWereWolf
      • Unit - Set life of BjarturWereWolf to (Percentage life of BjarturNormal)%
      • Unit - Set mana of BjarturWereWolf to (Percentage mana of BjarturNormal)%
      • Selection - Select BjarturWereWolf for (Owner of BjarturWereWolf)
      • Custom script: call RemoveLocation(udg_BjarturNormalPoint)
      • Custom script: call RemoveLocation(udg_BjarturWereWolfPoint)
      • Trigger - Turn on Day2 <gen>
      • Trigger - Turn off (This trigger)
and a similar trigger for the day.

to add make the unit learn spells i have these triggers:

  • Learn Bite2
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Bite (Bjartur)
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Triggering unit) Equal to BjarturNormal
        • Then - Actions
          • Hero - Learn skill for BjarturWereWolf: Bite (Bjartur)
          • Set BiteLearned = True
          • Trigger - Turn off (This trigger)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Triggering unit) Equal to BjarturWereWolf
            • Then - Actions
              • Hero - Learn skill for BjarturNormal: Bite (Bjartur)
              • Set BiteLearned = True
              • Trigger - Turn off (This trigger)
            • Else - Actions
              • Do nothing
for each spell, but when the unit is supposed to transform it has only learned one of the spells i wanted it to learn (all the spell triggers are the same except for the different spells they teach).
 
Level 2
Joined
Mar 30, 2009
Messages
30
Unit - Set level of Lycanthropy (Bjartur) for BjarturWereWolf to (Level of Lycanthropy (Bjartur) for BjarturNormal) <-- This is using up your skill points ,store it to a var before switching

Hero - Modify unspent skill points of BjarturWereWolf: Set to (Unspent skill points of BjarturNormal) points <--you should put this to a var before switching. more simple and foolproof.


Edit: chain IF/THEN/ELSE
eg; If
-condition
Then
-Action
Else
-If
-Action


EtC

The sorrow
 
Level 2
Joined
Mar 30, 2009
Messages
30
You use action
Set Variable

You create variables in variable editor (when in trigger editor CTR+B)

The Sorrow
 
Level 11
Joined
Feb 16, 2009
Messages
760
You are really pushing this with hard triggers. Make a edit of the Chaos ability, it changes unit-type but transfers stats, location and skills. For the skills you can use a invisble unit called Night, and make that unit a Requirement for the skills. Then create it trough triggers at night
 
Status
Not open for further replies.
Top