Skill Help

micolord

You can change this now in User CP.
Reaction score
0
I've made a skill called "Hellfire" it's more like a skill from DOTA, it suppose to do is to hit the enemy target and then burn it after 2 seconds. My problem is when you first use "Hellfire" on your target enemy/unit it will not cause any burn to the target enemy/unit you must use it 1 time first and then the second time or third or 4th time you use it, it will now work, please help me fix it so that in the first place it will affect, here is the trigger:

Trigger One:
Events
Unit - A unit Learns a skill
Conditions
((Unit-type of (Learning Hero)) Equal to Skeleton King) and ((Learned Hero Skill) Equal to Hellfire )
Actions
If (Hellfire Equal to 0) then do (Set Hellfire = 1) else do (If (Hellfire Equal to 1) then do (Set Hellfire = 2) else do (If (Hellfire Equal to 2) then do (Set Hellfire = 3) else do (If (Hellfire Equal to 3) then do (Set Hellfire = 4) else do (Do nothing))))

Trigger Two:
Events
Unit - A unit Starts the effect of an ability
Conditions
((Unit-type of (Casting unit)) Equal to Skeleton King) and ((Ability being cast) Equal to Hellfire )
Actions
If (Hellfire Equal to 1) then do (Set HellfireConfirm = True) else do (Do nothing)
If (HellfireConfirm Equal to True) then do (Unit - Cause (Casting unit) to damage circular area after 1.00 seconds of radius 1.00 at (Position of (Target unit of ability being cast)), dealing 15.00 damage of attack type Spells and damage type Normal) else do (Do nothing)
If (HellfireConfirm Equal to True) then do (Unit - Cause (Casting unit) to damage circular area after 2.00 seconds of radius 1.00 at (Position of (Target unit of ability being cast)), dealing 15.00 damage of attack type Spells and damage type Normal) else do (Do nothing)
If (HellfireConfirm Equal to True) then do (Set HellfireConfirm = False) else do (Do nothing)
 

Necrach

You can change this now in User CP.
Reaction score
62
Hm, first of all why do you need a condition for confirming that the hero is Skeleton King? Does anyone else have the same ability? Second, you should use Triggering Unit instead of Casting Unit. Third, you could check the Integer "Level of ability for unit" instead of setting a variable for the ability level when the skill is learned. Fourth, your positions leaks, search for a tutorial here on the forum :eek:

Now for what causes your bug, I am not sure how you are doing the with the
Trigger:
  • If (HellfireConfirm Equal to True) then do (Unit - Cause (Casting unit) to damage circular area after 1.00 seconds of radius 1.00 at (Position of (Target unit of ability being cast)), dealing 15.00 damage of attack type Spells and damage type Normal) else do (Do nothing)


EDIT: Actually, I am not sure hoe that action works, maybe someone else could say that. But I would guess that's where the problem is. You could change the trigger to use just a normal Wait action and use Damage Target instead of Damage Area, or maybe its recommended you use a timer and/or a hashtable instead of a normal wait! :p
 

micolord

You can change this now in User CP.
Reaction score
0
Nevermind! Got it fixed by adding this (Yeah pointless but it did! It worked!):

Events
Unit - A unit Learns a skill
Conditions
((Unit-type of (Learning Hero)) Equal to Skeleton King) and ((Learned Hero Skill) Equal to Hellfire )
Actions
If (Hellfire Equal to 0) then do (Set Hellfire = 1) else do (If (Hellfire Equal to 1) then do (Set Hellfire = 2) else do (If (Hellfire Equal to 2) then do (Set Hellfire = 3) else do (If (Hellfire Equal to 3) then do (Set Hellfire = 4) else do (Do nothing))))
Game - Display to (All players) the text: (String(Hellfire))
 

Necrach

You can change this now in User CP.
Reaction score
62
nevermind! Got it fixed by adding this (yeah pointless but it did! It worked!):

events
unit - a unit learns a skill
conditions
((unit-type of (learning hero)) equal to skeleton king) and ((learned hero skill) equal to hellfire )
actions
if (hellfire equal to 0) then do (set hellfire = 1) else do (if (hellfire equal to 1) then do (set hellfire = 2) else do (if (hellfire equal to 2) then do (set hellfire = 3) else do (if (hellfire equal to 3) then do (set hellfire = 4) else do (do nothing))))
game - display to (all players) the text: (string(hellfire))

:eek:
 

micolord

You can change this now in User CP.
Reaction score
0
Damn.. I only fixed when it's level 1 but when it comes to level 2 it aint fixed.. Please help me!
 

Necrach

You can change this now in User CP.
Reaction score
62
Hm, is that ability an arrow ability, like Searing Arrows? Or what's the base ability?

Anyways, you could do like this instead of your Area Damage action (although there is a lot of different sulotions). Create a dummy unit (no model, no attack, no sight range, with Locust, etc) named Hellfire Timer Dummy (or whatever ;)) So when a unit uses Hellfire, create a Hellfire Dummy Timer for the owner of casting unit, and then add a 2 second expiration timer to it, and save it linked to the target unit with a Hashtable. Then when the dummy dies, make it damage the target!

Trigger:
  • Actions
    • Set temp_point = (Position of (Triggering unit))
    • Unit - Create 1 Hellfire Timer Dummy for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
    • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
    • Hashtable - Save Handle Of(Target unit of ability being cast) as (Key (Last created unit)) of 1 in hashtable
    • Custom script: call RemoveLocation (udg_temp_point)


Trigger:
  • trigger2
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Footman
    • Actions
      • Unit - Cause (Triggering unit) to damage (Load (Key (Triggering unit)) of 1 in hashtable), dealing 50.00 damage of attack type Spells and damage type Normal


If you have NO idea what these triggers means, go check a tutorial of Hashtables and maybe memory leaks. For example, you need to create a hashtable before using them. Basically what this does is the dummy unit works as a 2 second timer! I AM NOT SURE I GOT WHAT YOU MEANT, THOUGH. And for different damage for different levels, you could give the dummy unit an ability with the same level as the caster's level of Hellfire, and then check that ability when the trigger should decide how much damage dealt, either through math or by if/then/else functions.

Now for the "Level of Ability for unit", you can find it whenever dealing with Integers. In Conditions, you can go down to something called Integer Comparison. After that, its Unit - Level of Ability of Unit.

EDIT: I recommend using this instead of your triggers, but it might not solve your problem. Because you are talking about some "burn" effect, is that a buff placed on the unit already on cast? If that's the case, you are doing that with the Object editor, no?
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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