Spell Invert Polarity

ArmyOfFrogs

New Member
Reaction score
20
Figured I needed work on my spells, so I made one yesterday just for you guys to judge it. Any pointers are welcome.. You'll probably notice I need work when looking at the code :(

Invert Polarity

Info
GUI
Leakless (I'm pretty sure)
MUI (You need to add triggers based on how many players you have)
Intended to be a dual use spell; It can heal or damage, pull or push any target. Useful in countless ways :)

Screenshots Tried resizing them all but the last one just didn't want to.
Heals
Heal1.jpg

Heal2.jpg

Heal3.jpg
Damage
Damage1.jpg

damage2.jpg

Targets: All organic
Casting Range: 800 (600 max for damaging)
Invert Polarity: Inverts the laws of gravity between you and target. If you're far away, it'll intensify gravity between you, sending you flying at eachother. If you're close, it'll reverse the gravity, sending you flying apart. The extreme effects of the gravity will have an effect on their body too. If the unit is sent towards you they are healed. If they are sent away, they are damaged.
Max Damage: 300 x level of spell
Max Healing: 100 x level of spell

Note: If you use this feel free to change anything about it ^^ Tooltips are rather bland I know, and the instructions on how to change the data for damage / healing are under the comment on the attached map.

Code
Trigger:
  • R Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Magnetic Field
    • Actions
      • For each (Integer A) from (Player number of (Owner of (Casting unit))) to (Player number of (Owner of (Casting unit))), do (Actions)
        • Loop - Actions
          • Set R_TrigNumber[(Player number of (Owner of (Triggering unit)))] = R Cas Movement red <gen>
          • Set R_TarTrigNum[(Player number of (Owner of (Triggering unit)))] = R Tar Movment red <gen>
          • Set R_CasDCount[(Integer A)] = 0
          • Set R_TarDCount[(Integer A)] = 0
          • Set R_Caster[(Integer A)] = (Casting unit)
          • Set R_CasInitPos[(Integer A)] = (Position of R_Caster[(Integer A)])
          • Set R_Target[(Integer A)] = (Target unit of ability being cast)
          • Set R_TarInitPos[(Integer A)] = (Position of R_Target[(Integer A)])
          • Set R_CastDistance[(Integer A)] = (Distance between R_CasInitPos[(Integer A)] and R_TarInitPos[(Integer A)])
          • Set R_CasAngle[(Integer A)] = (Angle from R_CasInitPos[(Integer A)] to R_TarInitPos[(Integer A)])
          • Set R_SpFX = ((Position of R_Caster[(Integer A)]) offset by (0.50 x R_CastDistance[(Integer A)]) towards R_CasAngle[(Integer A)] degrees)
          • Special Effect - Create a special effect at R_SpFX using Abilities\Spells\Undead\DeathPact\DeathPactTarget.mdl
          • Special Effect - Destroy (Last created special effect)
          • Unit - Turn collision for R_Caster[(Integer A)] Off
          • Unit - Turn collision for R_Target[(Integer A)] Off
          • Unit - Pause R_Caster[(Integer A)]
          • Unit - Pause R_Target[(Integer A)]
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Player number of (Owner of (Triggering unit))) Equal to 1
            • Then - Actions
              • Trigger - Turn on R_TrigNumber[1]
              • Trigger - Turn on R_TarTrigNum[1]
            • Else - Actions


Trigger:
  • R Cas Movement red
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • Set R_CasDCount[(Integer A)] = (R_CasDCount[(Integer A)] + 30)
          • Set R_CasInitPos[(Integer A)] = (Position of R_Caster[(Integer A)])
          • Set R_CasMovetoPnt[(Integer A)] = (R_CasInitPos[(Integer A)] offset by (60.00 - (0.10 x R_CastDistance[(Integer A)])) towards (180.00 + R_CasAngle[(Integer A)]) degrees)
          • Unit - Move R_Caster[(Integer A)] instantly to R_CasMovetoPnt[(Integer A)]
          • Special Effect - Create a special effect at R_CasInitPos[(Integer A)] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • R_CasDCount[(Integer A)] Greater than (Integer(R_CastDistance[(Integer A)]))
            • Then - Actions
              • Custom script: call RemoveLocation(udg_R_CasInitPos[1])
              • Custom script: call RemoveLocation(udg_R_CasMovetoPnt[1])
              • Set R_CasDCount[(Integer A)] = 0
              • Unit - Turn collision for R_Caster[(Integer A)] On
              • Unit - Unpause R_Caster[(Integer A)]
              • Trigger - Turn off (This trigger)
            • Else - Actions


