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

Blind v1.1.0

Introduction
This spell was requested by BunnyAng at Kawaii Spell Workshop.
I was the one who handle the request.
Permission for upload can be found Here

Trigger
  • Blind Config
    • Events
      • Map initialization
    • Conditions
    • Actions
      • -------- Important Stuff! Setup them correctly! --------
      • Set BL_BlindAbility = Blind
      • Set BL_BlindAbilityVisionReducer = Blind Vision
      • Set BL_BlindAbilityDisableAttack = Blind Disable
      • Set BL_BlindDebuffAbility = Blind Debuff
      • Set BL_BlindDebuff = Blind
      • Set BL_DummyType = Dummy
      • -------- Customizable Effects --------
      • -------- Blinded unit can't attack (disables Confuse) --------
      • Set BL_BlindDisablesAttack = True
      • -------- Blinded unit takes more X damage from Y attack type --------
      • Set BL_BlindIncreaseMagicalDamage = True
      • Set BL_BlindIncreasePhysicalDamage = True
      • Set BL_BlindIncreaseTriggerDamage = True
      • -------- Blinded unit may attack allies or enemies (completely random) --------
      • Set BL_BlindConfuseTargetAttack = False
      • -------- Confusion Range (ConfuseTargetAttack must be true) --------
      • Set BL_ConfusionRange = 600.00
      • -------- New Damage Rate --------
      • Set BL_MagicalRate = 1.25
      • Set BL_PhysicalRate = 1.75
      • Set BL_TriggeredRate = 1.25
      • Set BL_ShowNewDamageRateText = True
      • -------- Duration of Blind --------
      • Set BL_BlindDuration[1] = 1.00
      • Set BL_BlindDuration[2] = 2.00
      • Set BL_BlindDuration[3] = 3.00
      • Set BL_BlindDuration[4] = 4.00
      • -------- END CONFIG --------
      • Custom script: set udg_BL_BlindLoopSpeed = 0.03125
      • Trigger - Add to Blind Loop <gen> the event (Time - Every BL_BlindLoopSpeed seconds of game time)
      • -------- Securities (Avoid unwated behaviors) --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BL_BlindIncreasePhysicalDamage Equal to False
          • BL_BlindIncreaseMagicalDamage Equal to False
          • BL_BlindIncreaseTriggerDamage Equal to False
        • Then - Actions
          • Set BL_ShowNewDamageRateText = False
          • Trigger - Turn off Blind Damage Text <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BL_BlindDisablesAttack Equal to True
        • Then - Actions
          • Set BL_BlindConfuseTargetAttack = False
        • Else - Actions
  • Blind Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to BL_BlindAbility
    • Actions
      • Set BL_CastingUnit = (Triggering unit)
      • Set BL_TargetUnit = (Target unit of ability being cast)
      • Set TargetValue = (Custom value of BL_TargetUnit)
      • Set HeroLevel = (Level of BL_BlindAbility for BL_CastingUnit)
      • Set BL_BlindedUnitDuration[TargetValue] = BL_BlindDuration[HeroLevel]
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (BL_TargetUnit has buff BL_BlindDebuff) Equal to True
        • Then - Actions
          • Skip remaining actions
        • Else - Actions
      • Unit - Add BL_BlindAbilityVisionReducer to BL_TargetUnit
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BL_BlindDisablesAttack Equal to True
        • Then - Actions
          • Unit - Add BL_BlindAbilityDisableAttack to BL_TargetUnit
        • Else - Actions
      • Set BL_TempPoint = (Position of BL_CastingUnit)
      • Unit - Create 1 BL_DummyType for (Owner of BL_CastingUnit) at BL_TempPoint facing Default building facing degrees
      • Custom script: call RemoveLocation(udg_BL_TempPoint)
      • Set BL_BlindDummy = (Last created unit)
      • Unit - Add BL_BlindDebuffAbility to BL_BlindDummy
      • Unit - Order BL_BlindDummy to Undead Banshee - Curse BL_TargetUnit
      • Unit - Add a 1.00 second Generic expiration timer to BL_BlindDummy
      • Unit Group - Add BL_TargetUnit to BL_BlindGroup
      • Set BL_Counter = (BL_Counter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BL_Counter Equal to 1
        • Then - Actions
          • Trigger - Turn on Blind Loop <gen>
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BL_BlindConfuseTargetAttack Equal to True
        • Then - Actions
          • Set BL_TempPoint = (Position of BL_TargetUnit)
          • Set BL_RandomTargetGroup = (Units within BL_ConfusionRange of BL_TempPoint)
          • Set BL_RandomTarget = (Random unit from BL_RandomTargetGroup)
          • Unit - Order BL_TargetUnit to Attack BL_RandomTarget
          • Custom script: call RemoveLocation(udg_BL_TempPoint)
          • Custom script: call DestroyGroup(udg_BL_RandomTargetGroup)
        • Else - Actions
  • Blind Loop
    • Events
    • Conditions
    • Actions
      • Unit Group - Pick every unit in BL_BlindGroup and do (Actions)
        • Loop - Actions
          • Set BL_TargetUnit = (Picked unit)
          • Set TargetValue = (Custom value of BL_TargetUnit)
          • Set BL_BlindedUnitDuration[TargetValue] = (BL_BlindedUnitDuration[TargetValue] - BL_BlindLoopSpeed)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • BL_BlindedUnitDuration[TargetValue] Less than or equal to 0.00
            • Then - Actions
              • Set BL_TargetUnit = (Picked unit)
              • Unit Group - Remove BL_TargetUnit from BL_BlindGroup
              • Set BL_Counter = (BL_Counter - 1)
              • Unit - Remove BL_BlindAbilityVisionReducer from BL_TargetUnit
              • Unit - Remove BL_BlindDebuff buff from BL_TargetUnit
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BL_BlindDisablesAttack Equal to True
                • Then - Actions
                  • Unit - Remove BL_BlindAbilityDisableAttack from BL_TargetUnit
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BL_BlindConfuseTargetAttack Equal to True
                • Then - Actions
                  • Unit - Order BL_TargetUnit to Stop
                • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • BL_Counter Equal to 0
                • Then - Actions
                  • Trigger - Turn off Blind Loop <gen>
                • Else - Actions
            • Else - Actions
  • Blind Damage Text
    • Events
      • Game - damageEventTrigger becomes Equal to 1.00
    • Conditions
      • ((Triggering unit) has buff BL_BlindDebuff) Equal to True
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • damageType Equal to PHYSICAL
          • BL_BlindIncreasePhysicalDamage Equal to True
        • Then - Actions
          • Set amount = (amount x BL_PhysicalRate)
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • damageType Equal to SPELL
              • BL_BlindIncreaseMagicalDamage Equal to True
            • Then - Actions
              • Set amount = (amount x BL_MagicalRate)
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • damageType Equal to CODE
                  • BL_BlindIncreaseTriggerDamage Equal to True
                • Then - Actions
                  • Set amount = (amount x BL_TriggeredRate)
                • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • BL_ShowNewDamageRateText Equal to True
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • damageType Equal to PHYSICAL
            • Then - Actions
              • Floating Text - Create floating text that reads (String((Integer(amount)))) above target with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
            • Else - Actions
              • Floating Text - Create floating text that reads (String((Integer(amount)))) above target with Z offset 0.00, using font size 10.00, color (0.00%, 0.00%, 100.00%), and 0.00% transparency
          • Set BL_LastFloatingText = (Last created floating text)
          • Floating Text - Set the velocity of BL_LastFloatingText to 64.00 towards 90.00 degrees
          • Floating Text - Change BL_LastFloatingText: Disable permanence
          • Floating Text - Change the fading age of BL_LastFloatingText to 4.00 seconds
          • Floating Text - Change the lifespan of BL_LastFloatingText to 6.00 seconds
        • Else - Actions
Changelogs
Version 1.1.0 :
Fixed everything mentioned in Post #17

Version 1.0.0 :
First Upload


Credits
BunnyAng : Requester - Giving Permission
Malhorne : Kawaii Spell Workshop Owner
Bribe : Unit Indexer GUI
looking_for_help : DamageEvent Jass

Keywords:
Blind, Paladin, Charm, Confusion, Confuse, Confusia, Hypnosis, Unable, Inability, Attack, Limited, Archmage

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

Blind (Map)

Reviews
07:45, 13th Jun 2014 BPower: Changes mentioned are made. Approved. 12:43, 21st May 2014 PurgeandFire: Review: http://www.hiveworkshop.com/forums/2529843-post17.html

Moderator

M

Moderator

07:45, 13th Jun 2014
BPower:
Changes mentioned are made. Approved.

12:43, 21st May 2014
PurgeandFire: Review:
http://www.hiveworkshop.com/forums/2529843-post17.html
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
after reading the configuration, I think I like the concept, code looks perfect, I can't find anything's wrong. Except this:
  • Unit - Order BlindDummy to Undead Banshee - Curse TargetUnit
I'm not sure but I think the order need to be stored in variable. Just wait for other's opinion.

Good job ! I haven't checked the object editor data, but seeing from the code, I vote for quick approval
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
after reading the configuration, I think I like the concept, code looks perfect, I can't find anything's wrong. Except this:
  • Unit - Order BlindDummy to Undead Banshee - Curse TargetUnit
I'm not sure but I think the order need to be stored in variable. Just wait for other's opinion.
I don't think its needed a variable for that :b also, it's nearly 2 bytes of a crappy variable.
But I think it should be only a dummy for the debuff, do it at the init trigger :p.
Also, the spell can get messy if cast constantly (in terms of whether being able to attack or not).
4/5 good work :thumbs_up:
 
Ahh you uploaded it at last. Good job on the spell.
Thanks a lot! :)

