1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. We have recently started the 16th edition of the Mini Mapping Contest. The theme is mini RPG. Do check it out and have fun.
    Dismiss Notice
  4. Dismiss Notice
  5. Choose your ride to damnation in the 5th Special Effect Contest Poll.
    Dismiss Notice
  6. The winners of the 13th Techtree Contest have been announced!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[General] Spell Shield using GDD

Discussion in 'World Editor Help Zone' started by Fakuspakus, Jul 28, 2019.

  1. Fakuspakus

    Fakuspakus

    Joined:
    Dec 25, 2018
    Messages:
    110
    Resources:
    0
    Resources:
    0
    It works properly but if Hero is at 100% hp, he will still take damage.
    How can I fix it?
    • Events
      • Game - GDD_Event becomes Equal to 1.00
      • Conditions
        • (GDD_DamagedUnit has buff Shield ) Equal to True
        • GDD_DamageSource Equal to DamageTypeMagic[(Player number of (Owner of GDD_DamageSource))]
      • Actions
        • Set Caster = GDD_DamagedUnit
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • AbilityValue1_Real[(Player number of (Owner of Caster))] Greater than or equal to GDD_Damage
          • Then - Actions
            • Set AbilityValue1_Real[(Player number of (Owner of Caster))] = (AbilityValue1_Real[(Player number of (Owner of Caster))] - GDD_Damage)
            • Unit - Set life of Caster to ((Life of Caster) + (GDD_Damage - 0.00))
            • Set GDD_Damage = 0.00
          • Else - Actions
            • Set AbilityValue1_Real[(Player number of (Owner of Caster))] = (AbilityValue1_Real[(Player number of (Owner of Caster))] - GDD_Damage)
            • Unit - Set life of Caster to ((Life of Caster) + (GDD_Damage - AbilityValue1_Real[(Player number of (Owner of Caster))]))
            • Set GDD_Damage = 0.00
            • Custom script: call UnitRemoveAbility(udg_Caster ,'B008')
     
  2. Ceday

    Ceday

    Joined:
    Feb 22, 2010
    Messages:
    1,111
    Resources:
    0
    Resources:
    0
    If I understand your problem correctly, the problem occurs when ((life of unit before damage) + (damage taken)) > (max healt of unit). You need to use a trick with damage bonus ability, not sure if there is another way.

    • Damage Block Tricky Event
      • Events
        • Game - Your damage event
      • Conditions
      • Actions
        • Unit - Add BLOCK LIFE BONUS (Greater) to (Triggering unit)
        • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + (Damage taken))
        • Unit Group - Add (Triggering unit) to DamageBlockGroup
        • Countdown Timer - Start DamageBlockTimer as a One-shot timer that will expire in 0.00 seconds



    • Damage Block Tricky Callback
      • Events
        • Time - DamageBlockTimer expires
      • Conditions
      • Actions
        • Unit Group - Pick every unit in DamageBlockGroup and do (Actions)
          • Loop - Actions
            • Unit - Remove BLOCK LIFE BONUS (Greater) from (Picked unit)
        • Unit Group - Remove all units from DamageBlockGroup


    Edit: A better thing to do is, in damage event trigger, first you should check if (life of unit) + (damage taken) <= max health. If yes simply increase life of the unit, if no use this trick.
     

    Attached Files:

    Last edited: Jul 28, 2019
  3. Fakuspakus

    Fakuspakus

    Joined:
    Dec 25, 2018
    Messages:
    110
    Resources:
    0
    Resources:
    0
    Is it dumb to use local caster with low value wait instead?
     
  4. Ceday

    Ceday

    Joined:
    Feb 22, 2010
    Messages:
    1,111
    Resources:
    0
    Resources:
    0
    If you mean wait before remove life bonus ability instead of timer, a problem will occur if unit takes another damage during wait. Or if you mean wait a low amount of time before increase unit's health, there is a chance your unit may die if you do not block damage immediately.
     
  5. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,691
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    Use bribes dds instead. It has support for this
     
  6. Fakuspakus

    Fakuspakus

    Joined:
    Dec 25, 2018
    Messages:
    110
    Resources:
    0
    Resources:
    0
    Does it work for you on this patch?
    I am getting "level info data missing or invalid"
     
  7. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,691
    Resources:
    18
    Maps:
    1
    Spells:
    11
    Tutorials:
    6
    Resources:
    18
    I have not used wc3 in a while so I can not 100% confirm.
    Check the latest comments, if they are positive it should most likely work.
     
  8. Uncle

    Uncle

    Joined:
    Aug 10, 2018
    Messages:
    760
    Resources:
    0
    Resources:
    0
    I'm using the latest patch and latest DDS. Works fine.
     
  9. Fakuspakus

    Fakuspakus

    Joined:
    Dec 25, 2018
    Messages:
    110
    Resources:
    0
    Resources:
    0
    Every map with this DDS gives me the same error so the problem is on my side

    upload_2019-7-29_14-35-50.png
    This is ver of my wc3, pretty sure its updated
     

    Attached Files:

  10. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    8,123
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    You may want to reinstall your WarCraft 3 as it should definitely work. Also make sure you're using the World Editor installed with WC3 and not NewGen or WEU or something.

    Also, your WC3 is not up to date. Should be 1.31.something
     
    Last edited: Jul 29, 2019