1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. The Melee Mapping Contest #4: 2v2 - Results are out! Step by to congratulate the winners!
    Dismiss Notice
  3. We're hosting the 15th Mini-Mapping Contest with YouTuber Abelhawk! The contestants are to create a custom map that uses the hidden content within Warcraft 3 or is inspired by any of the many secrets within the game.
    Dismiss Notice
  4. The 20th iteration of the Terraining Contest is upon us! Join and create exquisite Water Structures for it.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice

[GUI] Corruption

Submitted by Chaosy
This bundle is marked as approved. It works and satisfies the submission rules.
Welcome to yet another spell that Chaosy (likely) will be too lazy to update.

[​IMG]

Description
The caster sends out corruptive waves of magic in all directions. All enemies hit got some of their life stolen.

How to import:
1. copy the dummy model to your map
2. copy the dummy unit to your map
3. copy all triggers but the 'this map only' ones

triggers

  • CR init
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Hashtable - Create a hashtable
      • Set CR_hash = (Last created hashtable)
      • Set CR_area[1] = 550.00
      • Set CR_area[2] = 550.00
      • Set CR_area[3] = 550.00
      • Set CR_leach[1] = 0.03
      • Set CR_leach[2] = 0.05
      • Set CR_leach[3] = 0.10
      • Set CR_damage[1] = 50.00
      • Set CR_damage[2] = 75.00
      • Set CR_damage[3] = 100.00
      • Set CR_speed = 7.00
      • Set CR_ability = Corruption
      • Set CR_missile_number = 15
      • Set CR_effect = Abilities\Weapons\GargoyleMissile\GargoyleMissile.mdl
      • Set CR_detect_range = 50.00
      • Set CR_attack_type = Spells
      • Set CR_damage_type = Magic
      • -------- Do not modify bellow. --------
      • Set CR_SaveUsage = 4

  • CR cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to CR_ability
    • Actions
      • Custom script: local integer h
      • Custom script: local integer calc
      • Set CR_unit = (Triggering unit)
      • Custom script: set h = GetHandleId(udg_CR_unit)
      • For each (Integer A) from 1 to CR_missile_number, do (Actions)
        • Loop - Actions
          • Custom script: set calc = udg_CR_SaveUsage * bj_forLoopAIndex
          • Set CR_angle = ((360.00 / (Real(CR_missile_number))) x (Real((Integer A))))
          • Custom script: call SaveReal(udg_CR_hash, h, calc + 1, udg_CR_angle)
          • Custom script: call SaveReal(udg_CR_hash, h, calc + 2, GetUnitX(udg_CR_unit))
          • Custom script: call SaveReal(udg_CR_hash, h, calc + 3, GetUnitY(udg_CR_unit))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (CR_group is empty) Equal to True
        • Then - Actions
          • Trigger - Turn on CR loop <gen>
        • Else - Actions
      • Unit Group - Add CR_unit to CR_group

  • CR loop
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in CR_group and do (Actions)
        • Loop - Actions
          • Custom script: local integer h
          • Custom script: local integer calc
          • Set CR_unit = (Picked unit)
          • Custom script: set h = GetHandleId(udg_CR_unit)
          • Custom script: set udg_CR_loc = Location(LoadReal(udg_CR_hash, h, udg_CR_SaveUsage + 2), LoadReal(udg_CR_hash, h, udg_CR_SaveUsage + 3))
          • For each (Integer CR_loop_integer) from 1 to CR_missile_number, do (Actions)
            • Loop - Actions
              • Custom script: set calc = udg_CR_SaveUsage * udg_CR_loop_integer
              • Custom script: set udg_CR_angle = LoadReal(udg_CR_hash, h, calc + 1)
              • Custom script: set udg_CR_distance = LoadReal(udg_CR_hash, h, calc + 4) + udg_CR_speed
              • Custom script: call SaveReal(udg_CR_hash, h, calc + 4, udg_CR_distance)
              • Set CR_loc2 = (CR_loc offset by CR_distance towards CR_angle degrees)
              • Special Effect - Create a special effect at CR_loc2 using CR_effect
              • Special Effect - Destroy (Last created special effect)
              • Custom script: set bj_wantDestroyGroup = true
              • Unit Group - Pick every unit in (Units within CR_detect_range of CR_loc2 matching (((Matching unit) belongs to an enemy of (Owner of CR_unit)) Equal to True)) and do (Actions)
                • Loop - Actions
                  • Custom script: local integer h = GetHandleId(udg_CR_unit)
                  • Custom script: local boolean b = LoadBoolean(udg_CR_hash, h, GetHandleId(GetEnumUnit()))
                  • Custom script: if not b then
                  • Set MS_Source1 = (Picked unit)
                  • Custom script: call SaveBoolean(udg_CR_hash, h, GetHandleId(udg_MS_Source1), true)
                  • Unit - Cause CR_unit to damage MS_Source1, dealing CR_damage[(Level of CR_ability for CR_unit)] damage of attack type CR_attack_type and damage type CR_damage_type
                  • Set MS_Target1 = CR_unit
                  • Set MS_Heal1 = ((Max life of (Picked unit)) x CR_leach[(Level of CR_ability for CR_unit)])
                  • Trigger - Run CR Missile Settings <gen> (ignoring conditions)
                  • Trigger - Run CreateMissile <gen> (checking conditions)
                  • Custom script: endif
              • Custom script: call RemoveLocation(udg_CR_loc2)
          • Custom script: call RemoveLocation(udg_CR_loc)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • CR_distance Greater than or equal to CR_area[(Level of CR_ability for CR_unit)]
            • Then - Actions
              • Custom script: call FlushChildHashtable(udg_CR_hash, h)
              • Unit Group - Remove CR_unit from CR_group
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (CR_group is empty) Equal to True
                • Then - Actions
                  • Trigger - Turn off (This trigger)
                • Else - Actions
            • Else - Actions



