• 🏆 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!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

Help me with this please :3

Status
Not open for further replies.
Level 12
Joined
Nov 3, 2013
Messages
989
You could use the passive ability "Incinerate" which works just like this, it's an orb effect though if that's a problem.

Making it with a DDS shouldn't be too hard unless I'm missing something?
 
Level 12
Joined
Nov 3, 2013
Messages
989
you would do dynamic indexing for attacking and attacked unit and then each time compare attacked unit variable with tempUnit variable.

if tempUnit = attackedUnit[index] then set damage[index] = damage[index] + damageIncrease[index]

else set damage[index] = damageIncrease[index] or 0 if you want the bonus damage to only count from the 2nd strike

edit: note that if you don't need MUI or MPI you won't even need the array
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
  • Untitled Trigger 004
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • *Use some condition here*
    • Actions
      • Set u1 = (Attacking unit)
      • Set u2 = (Attacked unit)
      • Custom script: set udg_i = GetHandleId(udg_u1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 0 of i in ht) Equal to u2
        • Then - Actions
          • Set k = (Load 0 of i from ht)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • k Less than 5 <- Max ability level
            • Then - Actions
              • Set k = (k + 1)
              • Hashtable - Save k as 0 of i in ht
              • Unit - Increase level of *ability* for u1
            • Else - Actions
        • Else - Actions
          • Set k = 1
          • Hashtable - Save k as 0 of i in ht
          • Hashtable - Save Handle Ofu2 as 0 of i in ht
          • Unit - Add *ability* to u1
      • Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: (String(k))

This is how it would look with a hashtable. Remember to initialize the hashtable.
 
Level 12
Joined
Nov 3, 2013
Messages
989
You're adding damage through ability levels instead of just dealing more damage?

I think it's better to just modify the damage dealt by adding damage increase times k since you're going to be using a DDS instead of attack event anyway, right?

Edit: Actually you might want to use levels of a dummy ability like maker to show how many stacks you've got (I didn't think of it before), it should be for eyes only though as adding damage after damage is already dealt wouldn't work out very well (since maker didn't actually mention that the ability would add damage he might just have left the damage modification part out since I'm guessing he didn't bother to import a DDS to a new map just for this)

Otherwise if the idea is to actually add damage and use attack event... well it would work as long as nobody spam stop and attack on the same target for free stacks...
 
Last edited:
Level 9
Joined
Feb 15, 2013
Messages
372
  • Untitled Trigger 004
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • *Use some condition here*
    • Actions
      • Set u1 = (Attacking unit)
      • Set u2 = (Attacked unit)
      • Custom script: set udg_i = GetHandleId(udg_u1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Load 0 of i in ht) Equal to u2
        • Then - Actions
          • Set k = (Load 0 of i from ht)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • k Less than 5 <- Max ability level
            • Then - Actions
              • Set k = (k + 1)
              • Hashtable - Save k as 0 of i in ht
              • Unit - Increase level of *ability* for u1
            • Else - Actions
        • Else - Actions
          • Set k = 1
          • Hashtable - Save k as 0 of i in ht
          • Hashtable - Save Handle Ofu2 as 0 of i in ht
          • Unit - Add *ability* to u1
      • Game - Display to Player Group - Player 1 (Red) for 5.00 seconds the text: (String(k))

This is how it would look with a hashtable. Remember to initialize the hashtable.

Hmm... Im not good in hash, is it the 'i' variable is set at the custom script as the handle of attacked unit?
So, the load 0, that 0 is what? 0 is 'k'? is 'k' the instances of each attack added? and if load 0 of 'i' not = 'k' then reset the instances?
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
i is the handle (unique id) of the attacker.
k is how many times the unit has been attacked in a row by the same attacker.
The 0 is just a key, like a coordinate or address where the data is stored.

The first 0 of i loaded, compared to u2 is a unit comparison. If the attacked unit is different than the last attaced unit, it resets the instances.
 
Status
Not open for further replies.
Top