1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. 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
  3. The 15th Mini-Mapping Contest came to an end. The Secrets of Warcraft 3 are soon to be revealed! Come and vote in the public poll for your favorite maps.
    Dismiss Notice
  4. The 12th incarnation of the Music Contest is LIVE! The theme is Synthwave. Knight Rider needs a song to listen to on his journey. You should definitely have some fun with this theme!
    Dismiss Notice
  5. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  6. 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.

Spirit protection 1.06

Submitted by .OmG.
This bundle is marked as approved. It works and satisfies the submission rules.
Description
Being attacked, there is a chance to cast random spell to an opponent.
Level 1 - 20% chance
Level 2 - 40% chance
Level 3 - 60% chance

The power of the spells increases with level of ability.


version 1.06
In version 1.06 user can select any chance to cast a random spell, instead of using Max and min factors. Also I have imroved some description.






Credits:
Anachron (good icon for the spell)

Keywords:
attack, random,spell,cast,chance, passive,aura,lightning
Contents

Spirit protection 1.06 (Map)

Reviews
Moderator
19th Jul 2011 Maker: Simple but could be useful. Change GetLastCreatedUnit() to bj_lastCreatedUnit
  1. 19th Jul 2011
    Maker:
    Simple but could be useful.
    Change GetLastCreatedUnit() to bj_lastCreatedUnit
     
  2. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I know, that this spell is very simple.Nevertheless, I uploaded the spell for check.

    Triggers

    • spirit protection ini
      • События
        • Map initialization
      • Условия
      • Действия
        • -------- Choose the number of your dummy spells --------
        • -------- In this test map I have 5 dummy spells --------
        • Set Random_spell_Count = 5
        • -------- This is value - the max number for the chance --------
        • -------- For example: --------
        • -------- if [1] value = 8 and [2] value = 1 --------
        • -------- then the change to cast random spell is --------
        • -------- 1/(8-1*lvl) * 100% --------
        • -------- 1 lvl - 14.28% --------
        • -------- 2 lvl - 16.66% --------
        • -------- 3 lvl - 20.00% --------
        • Set Integer_DATA[1] = 8
        • -------- This is value - factor of descreasing change --------
        • Set Integer_DATA[2] = 1
        • -------- --------
        • -------- --------
        • -------- choose your dummy spells --------
        • Set Random_Spell[1] = Отравленный РЅРѕР¶ random spell
        • Set Random_Spell[2] = Полиморф random spell
        • Set Random_Spell[3] = Цепь молний random spell
        • Set Random_Spell[4] = Очищение random spell
        • Set Random_Spell[5] = Ледяная звезда random spell
        • -------- --------
        • -------- --------
        • -------- choose ordercodes of your spells --------
        • -------- In the same procedure --------
        • Set Order[1] = Тюремщица (Ночные эльфы) - Отравленный РЅРѕР¶
        • Set Order[2] = Волшебница (Альянс) - Полиморф
        • Set Order[3] = Говорящий СЃ Духами (РћСЂРґР°) - Цепь молний
        • Set Order[4] = Шаман (РћСЂРґР°) - Очищение
        • Set Order[5] = Король Мертвых (Нежить) - Ледяной взрыв


    • spirit protection effect
      • События
        • Боевая единица - A unit Атакован
      • Условия
        • (Level of Spirit protection for (Triggering unit)) РЅРµ равно (!=) 0
      • Действия
        • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • Если - Условия
            • (Random integer number between 1 and (Integer_DATA[1] - (Integer_DATA[2] x (Level of Spirit protection for (Triggering unit))))) равно (==) 1
          • РўРѕ - Действия
            • -------- This is a random value beetween 1 and the count of your random spells --------
            • Set Random_Value = (Random integer number between 1 and Random_spell_Count)
            • Set TempPoint = (Position of (Triggering unit))
            • Боевая единица - Create 1 dummy for (Owner of (Triggering unit)) at TempPoint facing Стандартная ориентация зданий (270.0) degrees
            • Боевая единица - Add a 2.00 second Общий expiration timer to (Last created unit)
            • -------- order to cast your chose spell with the correspond orders --------
            • Set Random_Value2 = (Random integer number between 1 and Random_spell_Count)
            • Боевая единица - Add Random_Spell[Random_Value2] to (Last created unit)
            • Боевая единица - Order (Last created unit) to Order[Random_Value2] (Attacking unit)
            • Custom script: call RemoveLocation(udg_TempPoint)
          • Р˜РЅР°С‡Рµ - Действия

     
    Last edited by a moderator: Jun 15, 2011
  3. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,938
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    What external program did you use to write this in? GUI spells must be openable in World Editor.
     
  4. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I made it in UMSWE WE.
     
  5. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,938
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    In order for a GUI spell to be approved here it has to be openable in normal World Editor. This needs to be ported as a World Editor-safe script or will be rejected.
     
  6. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    So, if it will be openable in normal WE, it will approved?
     
  7. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,938
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I don't know yet, I was trying to open your map in order to read the triggers in English but it didn't let me. So I can't even review the spell until you make it work right.
     
  8. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I used function:
    • Unit - Order (Last created unit) to Order[Random_Value] (Attacking unit)


    There is not this function in normal WE.
    :vw_wtf:
     
  9. Black-kitty

    Black-kitty

    Joined:
    Jul 29, 2010
    Messages:
    263
    Resources:
    0
    Resources:
    0
    We'll I think the spell is hard to see from the tiny pic. So I tried using it in-game and for some reason it dident work. So than I downloaded it again, redid it again, and it dident work.. so yea.. I dont know what exactly you did or maybe if its my fault.. but by other peoples comments I would try working on somthing else or fixing this one. Dont give up though!
     
  10. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Picture is do not tiny, but I agree, its hard to see...
     
  11. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,938
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Yep, World Editor gives me the error "Undefined function: IssueTargetOrderById".

    JASS has this, however. You can fix this by changing it to Custom script and typing it out manually.

    Here's the custom script, you can just cnp it:

    call IssueTargetOrderById(bj_lastCreatedUnit, udg_Random_Value, GetAttacker())
     
  12. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    When i put your custom script, it is not get an error, but spell is not works.
    So, I edit script:
    • Custom script: call IssueTargetOrderById( GetLastCreatedUnit(), udg_Order[udg_Random_Value], GetAttacker() )

    And it works.
    If I put this script, it will be openable in normal WE?
     
  13. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,938
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    I hadn't realized Order was an array due to UMSWE's obscurity. In that case, use
    Code (vJASS):
    call IssueTargetOrderById(bj_lastCreatedUnit, udg_Order[udg_Random_Value], GetAttacker())
    because GetLastCreatedUnit() is avoidable in JASS in favor of the inlined "bj_lastCreatedUnit".

    It should be openable in normal WE after that change.
     
  14. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Thanks, I will update the spell in 30 min.
     
  15. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    The spell works properly with this custom script,can be opened, but I can`t save test map in normal WE.
     
  16. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,938
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    What error message does it give?
     
  17. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Just close WE, but open map properly with CNTRL-F9
     
  18. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,938
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Go to this file path on your computer: "C:\Program Files\WarCraft III\Maps\Test". You should see your test map there and you can upload it here.
     
  19. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    The spell is updated.
    Check please