• 🏆 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!

Mortal Strike and Cold arrows

Status
Not open for further replies.
Level 7
Joined
Mar 24, 2008
Messages
184
Hi,
I'm creating a single player RPG map, with a Ranger hero (nothing special, it's just my first map, though i had to struggle a lot with triggers to make a full working and bug free 24h Shadowmeld). Now i'm having some troubles with 2 skills i gave her.
i made 2 custom skills, Precision (from Neutral Mortal Strike, not the hero one) and Poisoned arrows (from Frost Arrows), i've just realized that when i activate poisoned arrows, then Mortal Strike won't work (unless i've been very unlucky in the last 30 mins of tests and getting Mortal strikes only when i disable poisoned arrows :slp:)

just in case, i warn you i'm using the italian version of the game so some skill names could be wrong (trying to traslate at my best), Mortal Strike is the one Spirit Wolves have (make more damage on chance), While Frost arrows is the one from Vashj (or was it Cold Arrows from Sylvanas...oh well i don't think it's important)

Is there any way to make Mortal Strike work even while i activate Poisoned arrows? I don't mind using Complex triggers or JASS, if required.

EDIT

I've been thinking to a solution since this morning, and got some ideas i could use but i'm having some troubles in developing them.
All i need is something that will emulate Mortal Strike (or Critical strike or whatever the name).
For now i'm working with GUI but the more i use it the more i want to change to JASS (i just wish i had enough time to read tutorials properly), and theese were the solutions i could think of:

- on chance, when my unit uses the "Poisoned arrows" ability (so it doesn't require to create a dummy unit all the time) start attacking a dummy unit created in the same position of the attacked unit (make it follow the attacked unit so it won't appear arrows stop in the middle of nowhere if the enemy is moving), calculate the damage, make it x3, remove dummy and apply the damage to the enemy.
The problem in this solution is i'm not sure how to tell my unit to stop attacking and attack the dummy instead (does "attacking unit" value work even if i didn't specify a "Unit is attacking" event?)

- Another solution could be, when a unit takes damage and it has the poisoned arrow buff, then get the damage done, make it x2 (the unit got the normal damage already) and apply to the unit. Even in this case, by using GUI i'm having some problems because it doesn't exist the "Generic unit event - Unit takes damage" but it exists only as Specific unit event, and even here i'm not sure if i can use "Damage Taken" as value if i don't specify a "unit takes damage" event

I hope i've been clear and sorry if i didn't write the solutions in GUI, i'm just not 100% sure on how to do it
 
Last edited:
Level 19
Joined
Oct 12, 2007
Messages
1,821
Mortal strike is called Critical Strike hehe:D

I'm not a big trigger pro or something, but you can try something like this:
When a unit starts the effect of an ability equal to Poison Arrows some actions start.
If then else: level of poison arrows equal to X, do multiple actions.
Order Casting/Triggering Unit to damage target unit of ability being cast for Y * (Level of Critical strike for hero).

X is the level of the poison arrow spell.
Y is the damage a non-crit poison arrow deals.

So this actually does the poison arrow damage again. That makes it 2 times as as strong if Critical strike is level 1. If critical strike is level 2 it makes it 3 times as strong.

If you want the floating texts you should find out which size it is and the exact colour.. I don't know that, but your text should be something like this:

"Y * ((Level of Critical Strike for Triggering Unit) +1)".

(if your critical strike has 2.00 damage on level 1, 3.00 damage on level 2 and 4.00 damage on level 3.. etc. This should work.. Else just look a bit at the numbers and change some things.)

Hope this was helpful, however you might get better solutions, because I never did jass before;)

Good luck with your RPG.
 
Level 7
Joined
Mar 24, 2008
Messages
184
Critical Strike, Yeah i noticed by surfing around The Hive Workshop (weird translators...)

well anyway, i thought of something like that, but there's a problem.
Poison arrow works like Frost arrows (cold arrows, searing arrows and so on), it's on autocast (so i can't use any of the Unit casts ability events, at least i tried and it didn't work), and it deals additional damage to the normal hero damage (so i can't just set a number for it), so i need something to pick hero's damage and multiply it x3 or some new event (maybe with JASS) that will trigger when a unit deals damage or a "Generic Unit - unit is damaged" event (which doesn't exist in GUI)
 
Last edited:
Level 19
Joined
Oct 12, 2007
Messages
1,821
Maybe something like this:

Unit takes damage from a unit
Attacking unit is equal to 'Ranger'

If level of Critical Strike/Mortal Strike (haha) of Attacking Unit is equal to 1 do actions:
If random percentage is less then or equal to 15 do actions:
Order Attacking unit to deal X damage to Attacked Unit.
Floating Texts etc....


