Need Help (1 custom spell)

Jinxx

New Member
Reaction score
4
Hey guys, I've got a spell I need to implement, and I know how it should (theoretically) work, but I'm confused as to how I should set it up in JASS (I'd prefer JASS, but vJASS would be ok as well I guess)...

Essence Flux: "Target a location on the ground with malefic energy - all hostile heroes within 500 AoE will be slowed by N% for the duration of the spell (10 seconds), as well as lose Z% of their total mana over time (this mana is stolen by the caster)."

Level 1: Enemy heroes lose a total of 1% of their mana, and have their movement speed slowed by 4%.
Level 2: Enemy heroes lose a total of 2% of their mana, and have their movement speed slowed by 8%.
Level 3: Enemy heroes lose a total of 3% of their mana, and have their movement speed slowed by 12%.
Level 4: Enemy heroes lose a total of 4% of their mana, and have their movement speed slowed by 16%.
Level 5: Enemy heroes lose a total of 5% of their mana, and have their movement speed slowed by 20%.


So what this basically does is target all hostile heroes within the AoE (spell is ranged, has a circular reticule), smacks them with a temporary movespeed slow (dummy pops in and casts it), and bleeds their mana (which the casting hero then receives).

The trouble I'm having with is setting up the mana leak. I would guess it needs some kind of periodic timer or somesuch? Also, how do I make it so that a unique timer runs for each enemy hero caught by the spell (since the caster steals mana from multiple enemy heroes caught in the AoE)? :confused:

Thanks for any help. :shades:
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
you can do this in gui:

here you detect the cast and add the units to a unit group that sucks mana every 0.2 seconds (to make it smooth rather than a chunk of mana every second)

Trigger:
  • Mana Leak Cast
    • Events
      • A unit Casts an ability targetting a point
    • Conditions
      • Ability cast is equal to (your ability)
    • Actions
      • Set Temp_Point = Target Point of ability cast
      • Set Temp_Group[1] = Units in playable map area matching conditions ((Matching Unit is in Temp_Group[1] is equal to true) Or ((Owner of Matching unit is an enemy of Owner of Casting Unit) And (Matching Unit is within (range) of Temp_Point)))
      • Set Temp_Group[2] = Units within (range) of Temp_Point matching conditions (Owner of matching unit is an enemy of the owner of Casting unit)
      • Unit Group - Pick Every unit in Temp_Group[2] and do actions
        • Loop Actions
          • Hashtable - Save Real 10.00 as (key Picked Unit) of 1 in Last Created Hashtable (create one at map init)
          • Hashtable - Save Real (Greatest Between Real(Level of (ability) for casting unit)/50 and Load Real (key Picked Unit) of 2 in last created hashtable) as (Key Picked Unit) of 2 in last created hashtable
      • Custom Script: call RemoveLocation(udg_Temp_Point)
      • Custom Script: call DestroyGroup(udg_Temp_Group[2])
      • Trigger - Turn on Mana Leak <gen>


This is the Trigger that takes the mana
Trigger:
  • Mana Leak
    • Events
      • Periodic Event - Every 0.2 seconds
    • Conditions
    • Actions
      • Set Temp_Group[2] = Units in Temp_Group[1]
      • Unit Group - Pick Every Unit in Temp_Group[2] and do actions
        • Unit - Set Mana of picked unit = Mana of Picked Unit - (Load Real (Key Picked Unit) of 2 in last created hashtable)
        • Hashtable - Save Real ((Load Real (key Picked Unit) of 1 in last created hashtable) - 0.2) as (Key Picked Unit) of 1 in last created hashtable)
        • If Then Else
          • If
            • (Load Real (key Picked Unit) of 1 in last created hashtable) is equal to 0.00
          • Then
            • Unit Group - Remove Picked Unit from Temp_Group[1]
            • If Then Else
              • If
                • (Number of Units in Temp_Group[1]) is equal to 0
              • Then
                • Custom Script: call DestroyGroup(udg_Temp_Group[1])
                • Trigger - Turn off this trigger
              • Else
          • Else
      • Custom Script: call DestroyGroup(udg_Temp_Group[2])
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top