• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Spell is not really working!!!

Status
Not open for further replies.
Level 3
Joined
May 7, 2011
Messages
13
Hi guys
I try to make a hero based on mana-drain... and i´ve got a question... the first skill is that you target a hero and always when this hero loses mana he will lose HP instead... and the spell only works (at the moment) and that´s the problem when you cast the spell on the hero that casts the spell... (you cast it on the caster)... when i target an enemy hero nothing happens... here are the trigger
  • Cast Reserval
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reversal
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • R_freeIndexes_count Equal to 0
        • Then - Actions
          • Set R_TempIndex = R_Index_count
          • Set R_Index_count = (R_Index_count + 1)
        • Else - Actions
          • Set R_freeIndexes_count = (R_freeIndexes_count - 1)
          • Set R_TempIndex = R_freeIndexes[R_freeIndexes_count]
      • Set R_active[R_active_count] = R_TempIndex
      • Set R_active_count = (R_active_count + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • R_active_count Equal to 1
        • Then - Actions
          • Trigger - Turn on Damage Reserval <gen>
        • Else - Actions
      • Set R_data_caster[R_TempIndex] = (Triggering unit)
      • Set R_data_target[R_TempIndex] = (Target unit of ability being cast)
      • Set R_data_tmana[R_TempIndex] = (Mana of R_data_target[R_TempIndex])
This is only the start trigger... here comes the 2nd

  • Damage Reserval
    • Events
      • Time - Every 0.01 seconds of game time
    • Conditions
    • Actions
      • Set R_TempCount = R_active_count
      • For each (Integer R_TempIndexCount) from 1 to R_TempCount, do (Actions)
        • Loop - Actions
          • Set R_TempIndex = R_active[(R_TempCount - R_TempIndexCount)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (R_data_target[R_TempIndex] has buff Reserval ) Equal to True
            • Then - Actions
              • Set R_data_tdiffmana[R_TempIndex] = (R_data_tmana[R_TempIndex] - (Mana of R_data_target[R_TempIndex]))
              • Unit - Cause R_data_caster[R_TempIndex] to damage R_data_target[R_TempIndex], dealing (R_data_tdiffmana[R_TempIndex] / (5.00 - (1.00 x (Real((Level of Reversal for R_data_caster[R_TempIndex])))))) damage of attack type Magic and damage type Magic
              • Unit - Set mana of R_data_target[R_TempIndex] to R_data_tmana[R_TempIndex]
            • Else - Actions
              • Set R_freeIndexes[R_freeIndexes_count] = R_TempIndex
              • Set R_freeIndexes_count = (R_freeIndexes_count + 1)
              • Set R_active_count = (R_active_count - 1)
              • Set R_active[(R_TempCount - R_TempIndexCount)] = R_active[R_active_count]
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • R_active_count Equal to 0
                • Then - Actions
                  • Trigger - Turn off Damage Reserval <gen>
                • Else - Actions

Would be nice if somebody could help me with this
SharDamaKa
 
Level 17
Joined
Nov 13, 2006
Messages
1,814
if i understand u want make damage the spell target if he consume mana, i am too tired for fix it but i made a solution to u via unit group and custom value, u can try it, i hope will be usefull

EDIT

i reworked for be spammable the ability, so now i think enough good also i changed the attached map

  • Cast Reserval
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Reversal
    • Actions
      • Set R_Index = (R_Index + 1)
      • Set R_data_caster[R_Index] = (Triggering unit)
      • Set R_data_target[R_Index] = (Target unit of ability being cast)
      • Set R_data_timer[R_Index] = 15.00
      • Set R_data_tmana[R_Index] = (Mana of (Target unit of ability being cast))
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • R_Index Equal to 1
        • Then - Actions
          • Trigger - Turn on Damage Reserval <gen>
        • Else - Actions
  • Damage Reserval
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to R_Index, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (R_data_target[(Integer A)] is alive) Equal to True
              • R_data_timer[(Integer A)] Greater than or equal to 0.00
            • Then - Actions
              • Set R_data_timer[(Integer A)] = (R_data_timer[(Integer A)] - 0.03)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Mana of R_data_target[(Integer A)]) Less than R_data_tmana[(Integer A)]
                • Then - Actions
                  • Set R_data_damage = (R_data_tmana[(Integer A)] - (Mana of R_data_target[(Integer A)]))
                  • Unit - Cause R_data_caster[(Integer A)] to damage R_data_target[(Integer A)], dealing (R_data_damage x 10.00) damage of attack type Chaos and damage type Magic
                  • Game - Display to (All players) the text: ((String((R_data_damage x 10.00))) + ( magic damage to caster who is + (Name of R_data_target[(Integer A)])))
                • Else - Actions
              • Set R_data_tmana[(Integer A)] = (Mana of R_data_target[(Integer A)])
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • R_Index Not equal to (Integer A)
                • Then - Actions
                  • Set R_data_caster[(Integer A)] = R_data_caster[R_Index]
                  • Set R_data_target[(Integer A)] = R_data_target[R_Index]
                  • Set R_Index = (R_Index - 1)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • R_Index Equal to 0
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions
                • Else - Actions
 

Attachments

  • Mana Drain.w3x
    226.3 KB · Views: 38
Status
Not open for further replies.
Top