[vJASS] Efficient way to put abilities into items?

Status
Not open for further replies.
Level 6
Joined
Oct 23, 2011
Messages
182
I've been trying to put special abilties into items (mainly passives)
What would be efficient way to do it?

Checking if a unit has the item every time it gets damaged/healed/etc. looks pretty bad

I was going to try to use Nestharus' Event.. but I realized it has no unregister(the special ability should be gone once the item is dropped)

Maybe I have to create a linked list of events ?
Tips would be greatly appreciated =)
 
It depends on what you are trying to do, but in general you can always use damage events/heal events because it will make everything a lot simpler. (as long as you are using a system for it) You may be thinking that it is a process-intensive method of doing it, but it isn't very noticeable.

Basically: on damage -> check if unit has item -> do actions

Or on whatever event that you want the passive to activate/have a chance of activating. If the unit does not have the item, it won't do the actions so there is no need for an unregister or anything like that.

You are probably thinking of only registering for the units who pickup the item, but it is pretty efficient to use the other method, and it is a lot less work. =)
 
Well... the trigger would work only if someone has the items... Shouldn't be that "heavy" for the system to handle units that way.
 
I use a damage detection system which allows me to create passive abilities that are instanciated (is that an english word?) per unit. So you can easily set up a trigger for item acquisition and one for dropping them and add/remove those abilities respectively.
(ADamage, IDS, grim001's DDstructs, etc have this functionality)
 
I use a damage detection system which allows me to create passive abilities that are instanciated (is that an english word?) per unit. So you can easily set up a trigger for item acquisition and one for dropping them and add/remove those abilities respectively.
(ADamage, IDS, grim001's DDstructs, etc have this functionality)

Do you have 1 trigger per each item?
 
Status
Not open for further replies.
Back
Top