block and counterattack

JohnyO

New Member
Reaction score
0
I tried to do a counterattack on block.
Hero has chance to block someone's attack, and when hero got block, he has chance to counterattack.
I tried stone giants spell - stone skin or idk how it's named, i tried footmen spell - rise shield or how its called.
But i don't know how catch block chance, so counterattack will also activated. I am thinking of trigger spell block, but don't also know how to do it.
Any ideas for counterattack chance on block?
 

dudeim

New Member
Reaction score
22
try something like

Trigger:
  • event
    • detect when unit x gets hit // your unit
    • actions
    • set life of unit x to life of unit x + damage taken //this is the block it blocks for the full damage or in other words just heals for that amount.
    • cause unit x to deal "damage taken" to damage source // this it the counter attack the damage taken just change that to what ever you like did it to damage the attacking unit with his total damage done in that attack to your unit.


this is just hand writin but i think you can figure it out;)
 

JohnyO

New Member
Reaction score
0
I don't get your idea. I have this:
Trigger:
  • Tb
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Random integer number between 1 and 100) Equal to 100
      • ((Triggering unit) has buff Block(()) ) Equal to True
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))

And it doesn't work so. I mean talking about just block, without counterattack now.
 

Rllulium

New Member
Reaction score
10
I don't get your idea. I have this:
Trigger:
  • Tb
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Random integer number between 1 and 100) Equal to 100
      • ((Triggering unit) has buff Block(()) ) Equal to True
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))

And it doesn't work so. I mean talking about just block, without counterattack now.

This will only block 1 time out of 100. Perhaps you should raise the chance for it to occur while testing it.
 

JohnyO

New Member
Reaction score
0
Trigger:
  • Conditions
    • (Random integer number between 1 and 100) Less than or equal to 100

I mean less than or equal to, ofc
I thought this make 100% chance, but it doesn't.
 

Moridin

Snow Leopard
Reaction score
144
Does the Damage Taken function work with the event "A unit is attacked" ?

I'm not sure, but maybe it only works with "A unit takes damage". In which case you would need two triggers. One with "A unit is attacked" that adds "Triggering unit takes damage" as an event to the second trigger. Then the second trigger would have these actions and conditions.
 

HydraRancher

Truth begins in lies
Reaction score
197
Does the Damage Taken function work with the event "A unit is attacked" ?

I'm not sure, but maybe it only works with "A unit takes damage". In which case you would need two triggers. One with "A unit is attacked" that adds "Triggering unit takes damage" as an event to the second trigger. Then the second trigger would have these actions and conditions.

He's right, it only works for A unit takes damage, try this:
Trigger:
  • Trigger
    • Events
      • Unit - A unit is attacked
    • Conditions
      • (Random Integer between 1 and 100) Equal to or greater than (>=) 70
      • (Level of Spell for (Triggering Unit) greater than (>) 0
    • Actions
      • Unit - Pause (Attacking Unit)
      • Unit - UnPause (Attacking Unit)
      • Animation - Set Animation speed of (Triggering Unit) to 400.00% //Set this to a relatively high number
      • Unit - Make unit face (Attacking Unit)
      • Wait 0.80 seconds
      • Animation - Play (Triggering Unit)'s attack animation
      • Unit - Damage (Attacking Unit) dealing (Level of Spell for (Triggering Unit) * 100)
      • Animation - Set Animation speed of (Triggering Unit) to 100.00%


Before you complain about (Attacking Unit) not being MUI, refer to this thread. Me and Moridin's conversation.
 

JohnyO

New Member
Reaction score
0
I can't understand this Oo
what does it do?


edit: oh, i think i got it... but where is block? it should be chance when blocked
 

avalya

New Member
Reaction score
37
That will not really block, only pause and unpause the unit when it starts its attack swing (i.e delay the next attack by a really small number), also the counterattack will look weird since he isn't attacked but still counters, probably later than he actually is attacked.
 

jig7c

Stop reading me...-statement
Reaction score
123
I don't get your idea. I have this:
Trigger:
  • Tb
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Random integer number between 1 and 100) Equal to 100
      • ((Triggering unit) has buff Block(()) ) Equal to True
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))

And it doesn't work so. I mean talking about just block, without counterattack now.

this trigger doesn't take in account if the it's the last hit...


meaning if the hero gets attacked and he actually dies... how is the triggering going to set it's life back to life+damage....also it has 1% chance of blocking... according to the conditions....
 

JohnyO

New Member
Reaction score
0
tx for ur helping, but i said that it is not equal but less than or equal to

so i don't know how to catch chance of block... the way qith pause/unpause isn't correct
 

jig7c

Stop reading me...-statement
Reaction score
123
what you can do is make the ability go it gives for example

35% chance to block damage, if the hero's HP is greater than 150 points...and then the above trigger will work...

you have to edit the condition a bit

Trigger:
  • Tb
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Random integer number between 1 and 100) Less than or equal to 35
      • ((Triggering unit) has buff Block) Equal to True
      • (Life of (Triggering unit)) Greater than or equal to 150
    • Actions
      • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
      • now you can either slow the enemy unit's animation or pause the unit, until your unit attacks the unit, and then in another trigger reset the unit's animation speed or unpause it!
 

HydraRancher

Truth begins in lies
Reaction score
197
tx for ur helping, but i said that it is not equal but less than or equal to

so i don't know how to catch chance of block... the way qith pause/unpause isn't correct

Err.... WHAT?





Trigger:
  • Trigger
    • Events
      • Unit - A unit is attacked
    • Conditions
      • (Random Integer between 1 and 100) Equal to or greater than (>=) 70
      • (Level of Spell for (Triggering Unit) greater than (>) 0
    • Actions
      • Animation - Make (Attacking Unit) play its attack animation
      • Animation - Set Animation speed of (Triggering Unit) to 400.00% //Set this to a relatively high number
      • Unit - Make (Triggering Unit) face (Attacking Unit)
      • Wait 0.80 seconds
      • Set Temp_Point = (Position of (Attacking Unit))
      • Floating Text - Create floating text that reads Miss at Temp_Point with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Floating Text - Set the velocity of (Last created floating text) to 50.00 towards 90.00 degrees
      • Custom Script: call RemoveLocation (udg_Temp_Point)
      • Animation - Reset (Attacking Unit)'s animation
      • Animation - Play (Triggering Unit)'s attack animation
      • Unit - Damage (Attacking Unit) dealing (Level of Spell for (Triggering Unit) * 100)
      • Animation - Set Animation speed of (Triggering Unit) to 100.00%


Try that.
 

JohnyO

New Member
Reaction score
0
yeah, i think it's work, tx
but he takes dmg anyway, even with (Random Integer between 1 and 100) Equal to or greater than (>=) 0
when it's not the one enemy, he won't hit all
mb it should be not tank usual hit, but i.e. spell
i am thinking of dummy so,
when it is block, it is chance to counter attack, meaning that attacking unit will be hit by some spell
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top