Spell that does eg. 2x damage of hero?

cryheart

New Member
Reaction score
1
How do i make a trigger dealing damage = to damage of my hero.

Example my hero has 43-50 damage and i want a spell dealing 43-50 damage x2.

I don't want a trigger dealing 43-50 damage x2, my hero can level up -_-

thanks in advance :)
 

k0sA

New Member
Reaction score
9
Create a trigger which detects whenever the unit attacks, check if it is a unit with that ability then damage the attacked unit with damage taken x2 ;)
 

cryheart

New Member
Reaction score
1
that reply was fast but not what i was looking for :(

i want to create a spell that does 2x the damage of the hero that cast the spell.
 

k0sA

New Member
Reaction score
9
2 sec. I will create a new trigger for you...

Code:
Test
    Events
        Unit - A unit Finishes casting an ability
    Conditions
        (Ability being cast) Equal to (==) [B]Animate Dead[/B]
    Actions
        Unit - Cause (Casting unit) to damage (Target unit of ability being cast), dealing ((Real((Random integer number between [B]43[/B] and [B]50[/B]))) x [I]2.00[/I]) damage of attack type Spells and damage type Normal

I couldn't find out how to get max and min damage, but this could be the trigger you need. (Change fields in bold, Fields in italic can be changed if you want to)
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
you can get the damage of you hero by using game cache. if you save him via game cache, re-create him and order him to attack a dummy unit you will get how much damage your hero is able to deal. (buffs are not counted, abilitys and items are though)
save it in a variable and use it for your spell.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
i dont see where your problem is, you can use game cache in multiplayer as well. dota does.
 

cryheart

New Member
Reaction score
1
so your trying to tell me to save my hero and order him to attack a dummy, save the damage to a variable den recreate my hero in a multi-player game? l-o-l
 

Trollvottel

never aging title
Reaction score
262
you dont have to save the map. just store the hero in game cache. thats what gamecache can do besides being loaded from different maps.
 

cryheart

New Member
Reaction score
1
omg.. different weapons, buffs, etc adds to the damage of my hero and you want me to store everything 1 by 1 den create millions of variable for 1 spell?
 

k0sA

New Member
Reaction score
9
It looks like you don't wanna do this map... You are not going to store many things, you are gonna store 1 thing. Create one action to recreate the trigger order him to attack, get the damage and damage the selected unit...
 

cryheart

New Member
Reaction score
1
what i want is simple..
a spell that deals "hero's damage x2" damage

so is there a simpler way?
 

k0sA

New Member
Reaction score
9
No, there isn't a simpler way. You might look around on the web for some kind of Jass library which is capable of this.
 

Accname

2D-Graphics enthusiast
Reaction score
1,464
here. i did it for you:
Code:
Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Stormhammer
    Actions
        Game Cache - Store (Triggering unit) as Hero of Hero in (Last created game cache)
        Game Cache - Save (Last created game cache)
        Game Cache - Restore Hero of Hero from (Last created game cache) for (Owner of (Triggering unit)) at (Center of Rect 000 <gen>) facing 0.00
        Unit - Create 1 Dummy for Neutral Hostile at (Center of Rect 000 <gen>) facing Default building facing (270.0) degrees
        Unit - Order (Last restored unit) to Attack (Last created unit)
        Trigger - Add to DamageDetect <gen> the event (Unit - (Last created unit) Takes damage)
        Set Caster[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
        Set Target[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
        Set Dummy[(Player number of (Owner of (Triggering unit)))] = (Last restored unit)
Code:
DamageDetect
    Events
    Conditions
        Or - Any (Conditions) are true
            Conditions
                (Damage source) Equal to Dummy[1]
                (Damage source) Equal to Dummy[2]
                (Damage source) Equal to Dummy[3]
                (Damage source) Equal to Dummy[4]
                (Damage source) Equal to Dummy[5]
                (Damage source) Equal to Dummy[6]
                (Damage source) Equal to Dummy[7]
                (Damage source) Equal to Dummy[8]
                (Damage source) Equal to Dummy[9]
                (Damage source) Equal to Dummy[10]
                (Damage source) Equal to Dummy[11]
                (Damage source) Equal to Dummy[12]
    Actions
        Unit - Cause Caster[(Player number of (Owner of (Damage source)))] to damage Target[(Player number of (Owner of (Damage source)))], dealing ((Damage taken) x 2.00) damage of attack type Spells and damage type Normal
        Unit - Remove (Damage source) from the game
        Unit - Remove (Triggering unit) from the game
variables used:
Caster[] = unit variable with array
Target[] = Unit variable with array
Dummy[] = Unit variable with array

attached demo map.
 

Renendaru

(Evol)ution is nothing without love.
Reaction score
309
Umm... Make the caster hidden, then order the hidden unit to attack the target. And add a 2x crit. XD?
 

cryheart

New Member
Reaction score
1
how can i change

Trigger - Add to DamageDetect <gen> the event (Unit - (Last created unit) Takes damage)

Last created unit - Last created item?

because my hero can only attack items. =x
 
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