Where is my requested spells?
Which one? I'll take a look at the workshop, I' hope you're aware I was busy with exams.

after reading the configuration, I think I like the concept, code looks perfect, I can't find anything's wrong. Except this:
  • Unit - Order BlindDummy to Undead Banshee - Curse TargetUnit
I'm not sure but I think the order need to be stored in variable. Just wait for other's opinion.

Good job ! I haven't checked the object editor data, but seeing from the code, I vote for quick approval
Thanks, I must admit it's not the best actually.
That one shouldn't need to be in a variable, there's no way users can modify the curse orderId.

I don't think its needed a variable for that :b also, it's nearly 2 bytes of a crappy variable.
But I think it should be only a dummy for the debuff, do it at the init trigger :p.
Also, the spell can get messy if cast constantly (in terms of whether being able to attack or not).
4/5 good work :thumbs_up:
Yep, it's a crap.
Yeah, perhaps I manipulate it a little so only one dummy used.
For the constant spam, I'm sure it shouldn't be much of an issue.

Lol.

Hey, good job daffa!:thumbs_up:
Thanks!
 

Kazeon

Hosted Project: EC
Level 33
Joined
Oct 12, 2011
Messages
3,449
wait, I think the order DOES need to be stored into variable and added to configuration part, in case user has another "Channel" ability with same order id, it will bugged if user can't configure.. please fix it. ;) still haven't check the file though

