Unsummon Building for units

CBBPhoenix

New Member
Reaction score
1
Hey guys

I am working on a map where one of the Heroes should be able to "unsummon" their own units to gain ressources (like Undead's Unsummon Buildning in melee maps), but although I have set Targets Allowed to: Air, Ground, Non-Hero, Not Self, Player Units, it says ingame that I must target an Undead Buildning. Seems like some built-in Blizzard cruelty, but is there anything to do about it?

PS: I don't use JASS in my triggering of the map and I am pretty sure that I won't be able to use it.:(
 

oveRLuckEd

New Member
Reaction score
6
Trigger:
  • Melee Initialization
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to <Ability>
    • Actions
      • Unit - Kill (Target unit of ability being cast)
      • Player - Add (Integer((Random real number between 0.00 and 100.00))) to (Owner of (Casting unit)) Current gold

I don't know how to make it to add % of unit's price.
 

ZugZugZealot

New Member
Reaction score
33
Here's an example...

Trigger:
  • Refund w Items
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Unsummon Building
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Town Hall
            • Then - Actions
              • Player - Add -192 to (Triggering player) Current gold
              • Player - Add -102 to (Triggering player) Current lumber
              • Unit - Create 1 Footman for Player 1 (Red) at (Target point of ability being cast) facing (Random angle) degrees
            • Else - Actions
        • Else - Actions


"A unit Starts the effect of an ability" is typically better than "A unit Begins casting an ability". "A unit begins casting an ability" is something you'd want to do with SFX kind of things, but for actual application use "A unit Starts the effect of an ability" to prevent cancel exploiting.
 

oveRLuckEd

New Member
Reaction score
6
Here's an example...

Trigger:
  • Refund w Items
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Unsummon Building
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Target unit of ability being cast)) Equal to Town Hall
            • Then - Actions
              • Player - Add -192 to (Triggering player) Current gold
              • Player - Add -102 to (Triggering player) Current lumber
              • Unit - Create 1 Footman for Player 1 (Red) at (Target point of ability being cast) facing (Random angle) degrees
            • Else - Actions
        • Else - Actions


"A unit Starts the effect of an ability" is typically better than "A unit Begins casting an ability". "A unit begins casting an ability" is something you'd want to do with SFX kind of things, but for actual application use "A unit Starts the effect of an ability" to prevent cancel exploiting.

With this trigger he needs to make an action for every build which he wants to unsummon..
 

jackall

You can change this now in User CP.
Reaction score
37
yup... he said he needs to unsummon units not buildings
Trigger:
  • unsummon unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Unsummon Unit
    • Actions
      • Set unsummonTarget = (Target unit of ability being cast)
      • Set unsummonOwner = (Owner of unsummonTarget)
      • Player - Add (Point-value of unsummonTarget) to unsummonOwner Current gold
      • Floating Text - Create floating text that reads (|cffffcc00+ + ((String((Point-value of unsummonTarget))) + |r)) above unsummonTarget with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Unit - Hide unsummonTarget
      • Unit - Remove unsummonTarget from the game

unsummonTarget is a unit variable
unsummonOwner is a player variable
i suggest you base the ability off bloodlust as you can cast it on allies
dont forget to change the point value of ALL your units so that you dont get 100 for each and every unsummon
 

oveRLuckEd

New Member
Reaction score
6
Trigger:
  • Map Initialization
    • Events
      • Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell Tower
    • Actions
      • Player - Add (Point-value of (Target unit of ability being cast)) to (Owner of (Casting unit)) Current gold
      • Set Point = (Position of (Target unit of ability being cast))
      • Unit - Remove (Target unit of ability being cast) from the game
      • Special Effect - Create a special effect at Point using UI\Feedback\GoldCredit\GoldCredit.mdl
      • Special Effect - Destroy (Last created special effect)
      • Custom script: call RemoveLocation( udg_Point )

You need only to change point value of each unit to gold which you want to be given when the unit is going to be unsummon
 

CBBPhoenix

New Member
Reaction score
1
Hmh ya it sounds useful with point values, but I am already using them for heroes to see if a hero is agi, str and int based, but as it should only be cast on units there should be no problems. However; I would like for the ability to give more % gold as it reaches higher levels. Is that possible at all? Thanks for the help so far :D and thanks in advance.
 

jackall

You can change this now in User CP.
Reaction score
37
Trigger:
  • sell unit
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sell Unit
    • Actions
      • Set unsummonTarget = (Target unit of ability being cast)
      • Set unsummonOwner = (Owner of unsummonTarget)
      • Set unsummonValue = ((Point-value of unsummonTarget) x (Level of Sell Unit for (Triggering unit)))
      • Player - Add unsummonValue to (Owner of (Triggering unit)) Current gold
      • Floating Text - Create floating text that reads (|cffffcc00+ + ((String(unsummonValue)) + |r)) above unsummonTarget with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
      • Floating Text - Change the lifespan of (Last created floating text) to 2.00 seconds
      • Unit - Hide unsummonTarget
      • Unit - Remove unsummonTarget from the game

this gives the point value of your unit X level of ability
unsummonValue is an integer variable
 

CBBPhoenix

New Member
Reaction score
1
Ah yes, that's the Arithmetic function right? I think that solves everything thank you. But I was wondering in general when using the "A unit starts the effect of an ability" does it refer to the unit casting the ability (here: the Hero) or the target (the unit to be unsummoned)? To me it seems as it refers to the Hero according to your trigger. Going to try the trigger :p thanks

Came to think of something. This ability I am requesting could just be made from Transmute... But luckily my hero already has that ability to use on enemies so I guess this is fine to avoid cooldown overrides...
 

jackall

You can change this now in User CP.
Reaction score
37
the event does refer to the casting hero aswell as these events:
Trigger:
  • Unit - A Unit Starts casting an ability
    • Unit - A Unit Finishes casting an ability
    • Unit - A Unit Starts channeling an ability
and so on
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top