• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Autocast -> add damage to targets.

Status
Not open for further replies.
Level 8
Joined
Aug 17, 2013
Messages
112
So i've made a spell out of Poison Arrows (order string poisonarrows)
And i want to add 1x real Strenght of hero as bonus damage.


I realize that we're not casting the autocasters, we actually just "attack" with a bonus to that string.

My trigger:

  • Events
    • Unit - Player 0000 <gen> Is issued an order targeting an object
  • Conditions
    • (Issued order) Equal to (Order(poisonarrows))
  • Actions
    • Unit - Cause (Ordered unit) to damage (Target unit of issued order), dealing (6.00 x (Real((Strength of (Triggering unit) (Include bonuses))))) damage of attack type Normal and damage type Normal
What i need is the right combination of event and condition.

-Plunders
 
Level 25
Joined
Sep 26, 2009
Messages
2,378
The easiest way would be to use damage detection system, as it can detect when the unit took damage, you can check who the attacker is, if he has the poison arrows ability, and of course increase damage taken by the target.

Another way is to calculate the time it takes for the projectile to fly and hit the target and deal damage to it - however that is way more complex than it may seem at first, as the target can move during projectile's flight.

I can't think of any other way, which could not be abused to be honest.
 
Level 8
Joined
Aug 17, 2013
Messages
112
First of all: The spell is supposed to be melee, not ranged. So missile settings are irellevant. (and the setting is hard to abuse)

I've looked at the DDS and i think it's chaotic and messy, wouldn't know how to use such a wierd tool..

However is it really impossible to do the following?:

  • Event:
  • A unit is issued an order targeting an object.
  • Condition:
  • (Issued order) Equal to (Order(poisonarrows))
  • Action:
  • Unit - Cause (Ordered unit) to damage (Target unit of issued order), dealing (Real((Strength of (Ordered unit) (Include bonuses))))) damage of attack type Normal and damage type Normal
Can we twist this into working? (i hate JASS, variables and wierd interger values that makes no sense, so this is as advanced as you should go)
 

Cokemonkey11

Spell Reviewer
Level 29
Joined
May 9, 2006
Messages
3,534
First of all: The spell is supposed to be melee, not ranged. So missile settings are irellevant. (and the setting is hard to abuse)

Incorrect. All units have a backswing animation and you can abuse even an instantaneous one by ordering a unit to stop ("s" "s" "s"...) to run the trigger over and over.

You'll need a damage detection system to do this.

I've looked at the DDS and i think it's chaotic and messy, wouldn't know how to use such a wierd tool..

However is it really impossible to do the following?:

  • Event:
  • A unit is issued an order targeting an object.
  • Condition:
  • (Issued order) Equal to (Order(poisonarrows))
  • Action:
  • Unit - Cause (Ordered unit) to damage (Target unit of issued order), dealing (Real((Strength of (Ordered unit) (Include bonuses))))) damage of attack type Normal and damage type Normal
Can we twist this into working? (i hate JASS, variables and wierd interger values that makes no sense, so this is as advanced as you should go)

Take a look at this: http://www.hiveworkshop.com/forums/spells-569/gui-friendly-damage-detection-v1-2-1-a-149098/
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
First of all: The spell is supposed to be melee, not ranged. So missile settings are irellevant. (and the setting is hard to abuse)

Still abusable and potentially buggy (damage over time).

I've looked at the DDS and i think it's chaotic and messy, wouldn't know how to use such a wierd tool..

This doesn't look more chaotic than yours:

  • OnDamage
    • Events
      • Game - damageEventTrigger becomes Equal To 1.00
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • 'IF'-Conditions
          • damageType Equal To PHYSICAL
          • source Equal To <your hero>
          • <check for your poisonarrows skill here>
        • 'THEN'-Actions
          • Custom script: call UnitDamageTargetEx(udg_source, udg_target, I2R(GetHeroStr(udg_source, true)), true, false, null, DAMAGE_TYPE_NORMAL, null)
        • 'ELSE'-Actions
EDIT:
Coke to fast for me :D
 
Level 31
Joined
Jul 10, 2007
Messages
6,306
Redoing Post
Ok, I see your issue. When the target unit takes damage, although you can check what type of damage that was, be it spell, physical, or from code, you can't actually detect what spell that damage came from. Poison arrows are a pseudo magic/physical attack, meaning that they can be evaded like regular physical attacks.

If you have instant projectiles, here's what you can do

On Poison Arrow Cast, add a buff to the attacker
On damage, if attacker has buff and damage was from magic (not actually sure if it's magic or physical tbh, you'll have to check), add the extra damage
On timer of 0, remove the buff from the attacker (you can't do an attack faster than like .01)

If the projectiles aren't instant, your only good option is to use a custom projectile system and then specifically deal the damage to the unit when the projectile collides.

This is an example of how you'd do it if it was a buff on the unit and the damage was physical
JASS:
struct PoisonArrows extends array
    private static constant integer POISON_ARROW_BUFF_ID = 'buff'

    private static method onDamage takes nothing returns nothing
        if (GetUnitAbilityLevel(source, POISON_ARROW_BUFF_ID) > 0 and archetype == ArcheType.PHYSICAL) then
            set damage = damage + GetHeroStr(source, true)
        endif
    endmethod

    implement DDS
endstruct

JASS:
struct PoisonArrows extends array
    private static constant integer POISON_ARROW_BUFF_ID = 'buff'
    private static constant real MULTIPLIER = .5

    private static method onDamage takes nothing returns nothing
        if (GetUnitAbilityLevel(source, POISON_ARROW_BUFF_ID) > 0 and archetype == ArcheType.PHYSICAL) then
            set damage = damage + GetHeroStr(source, true)*GetUnitAbilityLevel(source, POISON_ARROW_BUFF_ID)*MULTIPLIER
        endif
    endmethod

    implement DDS
endstruct

So level 1 = half hero str
Level 2 = full hero str
Level 3 = 1.5*hero str

etc

w/e you want ;)


Hopefully I have answered your question


Will there ever be a system that can index attacks? No, it's impossible to index projectiles.
 
Level 14
Joined
Dec 12, 2012
Messages
1,007
Redoing Post
Ok, I see your issue. When the target unit takes damage, although you can check what type of damage that was, be it spell, physical, or from code, you can't actually detect what spell that damage came from. Poison arrows are a pseudo magic/physical attack, meaning that they can be evaded like regular physical attacks.

...

Will there ever be a system that can index attacks? No, it's impossible to index projectiles.

I don't think you need to index projectiles. He said the spell is supposed to be melee (what doesn't make much sense for a spell named poison arrow, but whatever).

As a unit has only one unique way to deal untriggered physical damage it would be sufficient to check whether the attack from this unit was physical, then check if the skill is active and then apply the (spell-)damage.

A problem could arise from physical splash damage but that would only affects catapults not heros, so no problem here.
 
Status
Not open for further replies.
Top