Ability cooldown reset IF it kills a unit. help

Exoudar

New Member
Reaction score
2
hi there,

I am trying to make my ability (firebolt) reset its cooldown if it kills a unit.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
i believe there is no way to reset ability cooldowns unless you reset all of them, and if im correct there is an action for it...
the problem is you will need a damage detection system :/
 

Exoudar

New Member
Reaction score
2
I can remove it and add it again to reset specific ability, but i want that to happen only if the ability land a killing blow (kills unit)
 

Dirac

22710180
Reaction score
147
Trigger the firebolt as a missile, on hit, if the unit is dead after it takes the damage, then re-add the ability
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
I made this, but it won't work the first time it's supposed to kill a unit. I forget how to get around that.
 

Attachments

  • Firebolt.w3x
    24.4 KB · Views: 286

Extes

Cool Member
Reaction score
5
Mind if I use this idea? I'm making an RPG and for one of the characters I wanted a similar ability. It'd be melee though.
 

Exoudar

New Member
Reaction score
2
I tried this and it works, the problem is when it is used against units with spell resistance(heroes for example)


Reseting Firebolt
Events
Unit - A unit Begins casting an ability
Conditions
(Ability being cast) Equal to Firebolt (Mage)
Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(Life of (Target unit of ability being cast)) Less than or equal to 50.00
Then - Actions
Set testunit = (Casting unit)
Wait 0.50 seconds
Unit - Remove Firebolt (Mage) from testunit
Unit - Add Firebolt (Mage) to testunit
Else - Actions


my firebolt does 50 damage, so it will reset when it hits units with 50 or less damage (assuming it kills them most of the time)

however spell resistance units will make a problem :(
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
What about the missile? If the unit teleports away while the missile is flying, the effect is preempted. Same goes for Immunity-granting abilities.
 

cleeezzz

The Undead Ranger.
Reaction score
268
easiest way to do it without triggering the fireball itself is probably:

you will need a unit indexing system, like AIDS [EDIT: nevermind, forgot about hashtables]

-Make firebolt a dummy spell (spell that does nothing)
-Detect unit casting firebolt
-Create a dummy to cast the real firebolt at the same target (a specific dummy, call it Firebolt Dummy or something)
-Set a variable (Unit array), example -> Caster[Custom value of (Dummy)] = Triggering Unit
-Make a new trigger with event, Firebolt Dummy kills a unit
-Remove Firebolt ability from Caster[Custom value of (Triggering Unit)]
-Add Firebolt ability to Caster[Custom value of (Triggering Unit)]

(Remember to give your dummies expiration time or remove them)
 

Exoudar

New Member
Reaction score
2
easiest way to do it without triggering the fireball itself is probably:

you will need a unit indexing system, like AIDS

-Make firebolt a dummy spell (spell that does nothing)
-Detect unit casting firebolt
-Create a dummy to cast the real firebolt at the same target (a specific dummy, call it Firebolt Dummy or something)
-Set a variable (Unit array), example -> Caster[Custom value of (Dummy)] = Triggering Unit
-Make a new trigger with event, Firebolt Dummy kills a unit
-Remove Firebolt ability from Caster[Custom value of (Triggering Unit)]
-Add Firebolt ability to Caster[Custom value of (Triggering Unit)]

(Remember to give your dummies expiration time or remove them)



can you please explain more and show me how its done in world editor
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
-Make firebolt a dummy spell (spell that does nothing)
base this off finger of pain with 1 damage (so that it's still castable on enemies, i believe its not if you dont have at least 1 dmg)
-then make a firebolt dummy unit (unit with locust and the real firebolt ability with unlimited range)
then do this:
Trigger:
  • Firebolt reset
    • Events
      • A unit casts an ability
    • Conditions
      • Ability cast is equal to Firebolt (based off finger of pain)
    • Actions
      • Set Temp_Point = Position of (Triggering unit)
      • Unit - Create 1 (Firebolt Dummy Unit) at Temp_Point facing default building facing degrees
      • Unit - Order Last created unit to (Order String of Firebolt (actual ability that deals the 50 damage)) Target unit of Ability Cast
      • Unit - Add a 5.0 second expiration timer to Last Created Unit
      • Hashtable - Save (Triggering unit) as (key Last Created unit) of 0 in Last Created Hashtable (must be made at map init and either saved to a variable or only 1 be made)
      • Custom Script: call RemoveLocation(udg_Temp_Point)


Trigger:
  • Firebolt Unit Dies
    • Events
      • A unit Dies
    • Conditions
      • Unit Type of (Killing unit) is equal to Firebolt Dummy unit
    • Actions
      • Set Temp_Unit = Hashtable load unit (key Killing unit) of 0 in Last Created Hashtable (or whatever hashtable you are using)
      • Unit - Remove Firebolt (real ability) from Temp_Unit)
      • Unit - Add Firebolt (real ability) to Temp_Unit)