Trigger:
  • R Tar Movment red
    • Events
      • Time - Every 0.04 seconds of game time
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 1, do (Actions)
        • Loop - Actions
          • Set R_TarDCount[(Integer A)] = (R_TarDCount[(Integer A)] + 30)
          • Set R_TarInitPos[(Integer A)] = (Position of R_Target[(Integer A)])
          • Set R_TarMoveToPnt[(Integer A)] = (R_TarInitPos[(Integer A)] offset by (60.00 - (0.10 x R_CastDistance[(Integer A)])) towards R_CasAngle[(Integer A)] degrees)
          • Unit - Move R_Target[(Integer A)] instantly to R_TarMoveToPnt[(Integer A)]
          • Special Effect - Create a special effect at R_TarInitPos[(Integer A)] using Abilities\Weapons\AncientProtectorMissile\AncientProtectorMissile.mdl
          • Special Effect - Destroy (Last created special effect)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • R_TarDCount[(Integer A)] Greater than (Integer(R_CastDistance[(Integer A)]))
            • Then - Actions
              • Custom script: call RemoveLocation(udg_R_TarInitPos[1])
              • Custom script: call RemoveLocation(udg_R_TarMoveToPnt[1])
              • Set R_TarDCount[(Integer A)] = 0
              • Unit - Turn collision for R_Target[(Integer A)] On
              • Unit - Unpause R_Target[(Integer A)]
              • Unit - Cause R_Caster[(Integer A)] to damage R_Target[(Integer A)], dealing ((600.00 - R_CastDistance[(Integer A)]) x (0.50 x (Real((Level of Magnetic Field for R_Caster[(Integer A)]))))) damage of attack type Spells and damage type Normal
              • Trigger - Turn off (This trigger)
            • Else - Actions


Criticism very welcome, I need to improve a lot :)
Note to readers: I accidentally left Magnetic Field as the name for the ability, so just ignore that (I changed it half way through >_>)
 

Attachments

  • Invert Polarity.w3x
    49.9 KB · Views: 239

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Yes no need for those Integer A for 1 to 1 completely Useless
 

ArmyOfFrogs

New Member
Reaction score
20
Yeah I just had those in because selecting Integer A is quick and I was unsure of how I was going to set up the MUI then >_>
But they do serve a purpose. The variables are all stored in R_Variable[PlayerNumber], and those are just red's triggers so it does need them to work.
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
So you have triggers for each player to make it MUI still not only MPI
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
MUI:Multi Unit Instance
MPI:Multi Player Instance
 

ArmyOfFrogs

New Member
Reaction score
20
Oh ._. Dang. Yeah. I put in another hero with it and when cast at the same time, it either instantly teleports the 2nd caster to the first's position or it does both, however leaves 1 paused still.

Any ideas how I would go about making this MUI? ^^
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
Yes go read a MUI tut that will explain in detail on how to achive MUI
 

Gtam

Lerning how to write and read!! Yeah.
Reaction score
164
I have to agree much easier to achive MUI in jass
 

ArmyOfFrogs

New Member
Reaction score
20
Yeah I'm trying to learn JASS.. I have the basics down, just haven't had time nor want to practice anything more complex recently :p I guess I'll wait till tomorrow or later till this thread is gone to start on a jass spell ._. Such a pain to have to learn how to do everything again :[
 

BlackRose

Forum User
Reaction score
239
MUI (You need to add triggers based on how many players you have)
Just say no :D

Nice idea! I like it, but the effect used for pulling and stuff doesn't really suit it in my opinion. I expected something more, gravity :)
 

BlackRose

Forum User
Reaction score
239
Also, make your spell more easy to customizable, such as a random trigger that runs on init, have variables set there. Like spell Id (Though you could just do that in main trigger), any dummy id's, damage, healing amount, KB distance.
 

ArmyOfFrogs

New Member
Reaction score
20
Ah that stuff is based on how far / close you are to the target so I don't know how I could make it any easier to 'customize' it, aside from putting variables set to 1, and having those multiplied on all the essential values and then they can customize that. Though that's a very round-about way of doing it ._.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top