Devouring Heroes

FootysMaXeD

New Member
Reaction score
0
Ok so i'm modifying a skill for a Super-Creep in my map.

Devour is an ability that can eat heroes.
It deals 35 dps to target hero until it is dead, or until the Firebelly dies.
Devour is able to Miss it's target if it is moving too fast out of range. This triggers the 2 minute cooldown.

I want to improve this skill, because it's really sort of a disaster.
The 35 dps it does makes it so heroes with high regeneration suffer, and heroes with high health pools stay inside the Firebelly's stomach for much too long.

This is the change I have in mind:
Devour (5 minute cooldown; Does not Miss)
The Firebelly eats a target hero (200 cast range) and releases it 10 seconds later. The hero also takes 35% of his maximum health as damage, during this duration. The hero is released after this 10 seconds, or if the Firebelly dies.

Problems I'm having:
1. How do I have the hero take %-based damage while inside the unit's stomach?
2. How do I cause the hero to be released after 10 seconds of digestion? (I was thinking I have to basically make a triggered version of Devour)
3. How do I make "Devour" an ability that never misses, so I can set the cooldown accordingly.

Plz Help lol?
Thanks
 

jig7c

Stop reading me...-statement
Reaction score
123
is there a Duration data value in the Devour ability? try setting it to 10 seconds..

the 35% of max hp needs to be trigger...

Trigger:
  • .
    • events
      • a unit starts the effect of an ability
    • conditions
      • ability being cast equal to devour
    • actions
      • set target = target unit of ability being cast
      • set caster = triggering unit
      • set integer = life of target x .35
      • timer - start a countdown timer Timer as a one shot timer that will expire in 10 seconds


Trigger:
  • .
    • events
      • Timer expires
    • conditions
    • actions
      • unit - cause caster to damage target dealing integer damage of type whatever...
 

FootysMaXeD

New Member
Reaction score
0
Ok so I think I fixed Problem 3.

Devour actually is two skills, not just one. One ability is basically the targetting mechanism (cast range), tooltip, and cooldown. The other ability is the dps and the leash range. So I just increased the leash range so that it never misses.

I tried making durations for both skills, with no result.

Problems i'm still having:
1. How do I have the hero take %-based damage while inside the unit's stomach?
2. How do I cause the hero to be released after 10 seconds of digestion? (I was thinking I have to basically make a triggered version of Devour)
 

NoobImbaPro

You can change this now in User CP.
Reaction score
60
1:You need EGUI, find it learn it and use it.
2:While you get him, hide him, damage him with EGUI actions, and thne unhide him, don't use abilities stun/paralysis
 

FootysMaXeD

New Member
Reaction score
0
Ok, so this is what I did. Obviously, this is not MUI because of the stupid 10 second wait, which I have heard not to use. How can I fix the problem of this not being MUI?

Trigger:
  • Firebelly
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Devour (Firebelly)
    • Actions
      • Set Firebelly_1 = (Casting unit)
      • Set Firebelly_2 = (Target unit of ability being cast)
      • Unit - Hide Firebelly_2
      • Wait 10.00 seconds
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Firebelly_1 is alive) Equal to True
        • Then - Actions
          • Unit - Move Firebelly_1 instantly to ((Position of (Triggering unit)) offset by (30.00, 30.00))
          • Unit - Cause Firebelly_1 to damage Firebelly_2, dealing ((Max life of Firebelly_2) x 0.35) damage of attack type Spells and damage type Normal
          • Unit - Unhide Firebelly_2
        • Else - Actions
          • Unit - Move Firebelly_1 instantly to ((Position of (Triggering unit)) offset by (30.00, 30.00))
          • Unit - Unhide Firebelly_2


Also, what JASS script do I use to destroy the Unit Variable I created? I don't want it as an expiration either, these are not summons.

Thanks, I almost have it completed I think. =)
 

Guest3z

