• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Several stat based damage/effects

Status
Not open for further replies.
Level 20
Joined
Jul 14, 2011
Messages
3,213
Hi!

First:
I'm triggering all my damage in the map I'm making (Check Signature). I was triggering the "Miss", but I found that passive effects like "Bash" would deal damage anyway, and stun, even when "Miss" was displayed, since I was interpreting "Miss" as "0" damage, but warcraft handles "Miss" as total "miss", and bash/cleave/poison/etc. doesn't work either.

So, I decided to work with Wc3 Miss... But I want my heroes to have evasion based on Agility. What would you suggest me to achieve that?

Second:
How to make a passive bash that takes the BashChance, BashDamage and BashDuration from variables?

Third:
How to trigger a "Cleave" effect with triggered damage?
 
Level 8
Joined
Dec 9, 2009
Messages
397
Is WC3 Miss a system of some kind?

You'll have to trigger bash and other things that trigger damage.
How you do that is, if they don't miss, check the bash chance (number variable for each unit or unit type) check if they bash, if they do, create a dummy with 100% chance to bash, order dummy to attack damaged unit (just have his triggered damage be 0)

Second
Chance and Damage can easily be triggered, how to do custom time is, create the skill with a long stun duration, then when you trigger the bash, add the stunned unit to a group, and start a loop, every .5 seconds and once time ran remove the stun.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
About the MISS: Damage Detection Systems works after the damage is dealt, ther est of passive skills too. Wc3 Miss happens before damage is dealt, and before the chance to bash or something is checked. I want to take advantage of that as much as I can.

Ok.. the BashChance can be set easily... The Bash Damage too.. But I don't know how to trigger the Bash duration. How do I remove the stun, just removing the buff?
 
Level 8
Joined
Dec 9, 2009
Messages
397
They talked about it here, I'm pretty sure it's just removing the buff though.
http://www.hiveworkshop.com/forums/world-editor-help-zone-98/remove-stun-triggers-204710/

Set a stun duration variable to 2 for every half a second you want it stunned.

when you spawn the dummy with the bash, add the unit you tell him to attack to a unit group
Save the value of the duration in hashtable

Start loop trigger,

Loop trigger:
Every .5 seconds
pick all units in stun group
load stunduration from hashtable
if
stunduration < 0
set stunduration = stunduration - 1
Save stunduration to hashtable
else
remove stun
remove picked unit from stungroup

if
number of units in stungroup = 0
turn off this triggger.

Add to your trigger of when a creep or hero dies, that they are removed from the stungroup there as well.
 
If ur doing it like what I was thinking (and doing on my map), then you should have no problem doing custom evasions... You just need to calculates things up before you deal the actual damage...

On mine, I have the armors have 100% resistance to all damage-type except chaos, so any hit I take will give 0 damage... then I have a dummy damage dealer unit which I use to deal the actual damage via triggers....

Now if the damage my hero took was from any unit other than the dummy, my DDS runs and it calculates the actual damage to be dealt (armor reduction is also incorporated since I use custom armor values too), it then makes the dummy damage dealer deal that exact damage to the unit (and ofc using the attack-type Chaos and damage type divine)...

Now if ur not doing it like that, there's another "easy" way... by manipulating the unit's health...
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm not using dummys, but simple doing all the (DamageTypes - TypeArmors) together, and that's the total Damage. For critical chance, I call the Unit CriticalChance, and for Critical Rate, I call the UnitCritical Rate, and manipulate the total Dmg accordingly. All this, of course, after checking the unit evasion... I had doubts about it... but now that I know I have to trigger anything related to damage (bash, etc.)... Then I can use it :p I just wanted to take advantage of Wc3 "miss". Since my only hero is melee, I use dummy units for ranged attacks, but in that case I just call the hero data.

EDIT: I'm not sure about setting the bash duration adding the unit to a group and else. Maybe i'd like to add an expiration timer or something to the unit, and enable the unit again when the timer expires. And I'd like to know if the bash stacks, or if the timer of the bash duration is re-adjusted when the unit is bashed under bash effect... I don't know. I'd like to be sure about all this.

EDIT: BTW, I don't think that bash needs any damage bonus. The bash itself is a good enough bonus.
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
I'm storing all the Unit-Type ID damage data in hashtables, same as heroes (based on Player Number).

So far, I'm going for the timer option (Not sure how to do it for several units though), and never allow it to go over 2.5s. If the unit is already stunned, I would make a sum of the ongoing stun + new stun, and again, never allow it to go over 2.5s.

I have the idea, but I'm not sure on how to do it yet.
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
OMG! I just had the epiphany about it while playing DS on PC Emulator! xD I've always read that Arrays store data up to 8192 (including 0)... So far, I was thinking that it only allowed values BELOW 8192... But now I know that it can store that amount of values, but has nothing to do with the number of digits inside the index! So I can set Timer[Unit ID] that's around 34485013... :D

(I Just hope I'm not wrong xD) If this is true, my life will be easier an happier :p

EDIT: My bad... isn't like that (Good to dream though). It really holds values up to 8192... In that case.

JASS:
set udg_r = Load StunDuration of DamageSourceID from DamageHash // Takes the stun duration from the attacking unit.
save udg_r as StunDuration of DamagedUnitID in DamageHash // Saves that time for the attacked unit.
set udg_t = Timer

//------------------------------------------------\\
  if DamagedUnit has Buff "Stun" then 
    set udg_r = udr + (Load StunDuration of DamagedUnitID in Damagehash)
  endif
  if udg_r > 2.5s then
    set udg_r = 2.5
  endif

Star udg_t as a One-Shot timer that will expire in udg_r
//------------------------------------------------\\

This is some crazy stuff that came to my mind... xD I was thinking out loud :p. I think I need an indexing system in order to take the unit that is stunned.

I saw a system around there for knockback... but it doesn't include the stun duration limit, and I don't know if the stun duration stacks, or just replaces the second one with the first one.
 
Last edited:
Level 20
Joined
Jul 14, 2011
Messages
3,213
I don't have it, but I think I'll eventually use Bribe's indexing system, since most spells and stuff are using that one. So far, I still don't know how would it be :p Could you, or anyone make an example? Even if it's a lame one. I just feel that I need something to work on... don't feel like starting something from scratch.

The thing is that Unit ID are ussually really long (about 7~9 digits) and Unit-Type Id's are similar. I'm setting the data based on Unit-Type Id (set udg_i = 'hfoo'). In this case, I would have to retrieve the Stuned Unit ID, but that wouldn't work on an [index], so... Would be better to store the StunChance and StunDuration in a hashtable, but work the stunned unit with the array and the indexing thing.
 
Status
Not open for further replies.
Top