also every aspect of floating text should be configurable (fading age, lifespan, size, etc.)
 

Wrda

Spell Reviewer
Level 25
Joined
Nov 18, 2012
Messages
1,864
wait, I think the order DOES need to be stored into variable and added to configuration part, in case user has another "Channel" ability with same order id, it will bugged if user can't configure.. please fix it. ;)
The "ability" you are talking about is the dummy's one, it's based on curse, so what you just said doesn't make sense.
 
Why it only can be used on heroes? It didn't work for me when I tried it on a normal unit.

In your trigger "Blind Loop": You store "Picked unit" twice into a variable if the first condition is true.

First you do:
  • Set BlindConfuseTargetAttack = False
And then you check a boolean and would also set it to false, that doesnt make sense:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Bedingungen
      • BlindDisablesAttack == True
    • Then - Actions
      • Set BlindConfuseTargetAttack = False
    • Else - Actions
And anyway don't set it before, if you later check a boolean to possibly set it to an other value. You could take usage of the "Else" here.

Same you do with "ShowNewDamageRateText":
  • Set ShowNewDamageRateText = True
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Bedingungen
      • BlindIncreasePhysicalDamage == False
      • BlindIncreaseMagicalDamage == False
      • BlindIncreaseTriggeredDamage == False
    • Then - Actions
      • Trigger - Turn off Blind Damage Text <gen>
      • Set ShowNewDamageRateText = False
    • Else - Actions