thats using 0 extra systems
 

cleeezzz

The Undead Ranger.
Reaction score
268
nice, i forgot about hashtables, i stopped coding as that patch came out

got used to using indexing as an alternative
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
i MUCH prefer indexing, as it is is much faster to use a regular variable, but the problem is that a lot of people dont understand or dont use indexing (making their life harder as well as mine when i try to help) but at least its possible without it
 

Exoudar

New Member
Reaction score
2
-Make firebolt a dummy spell (spell that does nothing)
base this off finger of pain with 1 damage (so that it's still castable on enemies, i believe its not if you dont have at least 1 dmg)
-then make a firebolt dummy unit (unit with locust and the real firebolt ability with unlimited range)
then do this:
Trigger:
  • Firebolt reset
    • Events
      • A unit casts an ability
    • Conditions
      • Ability cast is equal to Firebolt (based off finger of pain)
    • Actions
      • Set Temp_Point = Position of (Triggering unit)
      • Unit - Create 1 (Firebolt Dummy Unit) at Temp_Point facing default building facing degrees
      • Unit - Order Last created unit to (Order String of Firebolt (actual ability that deals the 50 damage)) Target unit of Ability Cast
      • Unit - Add a 5.0 second expiration timer to Last Created Unit
      • Hashtable - Save (Triggering unit) as (key Last Created unit) of 0 in Last Created Hashtable (must be made at map init and either saved to a variable or only 1 be made)
      • Custom Script: call RemoveLocation(udg_Temp_Point)


Trigger:
  • Firebolt Unit Dies
    • Events
      • A unit Dies
    • Conditions
      • Unit Type of (Killing unit) is equal to Firebolt Dummy unit
    • Actions
      • Set Temp_Unit = Hashtable load unit (key Killing unit) of 0 in Last Created Hashtable (or whatever hashtable you are using)
      • Unit - Remove Firebolt (real ability) from Temp_Unit)
      • Unit - Add Firebolt (real ability) to Temp_Unit)


thats using 0 extra systems


You sir are genius, you give me a big help, thank you.
 

Exoudar

New Member
Reaction score
2
lol... thanks, no im not, and no problem :D

while we at it, how to promote a unit (increasing its attack) if it kills 10+ kills (second promote 20+ kills)

I can do variable based on item ability (claws) and increase it each time the unit kills an enemy, after 10 kills it get +5 damage.


problem is all unit with same unit-type will get promoted and not only the one who killed.


any ideas?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
Here it is but you will need some conditions if you dont want to add it to heroes or other unit types
Trigger:
  • Promotions
    • Events
      • A unit dies
    • Conditions
      • Killing unit is not equal to No unit is true (boolean i think, maybe unit comparison)
    • Actions
      • Hashtable - Save Integer ((Load Integer - (Key (Killing unit)) of 1 in Hashtable) + 1) as (Key (Killing unit)) of 1 in Hashtable
      • If then else
        • If
          • (Hashtable Load integer (Key (Killing unit)) of 1 in Hashtable) is equal to 10
        • Then
          • Hashtable - Save Integer 0 as (Key (Killing unit)) of 1 in Hashtable
          • Unit - Add ability (modified claws of attack to meet your needs)
        • Else
 

Exoudar

New Member
Reaction score
2
Here it is but you will need some conditions if you dont want to add it to heroes or other unit types
Trigger:
  • Promotions
    • Events
      • A unit dies
    • Conditions
      • Killing unit is not equal to No unit is true (boolean i think, maybe unit comparison)
    • Actions
      • Hashtable - Save Integer ((Load Integer - (Key (Killing unit)) of 1 in Hashtable) + 1) as (Key (Killing unit)) of 1 in Hashtable
      • If then else
        • If
          • (Hashtable Load integer (Key (Killing unit)) of 1 in Hashtable) is equal to 10
        • Then
          • Hashtable - Save Integer 0 as (Key (Killing unit)) of 1 in Hashtable
          • Unit - Add ability (modified claws of attack to meet your needs)
        • Else

didn't work :/
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
when i get home ill check in the editor, that and the previous ability were freehand
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?
  • The Helper The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top