• 🏆 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!

[Trigger] Help with a transform spell!

Status
Not open for further replies.
  • Animagus
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Animagus
    • Actions
      • Set DogPoint = (Position of (Casting unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Harry's Godfather
        • Then - Actions
          • Unit - Remove (Casting unit) from the game
          • Unit - Create 1 Unit for (Owner of (Triggering unit)) at DogPoint facing (Facing of (Triggering unit)) degrees
          • Special Effect - Create a special effect at DogPoint using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Hero - Set (Last created unit) experience to (Hero experience of (Triggering unit)), Hide level-up graphics
          • Hero - Modify Strength of (Last created unit): Set to (Strength of (Triggering unit) (Exclude bonuses))
          • Hero - Modify Agility of (Last created unit): Set to (Agility of (Triggering unit) (Exclude bonuses))
          • Hero - Modify Intelligence of (Last created unit): Set to (Intelligence of (Triggering unit) (Exclude bonuses))
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Give (Item carried by (Triggering unit) in slot (Integer A)) to (Last created unit)
          • Unit - Set life of (Last created unit) to (Percentage life of (Triggering unit))%
          • Unit - Set mana of (Last created unit) to (Percentage mana of (Triggering unit))%
          • Selection - Select (Last created unit) for (Owner of (Triggering unit))
        • Else - Actions
          • Unit - Remove (Casting unit) from the game
          • Unit - Create 1 Unit for (Owner of (Triggering unit)) at DogPoint facing (Facing of (Triggering unit)) degrees
          • Special Effect - Create a special effect at DogPoint using Abilities\Spells\Human\FlakCannons\FlakTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Hero - Set (Last created unit) experience to (Hero experience of (Triggering unit)), Hide level-up graphics
          • Hero - Modify Strength of (Last created unit): Set to (Strength of (Triggering unit) (Exclude bonuses))
          • Hero - Modify Agility of (Last created unit): Set to (Agility of (Triggering unit) (Exclude bonuses))
          • Hero - Modify Intelligence of (Last created unit): Set to (Intelligence of (Triggering unit) (Exclude bonuses))
          • For each (Integer A) from 1 to 6, do (Actions)
            • Loop - Actions
              • Hero - Give (Item carried by (Triggering unit) in slot (Integer A)) to (Last created unit)
          • Unit - Set life of (Last created unit) to (Percentage life of (Triggering unit))%
          • Unit - Set mana of (Last created unit) to (Percentage mana of (Triggering unit))%
          • Selection - Select (Last created unit) for (Owner of (Triggering unit))
      • Custom script: call RemoveLocation (udg_DogPoint)

I need help with 2 things!

1: I want to save the abillities, so u doesn't need to choose them again when u transform back.

2: How to make this to fit with a passive abillity instead, so the hero transform into annother unit 22.00 and then transform back 02.00?

Pllz build up the spells for me, cause I am not the best in triggering ;)

Rep to all who help me!
 
Level 5
Joined
Aug 17, 2008
Messages
125
May I be so evul to ask u to make it to a Hero spell instead, I saw that u based a bit of the spell on that its a unit abillity. I need it for a ultimate spell. Then he cant have it from the beginning.

Thx!

just change what level he learns it in?
btw shift double click at what abilitys he learn or check hero ability? (if you shift double click you must write raw code)
 
Level 4
Joined
Feb 2, 2009
Messages
71
Just a tip.
The ReplaceUnit action does surprisingly much for you.
These are comments from the blizzard.j ReplaceUnit function:

// If we have bogus data, don't attempt the replace.
// Hide the original unit.
// Create the replacement unit.
// Set the unit's life and mana according to the requested method.
// Set the replacement's current/max life ratio to that of the old unit.
// If both units have mana, do the same for mana.
// Set the replacement's current life to that of the old unit.
// If the new unit has mana, do the same for mana.
// The newly created unit should already have default life and mana.
// Use max life and mana.
// Unrecognized unit state method - ignore the request.
// Mirror properties of the old unit onto the new unit.
// Pause the new unit if original unit is paused
// If both the old and new units are heroes, handle their hero info.
// Remove or kill the original unit. It is sometimes unsafe to remove
// hidden units, so kill the original unit if it was previously hidden.

Not very fast, but it's cuts down your code quite a bit.
 
Status
Not open for further replies.
Top