Personally I prefer indexing instead of UnitGroups, but I think it's ok here.
Anyway I think using a counter for instances is better to check instead of using the function "Number of Units in Group" so often. (to turn trigger on/off)
Using the count function is less efficient.

Furthermore I think throwing a flashbang or something similar would improve the realistic near a lot, instead of casting an instant spell without any projectile graphics.

Else it worked fine. Code is not very complex, but once all works properly it might be useful. :csmile: (no rating yet)
 
I'll split your post for easy answer.

Why it only can be used on heroes? It didn't work for me when I tried it on a normal unit.
It was the intention :p
Maybe I'll make it available for units too :)

In your trigger "Blind Loop": You store "Picked unit" twice into a variable if the first condition is true.

Thanks for informing, I'll make a check and fix it.

First you do:
  • Set BlindConfuseTargetAttack = False
And then you check a boolean and would also set it to false, that doesnt make sense:
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Bedingungen
      • BlindDisablesAttack == True
    • Then - Actions
      • Set BlindConfuseTargetAttack = False
    • Else - Actions

It was a security measure, since if Blind disables attack, there's no need for target to get confused. (He/she already can't attack :p)

And anyway don't set it before, if you later check a boolean to possibly set it to an other value. You could take usage of the "Else" here.

Same you do with "ShowNewDamageRateText":
  • Set ShowNewDamageRateText = True
  • ...
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • 'IF'-Bedingungen
      • BlindIncreasePhysicalDamage == False
      • BlindIncreaseMagicalDamage == False
      • BlindIncreaseTriggeredDamage == False
    • Then - Actions
      • Trigger - Turn off Blind Damage Text <gen>
      • Set ShowNewDamageRateText = False
    • Else - Actions

It's also for security measures, I don't want unwanted operations here :D

Personally I prefer indexing instead of UnitGroups, but I think it's ok here.
Anyway I think using a counter for instances is better to check instead of using the function "Number of Units in Group" so often. (to turn trigger on/off)
Using the count function is less efficient.
I guess you're right, it can help a lot. I haven't remember the inefficiency (haven't been triggering for a while, so forget some of it).

Furthermore I think throwing a flashbang or something similar would improve the realistic near a lot, instead of casting an instant spell without any projectile graphics.
I'll check the Model Section, perhaps some useful model can be found there (else I'll try to make one)

Else it worked fine. Code is not very complex, but once all works properly it might be useful. :csmile: (no rating yet)
Thanks :)
I'm not a fan of super hard coding spells, I won't make long codes unless necessary.
 
First things first: I like the idea, and it seems to perform quite well in game.

Review:
  • Your ability should untick "Disable Other Abilities" in the object editor.
  • Set the button position to something other than (2, 0). (if you try casting blind on your own hero, the button will jump to the attack's button position)
  • Your variables should be prefixed. e.g. CastingUnit -> B_CastingUnit, or better yet, BL_CastingUnit (it is usually more common to have two letters as a prefix). This will prevent collisions.
  • Keep track of the units in the group with a variable instead of using "Number of units in <Group>" (that function will iterate through the entire group to count the units). Whenever you add a unit to the BlindGroup, just increment it. Whenever you remove one, decrement it:
    • Unit Group - Add BL_TargetUnit to BL_Group
    • Set BL_GroupCount = BL_GroupCount + 1
    • Unit Group - Remove BL_TargetUnit from BL_Group
    • Set BL_GroupCount = BL_GroupCount - 1
  • In the "Blind Cast" trigger, you should check if the unit already has the Blind debuff. That way, you can just update the Blind duration value and then skip remaining actions.
    • Set BlindedUnitDuration[TargetValue] = BlindDuration[HeroLevel]
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • BL_TargetUnit has buff BlindDebuff
      • Then - Actions
        • Skip Remaining Actions
      • Else - Actions
    That way, you don't go through a whole bunch of extra steps. I think. You might have to try it out and see if it works. It works in my head, but I can't be sure.

Otherwise, it is a nice spell. I like how compact it is, and it makes great use of the damage modification offered by lfh's damage library, as well as the default wc3 abilities. Nice job! Make those changes, and it should be approvable.
 
Top