- Joined
- Dec 11, 2014
- Messages
- 665
I want to make it so when the unit is attacked it gets the "bloodlust" effect on it, making it move faster. The problem is I have no idea how to do it, any help would be appreciated
Well, that depends if the unit has an orb effect already.
1) If it doesn't, then the easiest method you can use would probably be Orb of Lightning (New).
1) The first step would be to find the ability. Orb of Light (New) is an item ability. Make a custom ability of it and change it to a unit/hero spell.
2) Make a custom ability of Bloodlust.
3) On the Orb of Lightning ability that you made, add the Bloodlust spell to the field "Data - Effect Ability"
4) Add the Orb of Lightning (New) spell to your unit, and adjust any other fields on the spell. (If you want the bloodlust affect to happen every time, then set the fields "Data - Chance to hit whatever" to 100. and set the damage bonus to 0 if you don't want bonus damage.
Also, you would have to make 1 or 2 triggers, depending on how many units have this ability.
If only one unit has it, then you can do this
Otherwise you have to add another small trigger
Attack Acquire
Events
Unit - YourUnit Acquires a target
Conditions
Actions
Unit - Order (Triggering unit) to Attack (Targeted unit)
The only problem with this is when there's TOO many units that you want to have the spell. I don't know the details, but having too many events on a trigger crashes the game or something.
Add Unit
Events
Unit - A unit enters (Playable map area)
Conditions
(Unit-type of (Triggering unit)) Equal to YourUnit
Actions
Trigger - Add to Attack Acquire <gen> the event (Unit - (Triggering unit) Acquires a target)
2) If your unit is using an orb effect already, then you would have to trigger it.
1) Create a dummy unit with a bloodlust ability
The main problem with doing it this way is that the unit can cancel its attack, but the trigger will still run, so a unit can be forever bloodlusted over and over again quickly.
Bloodlust
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacking unit)) Equal to YourUnit
Actions
Set Temp_P = (Position of (Triggering unit))
Unit - Create 1 Bloodlust Caster for (Owner of (Attacking unit)) at Temp_P facing Default building facing degrees
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Triggering unit)
Custom script: call RemoveLocation (udg_Temp_P)
3) The possibly last way would be to use a damage detection system. I don't have a way to show you the damage detection way at the moment, but if you want it, I can give it to you later.
Edit: I think I misread your problem, so #1 probably won't work for you. Just ignore that one. Sorry
Ok, I think I got you on this one.
This test map was sorta made in a rush, so it may or may not work right, and there could be useless junk like an extra folder.
Bloodlust
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacked unit)) Equal to Almighty Runner
Actions
Set Temp_Unit = (Attacked unit)
Set Bloodlust_Boolean = False
For each (Integer Bloodlust_Loop) from 1 to Bloodlust_Loop_Max, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Boolean Equal to False
Temp_Unit Equal to Bloodlust_C[Bloodlust_Loop]
Then - Actions
Set Bloodlust_Boolean = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Boolean Equal to True
Then - Actions
Set Temp_P = (Position of Temp_Unit)
Unit - Create 1 Bloodlust Caster for (Owner of Temp_Unit) at Temp_P facing Default building facing degrees
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust Temp_Unit
Set Bloodlust_Loop_Max = (Bloodlust_Loop_Max + 1)
Set Bloodlust_Timer[Bloodlust_Loop_Max] = 60.00
Set Bloodlust_C[Bloodlust_Loop_Max] = Temp_Unit
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Loop_Max Equal to 1
Then - Actions
Trigger - Turn on Bloodlust Timer <gen>
Else - Actions
Else - Actions
Bloodlust Timer
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
For each (Integer Bloodlust_Loop) from 1 to Bloodlust_Loop_Max, do (Actions)
Loop - Actions
Set Bloodlust_Timer[Bloodlust_Loop] = (Bloodlust_Timer[Bloodlust_Loop] - 0.05)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Timer[Bloodlust_Loop] Less than or equal to 0.00
Then - Actions
Set Bloodlust_C[Bloodlust_Loop] = Bloodlust_C[Bloodlust_Loop_Max]
Set Bloodlust_Timer[Bloodlust_Loop] = Bloodlust_Timer[Bloodlust_Loop_Max]
Set Bloodlust_Loop = (Bloodlust_Loop - 1)
Set Bloodlust_Loop_Max = (Bloodlust_Loop_Max - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Loop_Max Less than or equal to 0
Then - Actions
Trigger - Turn off Bloodlust Timer <gen>
Else - Actions
Else - Actions
Hmm. What I noticed is that from the start of the map the unit has "Endurance Aura" buff. And attacked there doesnt seem to be any difference. There is no sound or visual that tells you that the unit got the buff, not even the buff on it changes, it didn't get the bloodlust.
Hahaha, I knew I went wrong somewhere. When I first made this, I had less than 10 minutes (school lunch). Now I'm back at home and I already found all the problems you noticed.
In the first trigger, I set the wrong condition. It basically said "If the boolean is true, THEN DO actions. But it was suppose to be false to do the actions. There was a leak I forgot to clean, and the endurance aura buff is gone. I forgot to set it to no targets allowed.
Bloodlust
Events
Unit - A unit Is attacked
Conditions
(Unit-type of (Attacked unit)) Equal to Almighty Runner
Actions
Set Temp_Unit = (Attacked unit)
Set Bloodlust_Boolean = False
For each (Integer Bloodlust_Loop) from 1 to Bloodlust_Loop_Max, do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Boolean Equal to False
Temp_Unit Equal to Bloodlust_C[Bloodlust_Loop]
Then - Actions
Set Bloodlust_Boolean = True
Else - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Boolean Equal to False
Then - Actions
Set Temp_P = (Position of Temp_Unit)
Unit - Create 1 Bloodlust Caster for (Owner of Temp_Unit) at Temp_P facing Default building facing degrees
Unit - Add a 3.00 second Generic expiration timer to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust Temp_Unit
Set Bloodlust_Loop_Max = (Bloodlust_Loop_Max + 1)
Set Bloodlust_Timer[Bloodlust_Loop_Max] = 60.00
Set Bloodlust_C[Bloodlust_Loop_Max] = Temp_Unit
Custom script: call RemoveLocation (udg_Temp_P)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Loop_Max Equal to 1
Then - Actions
Trigger - Turn on Bloodlust Timer <gen>
Else - Actions
Else - Actions
Bloodlust Timer
Events
Time - Every 0.05 seconds of game time
Conditions
Actions
For each (Integer Bloodlust_Loop) from 1 to Bloodlust_Loop_Max, do (Actions)
Loop - Actions
Set Bloodlust_Timer[Bloodlust_Loop] = (Bloodlust_Timer[Bloodlust_Loop] - 0.05)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Timer[Bloodlust_Loop] Less than or equal to 0.00
Then - Actions
Set Bloodlust_C[Bloodlust_Loop] = Bloodlust_C[Bloodlust_Loop_Max]
Set Bloodlust_Timer[Bloodlust_Loop] = Bloodlust_Timer[Bloodlust_Loop_Max]
Set Bloodlust_Loop = (Bloodlust_Loop - 1)
Set Bloodlust_Loop_Max = (Bloodlust_Loop_Max - 1)
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
Bloodlust_Loop_Max Less than or equal to 0
Then - Actions
Trigger - Turn off Bloodlust Timer <gen>
Else - Actions
Else - Actions
The test map should be cleaner, and it should work now. If you want a cooldown to show for the 60 seconds, I think I could work that in if you want it.
Edit: Wow I'm off today. Wrong attachment added. The real test map should be call Bloodlust2.w3x
|
|
You should rather trigger it when the unit is damaged. Otherwise just the act of a catapult >1,000 units away beginning to attack (not even firing) will cause the unit to get bloodlust. It also allows you to trigger it off ability damage (unlike currently where abilities will not trigger it which could be exploited).
If the Ogre already is in the map or it will exist only once you can use this
Ogre Cast
Events
Unit - The Ogre 0001 <gen> Takes damage
Conditions
Actions
Trigger - Turn off (This trigger)
Set Ogre_Point = (Position of The Ogre 0001 <gen>)
Unit - Create 1 Dummy Unit for (Triggering player) at Ogre_Point facing Default building facing degrees
Unit - Add BloodLust to (Last created unit)
Unit - Order (Last created unit) to Orc Shaman - Bloodlust The Ogre 0001 <gen>
Countdown Timer - Start Ogre_Timer to expire in 60.00 seconds, as a One-shot timer, performing (Trigger - Turn on (This trigger)) upon expiration.
And you use this Ogre Cast in case the unit is not existing in the map already, BUT ONLY if you will produce ONE AND NO MORE OGRES
Ogre Appears
Events
Unit - A unit enters (Playable map area)
Conditions
(Unit-type of (Triggering unit)) Equal to The Ogre
Actions
Trigger - Turn off (This trigger)
Set The_Ogre = (Entering unit)
Trigger - Add to Ogre Cast <gen> the event (Unit - The_Ogre Takes damage)
Then you'll definetly gonna need this :C
http://www.hiveworkshop.com/forums/...a-231846/?prev=d=list&r=20&u=looking_for_help