Credits
Name Contridution
Killcide GIF preview
Redscores Missile System


Keywords:
Spell, dark, corruption, Chaosy, GUI,
Contents

Just another Warcraft III map (Map)

Reviews
Moderator
08:10, 14th Sep 2015 BPower: Requires proper tooltip.
  1. 08:10, 14th Sep 2015
    BPower: Requires proper tooltip.
     
  2. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,531
    Resources:
    26
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    1
    Resources:
    26
    Those loop stuff can be put into the configurable or at least linked.
     
  3. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,558
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    What do you mean? I don't quite understand.
     
  4. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,531
    Resources:
    26
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    1
    Resources:
    26
    The loop trigger, those configurations before
    • Trigger - Run CreateMissile <gen> (checking conditions)
    (those set variables) would be better if moved into a separate trigger, allowing users to spot it easier.
     
  5. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    Can you give a link to the Missile System?

    in cast you could use CR_unit instead of GetTriggerUnit() within the loop.

    Use an integer variable instead of bj_forLoopAIndex.

    if b == false then --> if not b then.

    Custom script: call SaveBoolean(udg_CR_hash, GetHandleId(udg_CR_unit), GetHandleId(GetEnumUnit()), true) --> you have the handle id stored in "h", use the variable.

    The missile config stuff shouldn't be hardcoded.
     
  6. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,558
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    I see, that is a fair point. I will do that.

    1. Sure, will do. (Done)
    2. Not you too! but fine.(Done)
    3. *nods* (Done)
    4. Thanks! will fix (Done)
    5. will do something about that. (Done)
     
  7. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    Provide a proper tooltip. Currently it's the one used for thunderclap.
    I would recommend to base the spell on the Channel ability.
     
  8. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,558
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    Oh damn you, fine. I will do that too :p (Done)

    I have not much experience with that spell, doesn't that have a channel time by default?
     
  9. BPower

    BPower

    Joined:
    Mar 18, 2012
    Messages:
    1,745
    Resources:
    21
    Spells:
    15
    Tutorials:
    1
    JASS:
    5
    Resources:
    21
    No it doesn't.
     
  10. nhocklanhox6

    nhocklanhox6

    Joined:
    Feb 12, 2012
    Messages:
    343
    Resources:
    29
    Models:
    6
    Spells:
    22
    Tutorials:
    1
    Resources:
    29
    What a beauty green power.
    5/5 for me.
     
  11. xYours Trulyx

    xYours Trulyx

    Joined:
    Jan 9, 2016
    Messages:
    794
    Resources:
    0
    Resources:
    0
    Is this spell MUI?I need to know...
     
    Last edited: Jan 31, 2016
  12. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,558
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    It is indeed MUI.
     
  13. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,544
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    Noticed a few small details that were missed when you updated this:
    - You use GetTriggerUnit() in the cast trigger when you already have CR_unit set to the triggering unit
    - Trigger names should have the same prefix as your variables (CR Loop for example)
    - Small note that it'd make sense to put the missile setup in with the init trigger, just reduces the amount of triggers to import at no cost
    - Collision size of the outgoing projectiles should be configurable
    - Add a version number to the resource
    - You reference picked unit twice in the loop (once to assign to a variable, the other time to damage it)
    - You also reference picked unit again when you remove it from the unit group when it should be CR_unit
    - Change the folder name to match the spell, people need to be able to easily import and locate the files later
     
  14. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,558
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    I'll fix everything but the missile setup trigger, I call that trigger in the loop when creating missiles. This is done to make the code less ugly.
     
  15. Tank-Commander

    Tank-Commander

    Spell Reviewer

    Joined:
    May 26, 2009
    Messages:
    1,544
    Resources:
    44
    Packs:
    1
    Spells:
    41
    Tutorials:
    2
    Resources:
    44
    That's fair enough, just a note that you missed out the AOE of outgoing projectiles (Pick units within 50.00 of (...)) into the cofigurables, the resource is however in an approvable state now, thanks for your work - it's a great looking spell which can have a lot of uses
     
  16. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,558
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    Added CR_detect_range to config.
     
  17. KILLCIDE

    KILLCIDE

    Administrator

    Joined:
    Jul 22, 2015
    Messages:
    3,489
    Resources:
    20
    Models:
    2
    Icons:
    10
    Spells:
    7
    Tutorials:
    1
    Resources:
    20
    Cool looking spell :D I can't stop watching the GIF. I do have some minor suggestions though:
    • I believe the filters to damage only enemy units is not enough. What about magic immune, units that are alive, etc?
    • Why is the level of the ability and triggering player not stored on cast?
    • Attack type and Damage type should be configurable
     
  18. Chaosy

    Chaosy

    Joined:
    Jun 9, 2011
    Messages:
    10,558
    Resources:
    17
    Maps:
    1
    Spells:
    10
    Tutorials:
    6
    Resources:
    17
    I will fix that soon TM.
    Aka within the hour.

    edit: I added the damage and attack type, the other require me to edit the code which is not something I want to do at the moment since I have not touched this spell in a while, I barely know how it works anymore.
     
    Last edited: Jun 29, 2016
  19. Alxen345

    Alxen345

    Joined:
    Aug 6, 2015
    Messages:
    1,010
    Resources:
    2
    Maps:
    1
    Template:
    1
    Resources:
    2
    Extraordinary and well made spell! I have no objections for it. 5/5 from me.