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

Danku by Daffa the Mage v1.2.0

  • Like
Reactions: deepstrasz
DANKU

Skill Description : Byakuya creates an invisible barrier, this barrier repels any incoming damage by 100%, at a maximum reduction of 150/250 damage. Any damage exceed 100/200 damage will not be reduced. Last 1/2 seconds.
The skill is inspired from Bleach Series.

Preference :
Make sure "Automatically creates Unknown Variables when pasting trigger data" is ticked on

Object Editor :
Copy and Paste "Bakudo #81 : Danku" and "Danku Buff Giver" abilities to your map
Copy and Paste "Danku" buff to your map

Trigger Editor :
Copy and Paste "Requirement" (if you don't have them already in your map), and "Danku" folders to your map
Configure the spell using the instructions in the "Danku Config"

==================================================================
  • Danku Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Ability and Buff Base for Danku - set this to correct values, make sure to copy them from Object Editor --------
      • Set Danku_Abil = Bakudo #81 : Danku
      • Set Danku_Dummy = Dummy
      • Set Danku_DummyAbil = Danku Buff Giver
      • Set Danku_Buff = Danku
      • -------- Point this to Danku Duration Trigger --------
      • Set Danku_DurTrig = Danku Duration <gen>
      • -------- Spell duration --------
      • Set Danku_Duration[1] = 1.00
      • Set Danku_Duration[2] = 2.00
      • -------- Set this to true if duration is greather than 0.00 --------
      • -------- Else set it to false or you will get bugged --------
      • Set Danku_HasTimeLimit = True
      • -------- Maximum Allowed Repel (any damage exceeding this will not get reduced or will not nullified) --------
      • Set Danku_MaxDamage[1] = 100.00
      • Set Danku_MaxDamage[2] = 200.00
      • -------- Amount of Dispelled damage --------
      • Set Danku_ShieldAmount[1] = 150.00
      • Set Danku_ShieldAmount[2] = 250.00
      • -------- Some additional booleans, read the description of each --------
      • -------- Nullify till max damage if damage exceeds the max shield of Danku --------
      • -------- In another meaning, any damage taken before the shield disappear will get blocked --------
      • Set Danku_NullOverMaxDamage = False
      • -------- If False, SFX will be left behind at cast point (and it looks VERY bad for most SFX) --------
      • Set Danku_SFX_Attached = True
      • -------- Some eyecandies --------
      • Set Danku_SFX = Abilities\Spells\Human\DivineShield\DivineShieldTarget.mdl
      • Set Danku_SFX_Attach = origin
      • -------- SKIP BELOW THIS LINE --------
      • -------- I WARN YOU TO SKIP! --------
      • -------- BELOW ARE SAFETY FAIL --------
      • -------- I DON'T HELD ANY RESPOSIBILITY FOR ANY BROKEN PART OF THE SPELL --------
      • -------- IF YOU MODIFY BELOW THIS LINE --------
      • -------- DO AT RISK! --------
      • Custom script: set udg_Danku_Timer = 0.03125
      • Trigger - Add to Danku_DurTrig the event (Time - Every Danku_Timer seconds of game time)
  • Danku Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Danku_Abil
    • Actions
      • -------- Register Data --------
      • Set Danku_SpellCaster = (Triggering unit)
      • Set Danku_SpellTarget = (Target unit of ability being cast)
      • Set Danku_Value = (Custom value of Danku_SpellTarget)
      • Set Danku_Level = (Level of Danku_Abil for Danku_SpellCaster)
      • -------- Begin Calculation --------
      • Set Danku_ShieldLeft[Danku_Value] = Danku_ShieldAmount[Danku_Level]
      • Set Danku_MaxDamageTaken[Danku_Value] = Danku_MaxDamage[Danku_Level]
      • -------- Check --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Danku_UnitIsAffected[Danku_Value] Equal to False
        • Then - Actions
          • -------- Register Data --------
          • Set Danku_Loc = (Position of Danku_SpellTarget)
          • -------- Dummy Buffing --------
          • Unit - Create 1 Danku_Dummy for Neutral Passive at Danku_Loc facing Default building facing degrees
          • Set Danku_TempDum = (Last created unit)
          • Unit - Add Danku_DummyAbil to Danku_TempDum
          • Unit - Order Danku_TempDum to Human Priest - Inner Fire Danku_SpellTarget
          • Unit - Add a 1.00 second Generic expiration timer to Danku_TempDum
          • -------- SFX --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Danku_SFX_Attached Equal to True
            • Then - Actions
              • Special Effect - Create a special effect attached to the Danku_SFX_Attach of Danku_SpellTarget using Danku_SFX
            • Else - Actions
              • Special Effect - Create a special effect at Danku_Loc using Danku_SFX
          • Set Danku_SFX_Unit[Danku_Value] = (Last created special effect)
          • Set Danku_UnitIsAffected[Danku_Value] = True
          • Custom script: call RemoveLocation(udg_Danku_Loc)
        • Else - Actions
          • -------- All the bonus already applied, so we ignore this part --------
      • -------- Duration --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Danku_HasTimeLimit Equal to True
        • Then - Actions
          • Set Danku_Instance = (Danku_Instance + 1)
          • Set Danku_DurLeft[Danku_Value] = Danku_Duration[Danku_Level]
          • Unit Group - Add Danku_SpellTarget to Danku_UnitGroup
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Danku_Instance Equal to 1
            • Then - Actions
              • Trigger - Turn on Danku_DurTrig
            • Else - Actions
        • Else - Actions
  • Danku Shield
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
    • Actions
      • -------- Check --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (target has buff Danku_Buff) Equal to True
        • Then - Actions
          • -------- Register --------
          • Set Danku_SpellTarget = target
          • Set Danku_Value = (Custom value of Danku_SpellTarget)
          • -------- Blocking damage --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Danku_ShieldLeft[Danku_Value] Greater than or equal to amount
            • Then - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • amount Greater than Danku_MaxDamageTaken[Danku_Value]
                • Then - Actions
                  • -------- Maximal block attempt --------
                  • Set Danku_ShieldLeft[Danku_Value] = (Danku_ShieldLeft[Danku_Value] - amount)
                  • Set amount = (amount - Danku_MaxDamageTaken[Danku_Value])
                • Else - Actions
                  • -------- Total block --------
                  • Set Danku_ShieldLeft[Danku_Value] = (Danku_ShieldLeft[Danku_Value] - amount)
                  • Set amount = 0.00
            • Else - Actions
              • -------- Last block --------
              • Unit - Remove Danku_Buff buff from Danku_SpellTarget
              • -------- SFX --------
              • Special Effect - Destroy Danku_SFX_Unit[Danku_Value]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Danku_NullOverMaxDamage Equal to True
                • Then - Actions
                  • -------- Total block --------
                  • Set amount = 0.00
                • Else - Actions
                  • -------- Normal block --------
                  • Set amount = (amount - Danku_ShieldLeft[Danku_Value])
              • -------- Reset --------
              • Set Danku_ShieldLeft[Danku_Value] = 0.00
              • Set Danku_DurLeft[Danku_Value] = 0.00
              • Set Danku_UnitIsAffected[Danku_Value] = False
        • Else - Actions
  • Danku Duration
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in Danku_UnitGroup and do (Actions)
        • Loop - Actions
          • -------- Register --------
          • Set Danku_SpellTarget = (Picked unit)
          • Set Danku_Value = (Custom value of Danku_SpellTarget)
          • -------- Reduce timer --------
          • Set Danku_DurLeft[Danku_Value] = (Danku_DurLeft[Danku_Value] - Danku_Timer)
          • -------- Check --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Danku_DurLeft[Danku_Value] Less than or equal to 0.00
            • Then - Actions
              • -------- Unregister --------
              • Unit - Remove Danku_Buff buff from Danku_SpellTarget
              • Special Effect - Destroy Danku_SFX_Unit[Danku_Value]
              • Unit Group - Remove Danku_SpellTarget from Danku_UnitGroup
              • Set Danku_ShieldLeft[Danku_Value] = 0.00
              • Set Danku_Instance = (Danku_Instance - 1)
              • Set Danku_UnitIsAffected[Danku_Value] = False
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Danku_Instance Equal to 0
                • Then - Actions
                  • Trigger - Turn off Danku_DurTrig
                • Else - Actions
            • Else - Actions

===================================================================

Update, fixed a major bug with the shield and remove location properly now

Update, fixed most issues

Major update, mainly making it more supportive


===================================================================
CREDITS :
Bribe : Unit Indexer
Looking_for_help : Damage Detection System
===================================================================
AUTHOR NOTES :
I plan to release a spell pack for Byakuya Kuchiki, but until then, here's something I can give to everyone.
===================================================================

Keywords:
Byakuya, Kuchiki, Byakuya Kuchiki, Shield, Resistance, Danku, Bakudo, Bakudo #81, Bleach, Bakudo #81 : Danku, Barrier

If you like this work and wish to support me financially, you can support me via Ko-fi.
Contents

Byakuya Spell Pack (Map)

Reviews
14:19, 17th Feb 2015 IcemanBo: Works as intended. One dummy could be used. Tooltip could be improved. (adapted to levels) 03:33, 03th Feb 2015 IcemanBo...
- Make it support multiple levels.
- In "Dunku Shield" trigger you make many similar operations. They probably can be merged somehow.
- One global dummy could be used.
- No need of these safety checks at config for damage and duration. Just let it be.
- Add import instructions.
- Why in buff description is explained it only nullifies magic damage?

And btw, I think something in the description is stretching the page.

Needs Fix
 
- Make it support multiple levels.
- In "Danku Shield" trigger you make many similar operations. They probably can be merged somehow.
- One global dummy could be used.
- No need of these safety checks at config for damage and duration. Just let it be.
- Add import instructions.
- Why in buff description is explained it only nullifies magic damage?

And btw, I think something in the description is stretching the page.

Needs Fix
Will maximize it's support.

I'll think of a workaround.

Forget about that, thanks! Will turn the dummy into 1 dummy.

Okay, I'll remove the safety checks.

Thanks, forget this little important thing.

The default is that it only nullifies magic damage. But for actual testing, I have to give a real effect by turning the physical and code damages on. I'll fix it when I can.

Well, I found out the title is too big, will fix it.
 
No need to destroy the effect and create a new one if unit is already registered. Just keep the old. :)

  • Set Danku_SpellTarget = (Picked unit)
  • Set Danku_Value = (Custom value of Danku_SpellTarget)