New Member
Reaction score
22
Use local variables, they live and die in the function
Trigger:
  • Firebelly
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Firebelly
    • Actions
      • Custom script: local unit kodo = GetTriggerUnit()
      • Custom script: local unit eaten = GetSpellTargetUnit()
      • Custom script: set udg_Firebelly_1 = kodo
      • Custom script: set udg_Firebelly_2 = eaten
      • Unit - Hide Firebelly_2
      • Wait 10.00 seconds
      • Custom script: set udg_Firebelly_1 = kodo
      • Custom script: set udg_Firebelly_2 = eaten
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Firebelly_1 is alive) Equal to True
        • Then - Actions
          • Unit - Move Firebelly_2 instantly to ((Position of (Triggering unit)) offset by (30.00, 30.00))
          • Unit - Cause Firebelly_1 to damage Firebelly_2, dealing ((Max life of Firebelly_2) x 0.35) damage of attack type Spells and damage type Normal
          • Unit - Unhide Firebelly_2
        • Else - Actions
          • Unit - Move Firebelly_2 instantly to ((Position of (Triggering unit)) offset by (30.00, 30.00))
          • Unit - Unhide Firebelly_2

tested this and it worked for multiple units
btw this leaks
 

FootysMaXeD

New Member
Reaction score
0
How does it leak? Why =(
How do I incorporate these local variables into my GUI triggers? I cannot find a way...
Unit - Hide Firebelly_2
(Firebelly_1 is alive) Equal to True
etc, etc
These seem to be referring to the Global Triggers I made in my original trigger, and not the local variables ued here.

Thank you for converting it into Local Integers. I want to learn JASS.

Btw, Why do you set Firebelly_1 and Firebell_2 again after the wait?
 

Jedi

New Member
Reaction score
63
You don't need to null global variables(Normal GUI variables), so mapguy is right.

Edit:I am not talking about Removing locations, removing dummy units, destroying groups...Just nulling the variables.
 

FootysMaXeD

New Member
Reaction score
0
So what would it look like to null a Local Variable?
"null Firebelly_1"?

And how do I refer to the local variable using my GUI triggers? I Can't seem to find it anywhere.
 

tooltiperror

Super Moderator
Reaction score
231
You need to use the action [ljass]CustomScript[/ljass].
 

INCINERATE

New Member
Reaction score
12
hey footies, if i was you i would scrap the devour hero ability , i tried it once for a frog hero i put in , and then i realized in game that if you get hexed, it instantly kills the unit or hero, so say you devour an enemy hero, and then another enemy hex's you. The devoured hero will be totally removed from the game.

its a bug with devour and hex, that is present in ladder games also.
 

Guest3z

New Member
Reaction score
22
@INCINERATE
As this is triggered and merely hides/unhides the hero I don't believe that should be a problem as the hero is not actually being devoured.

@FootysMaXeD
How does it leak? Why =(
How do I incorporate these local variables into my GUI triggers? I cannot find a way...

Locations ect. leak if they are not removed, you can look up tutorials on how to do this. Local variables are not available to GUI users except as ToolTip said with the use of Custom Script under 'Actions - General - Custom Script'

These seem to be referring to the Global Triggers I made in my original trigger, and not the local variables ued here.

Thank you for converting it into Local Integers. I want to learn JASS.

Btw, Why do you set Firebelly_1 and Firebell_2 again after the wait?

There are two types of variables, Global and Local variables. As I previously said Local variables live and die in the function, Global variables on the other hand (the ones available for GUI users, your Firebelly_1 and Firebelly_2) exist outside of the function and may be munipulated by other functions. For this reason I set your global variables to the local ones after the 10 second wait for Firebelly_1 / 2 could be rewritten in the 10 second period by another function call thus screwing up the actions after the 10 second wait.

You dont actually have to know a lot of JASS to do all of the things you want like local variables, you just have to know some of the specifics you want like
Trigger:
  • Custom script: local unit kodo = GetTriggerUnit()
which is essentially what you had
Trigger:
  • Set Firebelly_1 = (Casting unit)
only with a local unit variable instead of a global unit variable (and i guess i used triggering unit whereas you used casting unit but they refer to the same thing.)

So what would it look like to null a Local Variable?
"null Firebelly_1"?

And how do I refer to the local variable using my GUI triggers? I Can't seem to find it anywhere.

If your trying to prevent leaks you have to make a temporary point variable for location leaks, something like Temp_Point, then lines that leak like
Trigger:
  • Unit - Move Firebelly_2 instantly to ((Position of (Triggering unit)) offset by (30.00, 30.00))
which leaks ((Position of (Triggering unit)) offset by (30.00, 30.00)) and set the temporary point variable in its place (after setting it first of course) so like
Trigger:
  • Set Temp_Point = (Position of (Triggering unit))
    • Set Temp_Point2 = (Temp_Point offset by (30.00, 30.00))
    • Unit - Move Firebelly_2 instantly to Temp_Point2
    • Unit - Cause Firebelly_1 to damage Firebelly_2, dealing ((Max life of Firebelly_2) x 0.35) damage of attack type Spells and damage type Normal
    • Unit - Unhide Firebelly_2
    • Custom script: call RemoveLocation( udg_Temp_Point )
    • Custom script: call RemoveLocation( udg_Temp_Point2 )
and removing the locations afterwards again using custom script.

For nulling local unit variables (someone correct me if im wrong I dont do alot of jass) I believe its
Trigger:
  • Custom script: set kodo = null
with whatever you named your local variable in place of kodo

Anyways I would suggest looking up some tutorials on memory leaks if you really want to learn.
Hope this helped. :thup:
 

FootysMaXeD

New Member
Reaction score
0
Alright, thank you for the help with fixing leaks. But the main problem is still: How did you create this function on the Trigger Editor. You said you tested it and it worked, but I how do I refer to the local variable you created using the custom script? I would have to "Hide Firebelly_1" using some sort of JASS function right? The one you made is I think creating local variables, and then referring to the Global variables. Maybe you can post it in a map file, because I don't see how you made it work =/.

Use local variables, they live and die in the function
Trigger:
  • Firebelly
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Firebelly
    • Actions
      • Custom script: local unit kodo = GetTriggerUnit()
      • Custom script: local unit eaten = GetSpellTargetUnit()
      • Custom script: set udg_Firebelly_1 = kodo
      • Custom script: set udg_Firebelly_2 = eaten
      • Unit - Hide Firebelly_2
      • Wait 10.00 seconds
      • Custom script: set udg_Firebelly_1 = kodo
      • Custom script: set udg_Firebelly_2 = eaten
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Firebelly_1 is alive) Equal to True
        • Then - Actions
          • Unit - Move Firebelly_2 instantly to ((Position of (Triggering unit)) offset by (30.00, 30.00))
          • Unit - Cause Firebelly_1 to damage Firebelly_2, dealing ((Max life of Firebelly_2) x 0.35) damage of attack type Spells and damage type Normal
          • Unit - Unhide Firebelly_2
        • Else - Actions
          • Unit - Move Firebelly_2 instantly to ((Position of (Triggering unit)) offset by (30.00, 30.00))
          • Unit - Unhide Firebelly_2

tested this and it worked for multiple units
btw this leaks
 

tooltiperror

Super Moderator
Reaction score
231
You just select the action [LJASS]custom script[/LJASS] and type in what he did.
 

Guest3z

New Member
Reaction score
22
Alright, thank you for the help with fixing leaks. But the main problem is still: How did you create this function on the Trigger Editor. You said you tested it and it worked, but I how do I refer to the local variable you created using the custom script? I would have to "Hide Firebelly_1" using some sort of JASS function right? The one you made is I think creating local variables, and then referring to the Global variables. Maybe you can post it in a map file, because I don't see how you made it work =/.
Again as tooltip said you just have to use the "actions - general - custom script" I set your global variables to equal the local ones so to "Hide Firebelly_1" would not infact require any JASS as using the Global Variable would still be MUI
I will post map though :thup:
 

Attachments

  • Firebelly Test.w3x
    13.1 KB · Views: 173

FootysMaXeD

New Member
Reaction score
0
Ah...Much thanks Guest3z, you helped me a lot. =)

I understand now why you reset the Global Variable back to the the local, so other/repeat triggers can override the global one during the wait period.

+rep!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top