1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The long-awaited results for Concept Art Contest #11 have finally been released!
    Dismiss Notice
  3. Join Texturing Contest #30 now in a legendary battle of mythological creatures!
    Dismiss Notice
  4. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  5. Hivers united and created a bunch of 2v2 melee maps. Vote for the best in our Melee Mapping Contest #4 - Poll!
    Dismiss Notice
  6. Check out the Staff job openings thread.
    Dismiss Notice

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. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Alright, here are your triggers in English:
    Triggers

    • spirit protection ini
      • Events
        • Map initialization
      • Conditions
      • Actions
        • -------- 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] = Shadow Strike random spell
        • Set Random_Spell[2] = Polymorph random spell
        • Set Random_Spell[3] = Chain Lightning random spell
        • Set Random_Spell[4] = Purge random spell
        • Set Random_Spell[5] = Frost Nova random spell
        • -------- --------
        • -------- --------
        • -------- choose ordercodes of your spells --------
        • -------- In the same procedure --------
        • Set Order[1] = Unknown
        • Set Order[2] = Unknown
        • Set Order[3] = Unknown
        • Set Order[4] = Unknown
        • Set Order[5] = Unknown


    • spirit protection effect
      • Events
        • Unit - A unit Is attacked
      • Conditions
        • (Level of Spirit protection for (Triggering unit)) Not equal to 0
      • Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • (Random integer number between 1 and (Integer_DATA[1] - (Integer_DATA[2] x (Level of Spirit protection for (Triggering unit))))) Equal to 1
          • Then - Actions
            • -------- 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))
            • Unit - Create 1 dummy for (Owner of (Triggering unit)) at TempPoint facing Default building facing degrees
            • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
            • -------- order to cast your chose spell with the correspond orders --------
            • Unit - Add Random_Spell[Random_Value] to (Last created unit)
            • Custom script: call IssueTargetOrderById(bj_lastCreatedUnit, udg_Order[udg_Random_Value], GetAttacker())
            • Custom script: call RemoveLocation(udg_TempPoint)
          • Else - Actions


    Review:

    The result is quite nice from what I can see. Normally, the event "unit is attacked" is a problem because it can be abused, but seeing as how the only person who could abuse it is the enemy (the one that gets damaged) this isn't a problem.

    While it is simple, I think that's something that actually works for this thing's benefit.

    Changes you should make:

    On the dummy unit, change Art - Death time to 0 and change its status to "can't raise, does not decay". This way, the dummy unit will be removed instantly after its expiration timer.

    On the test map, increase the odds for the random spell to be cast. This will help show off your system a bit better.

    Use (Triggering player) instead of (Owner of (Triggering unit))

    Integer_DATA should not be an array, just split into two normal variables with proper names instead of a generic name.
     
  2. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Lol double post,just edit ur old post next time,I can't open and test the spell either
     
  3. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Ok, thanks for review, i will update it for a few days.
     
  4. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    It opens and tests just fine for me.
     
  5. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I don`t know why...

    • Set Order[1] = Unknown
      • Set Order[2] = Unknown
      • Set Order[3] = Unknown
      • Set Order[4] = Unknown
      • Set Order[5] = Unknown


    Normal WE has not this function too?

    This function close We when I click on button 'unknown'.
     
    Last edited by a moderator: Jun 15, 2011
  6. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    It opens fine in normal world editor. He probably downloaded your map right before you updated it. He needs to download the new one.
     
  7. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I am updated the spell.
    -I changed dummy unit how you say
    -Now it has 9 dummy test abilities
    -
    • Owner of (triggering unit)=>triggering player

    -Made data of spell not array
     
  8. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Yes it works now,great job
     
  9. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    thanks, I glad that you like it.
     
  10. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    What I meant by increasing the odds is, instead of 14/17/20 make it 40/60/80 for the test map, so users can see it proc more often and see how well it works.

    The last change I can see now is to change the icon. Currently, you have a "clickable icon" but it is not clickable - it's passive. So you should choose an icon for the spell that's a passive icon (like an aura).
     
  11. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I`m sorry, I just have bad knowledge of English. However, it is not bad, that I have added new dummy spells?:D
    Spell updated to version 1.03
    -changed icon to passive
    -increased chance of casting spell
     
  12. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,773
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    It does look good. "Doom" is a bit overkill ;)

    The "Learn ability" icon should be an active one (with the border).

    Something else I suggest is scaling the power of the abilities cast when he's attacked. For example, the random spell could be "dispel magic" at level 1, "purge" at level 2, "disenchant" at level 3, etc.

    While I don't care what abilities they are the functionality to set level 1, level 2, level 3 sets of abilities should definitely be there so that people can more easily use this in their maps.
     
  13. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    How can I make icon with border?
     
  14. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Unless you want to download icon manager,you should just change it to another icon
     
  15. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Can I just import icon and give credits?
    • Unit - Set level of Random_Spell[Random_Value] for (Last created unit) to (Level of Spirit protection for (Triggering unit))

    So, I am increasing power of spells with increasing level of ability.
     
    Last edited: Jun 16, 2011
  16. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Ask bribe,he might let you,but I suggest not
     
  17. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    Spell updated to version 1.04.
    Now the power of the spells increases with increasing level of ability.
    Changed icon ( imported )
    Removed 1 dummy spell - Doom
     
  18. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Repost the code?
     
  19. .OmG.

    .OmG.

    Joined:
    May 9, 2010
    Messages:
    256
    Resources:
    2
    Spells:
    2
    Resources:
    2
    I have Russian WE, I cant do it properly.
     
  20. Ketsuno Anson

    Ketsuno Anson

    Joined:
    May 14, 2011
    Messages:
    392
    Resources:
    0
    Resources:
    0
    Dang,you really need some help here...sry i cant help you on it,but you can go to the forum for help ^^