[Spell Help] Negative Magic Resist Aura

Jinxx

New Member
Reaction score
4
I hate the fact that it keeps on blindly firing in the background; it's complete overkill, like trying to destroy a run-down building by nuking the whole country to pieces!
:)
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
well, i would say games updating about 40 times a second (frame-rate) are kind of running periodically. they are practically based on periodic events.
 

HeX.16

Isn't Trollin You Right Now
Reaction score
131
Can someone solve this is a little annoying to see this at the top of the list xD Right now its just become spam.

=/
 

Jinxx

New Member
Reaction score
4
Can someone solve this is a little annoying to see this at the top of the list xD Right now its just become spam.
Why is it spam? :confused: We're discussing a problem in a civilized and intelligent manner! :D

Revelation: Oh crap, something just hit me! If an enemy has the negative magic resistance, won't that mean that they'll take more "damage" from friendly spells as well? Like, say, receiving more healing?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
this is a forum aint it? we are just chatting about some topic related to this thread.

@Jinx: I dont know, does the original ability decrease the effect of healing magic? maybe there is a field like "targets allowed", i didnt used that ability that much.
 

Jinxx

New Member
Reaction score
4
@Jinx: I dont know, does the original ability decrease the effect of healing magic? maybe there is a field like "targets allowed", i didnt used that ability that much.
The original ability belongs to the "Runed Bracers" item. I'd have to test it to see if it decreases incoming heals, but I doubt it since the bracers aren't a cursed item - they should help the wearer mitigate incoming hostile magics, not friendly spells.

But once this is turned from item to unit ability, it has all the fields like any other normal ability, so I guess those can be used to control what it increases/decreases. Hmm... this could be a pretty cool ability for a healer hero, increasing the potency of his/her spells via an AoE friendly-buff! :thup:

EDIT:
Would it be better to go with the vanilla GUI periodic trigger for this, or do the following in JASS:

- unit enters range of an enemy hero posessing the magic-resist decreasing aura (aura level > 0)
- give the entering unit the negative magic resistance ability and level it to the aura's level
- start a repeatable timer that will expire within 1.0x[Level of Aura] seconds
- store the entering unit and the enemy aura owner into a hashtable

- when timer expires, check to see if the victim with the decreased magic resistance is still within range of the aura's owner
- if yes, then do nothing and wait for the next timer expiration (meaning the aura buff would be refreshed if this were a normal aura)
- if not, then remove the negative magic resistance ability from the victim, stop the timer, do cleanup

Also, destroying timers is bad, right?
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
why do you use a timer? as far as i can see it wouldnt ever remove the aura from the target if only a single unit where effected by it.

i would do it like this:
(BEWARE HANDWRITTEN!)
Code:
Trigger1
Event
 Unit come into x range of AuraHero
Condition
 (triggering Unit) got Buff MyAuraBuff == false
Action
 Add (triggering Unit) to BuffedUnitGroup
 set BuffedUnitCounter = BuffedUnitCounter +1

Code:
Trigger2
Event
 Every 0.1 seconds
Condition
 BuffedUnitCounter > 0
Action
 pick all units within BuffedUnitGroup
   loop actions
     if Conditions
       distance between (picked unit) and AuraHero > xxx
     Then
       Remove MyAuraBuff from (picked unit)
       Remove (picked unit) from BuffedUnitGroup
       set BuffedUnitCounter = BuffedUnitCounter -1
     Else
 
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