Sell System

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

Moderator: Cheaters

Bartimaeus²

Sell System

Post by Bartimaeus² »

Well, I wanted to be a sell system for my buildings, you know? Well, here goes what I got already -

Untitled Trigger 001
Events
Unit - A unit owned by Player 1 (Red) Finishes casting an ability
Conditions
(Ability being cast) Equal to Sell
Actions

What should I put for actions? Is there anyway to make it so I don't have to do a trigger for each building? Or must I? I'd rather save lots of GUI and leaks than have them, including doing it for every single building.
User avatar
trb92
Senior Member
Posts: 132
Joined: February 20th, 2007, 8:40 pm
Title: Random Noob
Location: Canada!!!

Re: Sell System

Post by trb92 »

I'm doing this on the assumption that you mean for like selling a tower in a TD, ignore this if that assumption is wrong.

First, change the Stats - Point Value field in the unit that you are selling to the amount of gold you should gain when you sell it. Then, make this trigger:

Code: Select all

Untitled Trigger 001
    Events
        Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Sell
    Actions
        Player - Add (Point-value of (Casting unit)) to Player 1 (Red) Current gold
        Unit - Remove (Casting unit) from the game
If you knew a woman who was pregnant, who had 8 kids already,
three who were deaf, two who were blind, one mentally retarded, and she had syphilis; would you recommend that she have an abortion?

Answer:
Spoiler:
If you said yes, you just killed Beethoven...
Bartimaeus²

Re: Sell System

Post by Bartimaeus² »

trb92 wrote:I'm doing this on the assumption that you mean for like selling a tower in a TD, ignore this if that assumption is wrong.

First, change the Stats - Point Value field in the unit that you are selling to the amount of gold you should gain when you sell it. Then, make this trigger:

Code: Select all

Untitled Trigger 001
    Events
        Unit - A unit owned by Player 1 (Red) Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Sell
    Actions
        Player - Add (Point-value of (Casting unit)) to Player 1 (Red) Current gold
        Unit - Remove (Casting unit) from the game


Yeah, thanks mate, I had someone tell me this on thehive, and they said the same exact thing.
User avatar
backspaceoneone
Junior Member
Posts: 44
Joined: July 21st, 2007, 7:31 am

Re: Sell System

Post by backspaceoneone »

This topic is a bit old. But why don't you try something like this:

Code: Select all

Sell
    Events
        Unit - A unit owned by Player 1 (Red) Begins casting an ability
    Conditions
        (Ability being cast) Equal to Sell
    Actions
        Set TempReal = ((Life of (Triggering unit)) / (Max life of (Triggering unit)))
        Set TempReal = (TempReal x (Real(((Point-value of (Triggering unit)) + 0))))
        Unit - Remove (Triggering unit) from the game
        Unit - Remove (Casting unit) from the game
        Set TempInt = (Integer(TempReal))
        Player - Add TempInt to (Owner of (Triggering unit)) Current gold
        Set PlayerEquityPlayerNumberInt = (Player number of (Owner of (Triggering unit)))
        Set PlayerEquityTempChange = ((Point-value of (Triggering unit)) - TempInt)
        Set PlayerEquityTempChange = (PlayerEquityTempChange x -1)
        Floating Text - Create floating text that reads ((Name of (Triggering player)) + (|c00c7bb76 +|r|c00004080 + ((String(TempInt)) + (Externalized string(|r |c00c7bb76gold|r))))) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
        Floating Text - Set the velocity of (Last created floating text) to 64.00 towards 90.00 degrees
        Floating Text - Change (Last created floating text): Disable permanence
        Floating Text - Change the lifespan of (Last created floating text) to 3.50 seconds
        Floating Text - Change the fading age of (Last created floating text) to 1.50 seconds