Help with: Sell trigger

For fulfilled maps that most likely don't work on the latest patch (1.24 or later).

Moderator: Cheaters

Panda-Assassin
Senior Member
Posts: 123
Joined: July 4th, 2009, 12:00 am
Title: Pandaren-Assassin

Help with: Sell trigger

Post by Panda-Assassin »

Can anyone tell me how I could make an ability that allows me to sell certain buildings??

Thank You in advance :D
Last edited by Panda-Assassin on July 9th, 2009, 5:36 am, edited 1 time in total.
"A unit of time is as precious as a unit of gold, but you cannot don't click me back one unit of time with one unit of gold."

Thanks for all the help Syre!
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: Help: Sell trigger

Post by Syre »

Taken from here.
Sellable Towers

Ever TD should have sellable towers, and towers should be sellable in a user friendly way.
Here's a trick from Ryoko that works great for selling towers.
1. Create a new ability called 'Sell Tower' based on the Windwalk ability.
2. Change all the values for your new Windwalk to zero. The casting cost, durations, cooldown, every value inside the ability.
3. Change the hotkey for the new ability to something unique. I like to use 'X'.
4. Change all the tool tips for the new ability, and icon. I like to use the treasure chest or gold icon.
5. Add the ability to all your towers.
6. Finally, create a trigger that looks like this. Any time a tower uses the 'Sell Tower' ability, a trigger will sell the tower for half its value, create a nice special effect above it, and destroy it. Note that it does not have to be half the value; it can be whatever you prefer.

Code: Select all

Sell Towers
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Sell Tower
    Actions
        Player - Add ((Point-value of (Casting unit)) / 2) to (Owner of (Casting unit)) Current gold
        Special Effect - Create a special effect at (Position of (Casting unit)) using ...
        Unit - Remove (Casting unit) from the game
By your previous topics, im guessing your making a tag map, so just change tower to building.
Image
Panda-Assassin
Senior Member
Posts: 123
Joined: July 4th, 2009, 12:00 am
Title: Pandaren-Assassin

Re: Help: Sell trigger

Post by Panda-Assassin »

Thank You :D and you guessed it. I am making a tag map but with some bits and pieces from other games.
"A unit of time is as precious as a unit of gold, but you cannot don't click me back one unit of time with one unit of gold."

Thanks for all the help Syre!