^This is not needed if Danku duration ends. The variables are already set before.
I like it that you make all group operations optional.

In DankuShield, when the limit is reached and you remove Danku...
you can check if unit was in Group, so you can directly remove it and
decrement the grouo counter. (no need to wait the duration it that case)

  • Custom script: set udg_Danku_UnitGroup = CreateGroup()
^Do not do this. You overwrite an already existing group. -> Leak.

Your demo map should demonstrate your spell. Make at least 2 levels, please.
I think it is helpful for user, too.
Also it would be nice your tooltip would be adapted to levels.

Fixed all except the One Global Dummy
Hm.. it is really no effort at all actually:

Init:
Unit - Create Dummy At Point
Set MyDummy = LastCreatedUnit
Unit - Add <ability> to Mydummy

onCast:
Unit - Move MyDummy to Point
Unit - Order MyDummy to....

Finished. One dummy for all casts.
______________________________________

Else the system is fairly simple and easy to use.
 
No need to destroy the effect and create a new one if unit is already registered. Just keep the old. :)

  • Set Danku_SpellTarget = (Picked unit)
  • Set Danku_Value = (Custom value of Danku_SpellTarget)
^This is not needed if Danku duration ends. The variables are already set before.
I like it that you make all group operations optional.

In DankuShield, when the limit is reached and you remove Danku...
you can check if unit was in Group, so you can directly remove it and
decrement the grouo counter. (no need to wait the duration it that case)

  • Custom script: set udg_Danku_UnitGroup = CreateGroup()
^Do not do this. You overwrite an already existing group. -> Leak.

Your demo map should demonstrate your spell. Make at least 2 levels, please.
I think it is helpful for user, too.
Also it would be nice your tooltip would be adapted to levels.

Hm.. it is really no effort at all actually:

Init:
Unit - Create Dummy At Point
Set MyDummy = LastCreatedUnit
Unit - Add <ability> to Mydummy

onCast:
Unit - Move MyDummy to Point
Unit - Order MyDummy to....

Finished. One dummy for all casts.
______________________________________

Else the system is fairly simple and easy to use.
1. Okay, fixed that.
2. I'm not sure, though I think it should be working properly, applying change.
3. Instead, I think it's better to insert a check for the buff inside the loop, since the buff can be dispelled (Inner Fire).
4. Added 2nd level and improves tooltip a little.
5. For some reason, the dummy malfunctions when I did that, can I stick with the current? I changed it to only applies whenever the buff is lost when the spell is cast (first cast, after the shield breaks and so on), not every cast (the buff last like 1 million seconds).

These changes applies in the next update later.
 
Top