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. The poll for Hive's 12th Concept Art Contest is up! Go cast your vote for your favourite genie!
    Dismiss Notice
  4. Travel to distant realms and encounter scenes unknown to the common folk. The Greatest of Adventures is upon us with the 8th Cinematic Contest. Join in on a fun ride.
    Dismiss Notice
  5. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  6. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  7. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. 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.

Spell leak

Discussion in 'World Editor Help Zone' started by biHmapmaker, Nov 23, 2010.

  1. biHmapmaker

    biHmapmaker

    Joined:
    Oct 10, 2009
    Messages:
    99
    Resources:
    0
    Resources:
    0
    • Unbreakable Shield INT
      • Events
        • Unit - A unit Begins casting an ability
      • Conditions
        • (Ability being cast) Equal to Unbreakable Shield 1
      • Actions
        • Set US_Caster = (Casting unit)
        • Set US_Damage = (((Level of Unbreakable Shield 1 for US_Caster) + (Hero level of US_Caster)) + (Integer(80.00)))
        • Trigger - Turn on Unbreakable Shield Loop <gen>


    • Unbreakable Shield Loop
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • (Attacked unit) Equal to US_Caster
      • Actions
        • For each (Integer A) from 1 to 5, do (Actions)
          • Loop - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • (Level of Unbreakable Shield 1 for US_Caster) Greater than 0
              • Then - Actions
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Damage taken) Less than or equal to (Real(US_Damage))
                  • Then - Actions
                    • Unit - Set life of (Attacked unit) to (Life of (Attacked unit))
                  • Else - Actions
                    • Trigger - Turn off (This trigger)
              • Else - Actions
                • Trigger - Turn off (This trigger)


    Question : Where does spell leak ?!
    Spell should block incoming damage equal to (US_Damage) but it blocks some minor damage (20-30 etc.)
     
  2. Garfield1337

    Garfield1337

    Joined:
    Jul 6, 2009
    Messages:
    1,806
    Resources:
    4
    Maps:
    1
    Spells:
    3
    Resources:
    4
    The spell is...badly made.
    I can remake you the whole spell and make it MUI if you want.
    Also i seems you can just use Hardened Skin instead,since it blocks damage.
     
  3. Exum

    Exum

    Joined:
    Mar 24, 2008
    Messages:
    87
    Resources:
    0
    Resources:
    0
    You should make your spell like this :

    • Casting
      • Events
        • Unit - A unit casts a spell
      • Conditions
        • (Ability being cast) Equal to Shield
      • Actions
        • Set ShieldBloc = XX + (Level of (Triggering unit))*X + (Level of Shield for (Triggering unit))*X
        • Trigger - Add to (Shield ON) the event (Unit - (Triggering unit) Takes damages)
        • Trigger - Turn on (Shield ON)


    And next trigger :

    • Shield ON
      • Events
      • Conditions
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Damage taken) Less or equal to ShieldBloc
          • Then - Actions
            • Set ShieldBloc = (ShieldBloc - Damages Taken)
            • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + Damages Taken)
          • Else - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Damage taken) Greater than ShieldBloc
          • Then - Actions
            • Unit - Set life of (Triggering unit) to ((Life of (Triggering unit)) + ShieldBloc)
            • Set ShieldBloc = 0
          • Else - Actions


    At the end you add an If-Then-Else to Turn off this trigger when ShieldBloc = 0

    I bet many things could be better in what i wrote but that's the idea.

    And for leaks i don't found one, as reals and units don't leak. It could if you added a special effect to your spell.

    Edit : You should make 2 firsts triggers, one to cast and same actions without "Add the event", and one when you learn the spell, which adds the event, and is turned off.
     
  4. mckill2009

    mckill2009

    Joined:
    Mar 10, 2009
    Messages:
    4,696
    Resources:
    34
    Maps:
    5
    Spells:
    27
    JASS:
    2
    Resources:
    34
    The following is no good;

    1. For each (Integer A) from 1 to 5, do (Actions)...use integer variable...
    2. Unit - A unit Begins casting an ability...use starts the effect on ability
    3. Set US_Caster = (Casting unit)...use triggering unit
    4. Unit - Set life of (Attacked unit) to (Life of (Attacked unit))....DO "Unit - Set life of (Attacked unit) to (Life of (Attacked unit)) - US_Damage....
    5. Unit - A unit Is attacked...use periodic time as the loop & use index system...

    I see no leak, but as GArfield pointed out, the trigger is really bad...
     
  5. biHmapmaker

    biHmapmaker

    Joined:
    Oct 10, 2009
    Messages:
    99
    Resources:
    0
    Resources:
    0
    No, this is activating spell (base is Mana Shield) ...
    I will try what this guy below you pointed out, so will see effect ...