Here you can call a passive ability like Attribute Bonus, Critical Strike. So it has no effect. The only effect will be this trigger...
But it is not very good, because you can't track attack bonusses like claw of attack. So all you could do for X is something like ((Agility x 1) + Level of Attacking Unit) or something... However that wont really work either.

But this might give you some idea's..



(btw i am making an RPG too, with exactly the same thing.. I didn't think about the problem yet.. But I have ranged hero's with poison/cold arrows + critical strike too.. So if you might get a solution please tell me what you've got hehe)
 
Level 13
Joined
Mar 16, 2008
Messages
941
Use a 0% Critstrike, just for the button (or another dummy ability)

Then you have to trigger the "Any unit takes damage" workaround:

  • Critical Strike Init
  • Events:A unit enters (Playable Map)
  • Actions:Add to trigger (Critical Strike) the event ((Entering unit) takes damage)
Second trigger without an event (since the 1. one does this)
  • Critical Strike
  • Event:
  • Condition:Level of (Crit Strike) for (damage source) >= 1
  • Actions:Unit-Cause (damage source) to damage (attacked unit) by ((damage taken) * (Level of (Crit Strike) for (damage source))
 
Level 7
Joined
Mar 24, 2008
Messages
184
Use a 0% Critstrike, just for the button (or another dummy ability)

Then you have to trigger the "Any unit takes damage" workaround:

  • Critical Strike Init
  • Events:A unit enters (Playable Map)
  • Actions:Add to trigger (Critical Strike) the event ((Entering unit) takes damage)
Second trigger without an event (since the 1. one does this)
  • Critical Strike
  • Event:
  • Condition:Level of (Crit Strike) for (damage source) >= 1
  • Actions:Unit-Cause (damage source) to damage (attacked unit) by ((damage taken) * (Level of (Crit Strike) for (damage source))

For some reason the event a unit enters playable map doesn't work, if it was meant to be used to set every unit in the map to have the specific unit - unit takes damage event in the other trigger.
I made this solution instead and it seems to work but, though i'm not a great mapper, i feel like this solution with GUI is a Leak Party, not counting the fact it has to a navigate an array at every attack of the unit with this skill (thanks god there's only 1 unit in my map). I'm even Ashamed to post it, but it's the only solution i managed to make it work

you need a Dummy skill (Crit Strike), an array of units (attacked) set to "No Unit", 3 integers (i, j, k) All set to 0, 1 real (Damage) set to 0.00 and a boolean (Damaged) set to TRUE
Trigger 1, this trigger will add in the array every Distinct unit attacked by your unit, also an event with the unit you attack takes damage. (i had to do so because if you add multiple times the same event it will deal more than once the damage)

  • Critical Strike Init
  • Events:
    • Unit - A unit is under attack
  • Conditions:
    • Level of (Crit Strike) for (Attacking unit) >= 1
  • Actions:
    • For each (Integer j) from 0 to i, do (Actions)
      • Loop - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - conditions
            • (attacked[j] equals to (Attacked unit)) or (attacked[j] equals to No unit )
          • Then - Actions
            • Set k = (k + 1)
          • Else - Actions
            • Do nothing
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • k Equals to 1
      • Then - Actions
        • Set attacked[i] = (Attacked unit)
        • Trigger - Add to Critical <gen> the event (Unit - attacked[i] is damaged)
        • Set i = (i + 1)
      • Else - Actions
        • Do nothing
    • Set k = 0
Second trigger, no event because they will be added by the other trigger
- I had to add Damage > 0 because otherwise it could've procced even from skills that dealt damage but it was set to 0 (for example damage over time from poisons)
- 20% is the crit chance for my skill
- also i had to add the condition with the boolean otherwise it would've iterated itself to infinity (i mean => Action: deal damage to unit Event: a unit takes damage, get it?)
- There was no need for the variable Damage indeed but it was left from various experiments so i kept it

  • Critical
  • Events:
  • Conditions:
    • (Damage taken) > 0.00
    • (Random integer number between 0 and 100) < 20
    • Level of (Crit Strike) for (Attacking unit) >= 1
    • Damaged Equals to TRUE
  • Actions:
    • Set Damage = ((Damage taken) x (Level of (Crit Strike) for (damage source)))
    • Set Damaged = FALSE
    • Unit - Cause (Damage source) to damage (Triggering unit), dealing Damage damage of attack type Caos and damage type Normal
    • Set Damaged = TRUE
even with leaks and stuff, it works (tested), so i hope it could be of help for your RPG (GL with that aswell, my hero is a Ranger too :D ). Thanks and rep for everyone, and more to thoose who will help me optimizing this trigger (or making a better one)
 
Last edited:
Status
Not open for further replies.
Top