• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Custom Buffs

Status
Not open for further replies.
Level 8
Joined
Apr 30, 2009
Messages
338
I have 2 spells that are interacting oddly. They are 100% triggered and based on channel.

Spell 1 - Mortal Wound
Deals damage and stops target from going over 75% max HP for 10 seconds.

It creates a dummy unit that casts a hardcoded Undead Banshee - Curse with 0 in all fields except 10 duration. Puts unit in a hashtable. Runs second trigger every 0.03 seconds, if unit is over 75%, it sets HP to 75%. Removes the buff after 10 seconds and then clears the hashtable.
  • Mortal Wound 01
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BRS-5 Mortal Wound
    • Actions
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (0.25 x (Life of (Target unit of ability being cast))) damage of attack type Hero and damage type Normal
      • Special Effect - Create a special effect attached to the weapon, left of (Triggering unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the weapon, right of (Triggering unit) using Abilities\Spells\Other\Stampede\StampedeMissileDeath.mdl
      • Special Effect - Destroy (Last created special effect)
      • Special Effect - Create a special effect attached to the chest of (Target unit of ability being cast) using Objects\Spawnmodels\Orc\Orcblood\OrdBloodWyvernRider.mdl
      • Special Effect - Destroy (Last created special effect)
      • Set temp_point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 D.BRS-5 Mortal Wound for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Undead Banshee - Curse (Target unit of ability being cast)
      • Hashtable - Save 10.00 as (Key duration) of (Key (Target unit of ability being cast)) in H_MortalWound
      • Hashtable - Save 75.00 as (Key hpmax) of (Key (Target unit of ability being cast)) in H_MortalWound
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in G_MortalWound) Equal to False
        • Then - Actions
          • Unit Group - Add (Target unit of ability being cast) to G_MortalWound
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Mortal Wound 02 <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Mortal Wound 02 <gen>
        • Else - Actions
  • Mortal Wound 02
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in G_MortalWound) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in G_MortalWound and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key duration) of (Key (Picked unit)) from H_MortalWound) Greater than 0.00
                • Then - Actions
                  • Special Effect - Create a special effect attached to the chest of (Picked unit) using Objects\Spawnmodels\Critters\Albatross\CritterBloodAlbatross.mdl
                  • Special Effect - Destroy (Last created special effect)
                  • Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from H_MortalWound) - R_FRAME_PROJECTILES) as (Key duration) of (Key (Picked unit)) in H_MortalWound
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Percentage life of (Picked unit)) Greater than (Load (Key hpmax) of (Key (Picked unit)) from H_MortalWound)
                    • Then - Actions
                      • Unit - Set life of (Picked unit) to (Load (Key hpmax) of (Key (Picked unit)) from H_MortalWound)%
                    • Else - Actions
                • Else - Actions
                  • Unit - Remove ~BRS-5 Mortal Wound (Berserker) buff from (Picked unit)
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_MortalWound
                  • Unit Group - Remove (Picked unit) from G_MortalWound
        • Else - Actions
          • Trigger - Turn off (This trigger)

Spell 2 - Lethal Poison
Poisons the unit and makes it take damage equal to its currently missing HP over the next 10 seconds.

It creates a dummy unit that casts a hardcoded Undead Banshee - Curse with 0 in all fields except 10 duration. Puts unit in a hashtable. Runs second trigger every 0.20 seconds to cause the damage. Removes after 10 seconds.
  • Lethal Poison 01
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to ASN-5 Lethal Poison
    • Actions
      • Set temp_point = (Position of (Target unit of ability being cast))
      • Unit - Create 1 D.ASN-5 Lethal Poison for (Owner of (Triggering unit)) at temp_point facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_temp_point)
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Undead Banshee - Curse (Target unit of ability being cast)
      • Hashtable - Save ((1.00 x ((Max life of (Target unit of ability being cast)) - (Life of (Target unit of ability being cast)))) / (11.00 - (Real((Level of (Ability being cast) for (Triggering unit)))))) as (Key damage) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • Hashtable - Save (11.00 - (Real((Level of (Ability being cast) for (Triggering unit))))) as (Key duration) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • Hashtable - Save Handle Of(Triggering unit) as (Key caster) of (Key (Target unit of ability being cast)) in H_LethalPoison
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Target unit of ability being cast) is in G_LethalPoison) Equal to False
        • Then - Actions
          • Unit Group - Add (Target unit of ability being cast) to G_LethalPoison
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Lethal Poison 02 <gen> is on) Equal to False
        • Then - Actions
          • Trigger - Turn on Lethal Poison 02 <gen>
        • Else - Actions
  • Lethal Poison 02
    • Events
      • Time - Every 0.20 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in G_LethalPoison) Greater than 0
        • Then - Actions
          • Unit Group - Pick every unit in G_LethalPoison and do (Actions)
            • Loop - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) Greater than 0.00
                • Then - Actions
                  • Unit - Cause (Load (Key caster) of (Key (Picked unit)) in H_LethalPoison) to damage (Picked unit), dealing ((Load (Key damage) of (Key (Picked unit)) from H_LethalPoison) x R_FRAME_OVERTIME) damage of attack type Hero and damage type Poison
                  • Hashtable - Save ((Load (Key duration) of (Key (Picked unit)) from H_LethalPoison) - R_FRAME_OVERTIME) as (Key duration) of (Key (Picked unit)) in H_LethalPoison
                • Else - Actions
                  • Unit - Remove ~ASN-5 Lethal Poison (Assassin) buff from (Picked unit)
                  • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in H_LethalPoison
                  • Unit Group - Remove (Picked unit) from G_LethalPoison
        • Else - Actions
          • Trigger - Turn off (This trigger)
The hardcoded curse spells are different, one is named BRS-5, the other is named ASN-5. The buffs placed are also different, and only really exist for the graphic effect and the buff tooltip.

My problem is that if a unit has one of the buffs, and the other one is cast, both buffs disappear but the triggered damage still occurs. So my question is do I have to change the SPELLS to be based off different hardcoded spells, or can I have both SPELLS based on curse with a different base BUFF?

attachment.php

attachment.php


attachment.php

attachment.php
 

Attachments

  • abil_mortal.jpg
    abil_mortal.jpg
    125.1 KB · Views: 214
  • abil_lethal.jpg
    abil_lethal.jpg
    128.2 KB · Views: 179
  • buff_mortal.jpg
    buff_mortal.jpg
    67 KB · Views: 180
  • buff_lethal.jpg
    buff_lethal.jpg
    70.6 KB · Views: 186
Level 8
Joined
Apr 30, 2009
Messages
338
so unless it is based on channel, I have to base it off a different hardcoded spell for the base id to change?
 
Level 14
Joined
Nov 18, 2007
Messages
1,084
WC3 buffs can't stack as far as I know. (Except for Aura buffs)
That's why odd things happen when you're using Curse to place two different buffs. It doesn't matter that they're different; the buffs won't stack.
You're better off using another spell that will place that buff on that unit. (Maybe Unholy Frenzy, Lightning Shield, etc.)
 
Level 8
Joined
Apr 30, 2009
Messages
338
I think I'm just gonna try doing the trick of giving self-only auras in an invisible spellbook and not bother with dummy units unless absolutely needed (like if the buff has to silence, then I would have to use a dummy to cast soul burn)
 
Status
Not open for further replies.
Top