Hi!
My goal is to conquer (change ownership) an enemy building by getting close to it (lets say range 600) and remaining there for a while.But pause the effect when an other unit (non-structure ,controlled by owner of the building) is also in range and reset when no units of the conqueror player left in range.
When a third enemy unit appears make sure that when time expires give the building to the conqueror who was there first.
Different buildings take different time to conquer and there are a few types that cant be conquered.
It also would be nice to show both players somehow how the conquering goes, but its not as important as allowing multiple conquerings at the same time for every player.(so when there are 4 buildings in range, start conquering all of them)
Every non structure unit on the map that is controlled by user can conquer.
I think it sounds like a challenge.
If someone could do a system like this for me i'd give special thanks and +rep.And it would be useful for others as well because it is more elegant and also a little bit different than the old "HP is below amount change ownership to owner of attacking unit" solution. If you want to take something chase the owner away if you want to keep it arrive in time and chase the attackers away. Pretty realistic isnt it?
I couldnt do this but of course I tried, and maybe only a little scripting knowledge stands between me and the solution so here is what i've done so far:
I gave mana to buildings and set mana regen -1/sec by trigger. I gave all units 2 types of brilliance aura. -1mana for all own structures in range 600 and +2mana for all enemy structures in range 600 and a 'conquer' named buff for the second aura.
Then here is a trigger which supposed to change the ownership when the buildings mana becomes 100% :
Conquer is the buff the conquerors aura has, and maxmana 0009 is just a unit that always has 100%mana.
As you see i cannot describe who supposed to get the building, not to mention the third player problem. Everything else is solved this way.
My goal is to conquer (change ownership) an enemy building by getting close to it (lets say range 600) and remaining there for a while.But pause the effect when an other unit (non-structure ,controlled by owner of the building) is also in range and reset when no units of the conqueror player left in range.
When a third enemy unit appears make sure that when time expires give the building to the conqueror who was there first.
Different buildings take different time to conquer and there are a few types that cant be conquered.
It also would be nice to show both players somehow how the conquering goes, but its not as important as allowing multiple conquerings at the same time for every player.(so when there are 4 buildings in range, start conquering all of them)
Every non structure unit on the map that is controlled by user can conquer.
I think it sounds like a challenge.
If someone could do a system like this for me i'd give special thanks and +rep.And it would be useful for others as well because it is more elegant and also a little bit different than the old "HP is below amount change ownership to owner of attacking unit" solution. If you want to take something chase the owner away if you want to keep it arrive in time and chase the attackers away. Pretty realistic isnt it?
I couldnt do this but of course I tried, and maybe only a little scripting knowledge stands between me and the solution so here is what i've done so far:
I gave mana to buildings and set mana regen -1/sec by trigger. I gave all units 2 types of brilliance aura. -1mana for all own structures in range 600 and +2mana for all enemy structures in range 600 and a 'conquer' named buff for the second aura.
Then here is a trigger which supposed to change the ownership when the buildings mana becomes 100% :
Trigger:
- Untitled Trigger 001
- Events
- Unit - A unit Starts the effect of an ability
- Conditions
- ((Triggering unit) has buff Conquer ) Equal to True
- Actions
- Wait until ((Percentage mana of (Triggering unit)) Equal to (Percentage mana of maxmana 0009 <gen>)), checking every 1.00 seconds
- Unit - Change ownership of (Triggering unit) to (Owner of (????? unit)) and Change color
- Unit - Set mana of (Triggering unit) to 0.00
- Events
Conquer is the buff the conquerors aura has, and maxmana 0009 is just a unit that always has 100%mana.
As you see i cannot describe who supposed to get the building, not to mention the third player problem. Everything else is solved this way.