I am building a Guild Wars Arena map, and there is a specific mechanic in Guild Wars which I think I could use hash tables to replicate. I want to know if I'm right about this from someone who knows them better.
The mechanic in Guild Wars I am trying to trigger is called "conditions," which are a family of debuffs that are caused by many different skills. They are like this:
Disease - 8 health loss per second, can spread to nearby units
Burning - 14 health loss per second
Blindness - 90% chance to miss on attacks
Now, there are many more that cause damage or some other status effect, but these are just examples. I know that Blindness would be very easy to trigger without hash tables by just using Drunken Haze via a dummy unit. What I am concerned with is the damaging conditions.
For example, the Burning condition can be applied by several different abilities, and can last for varying durations based on these abilities. What I want to do with a hash table is link the unit that applied Burning to the unit that is being burned so I can cause the caster to damage the victim (via a trigger) for 2.8 every 0.20 seconds.
Two heroes, Hero_A and Hero_B, each have a different spell that causes burning:
Spell_A - causes burning condition for 7 seconds
Spell_B - causes burning condition for 3 seconds
Hero_A casts Spell_A on Target_A, and 2 seconds later, Hero_B casts Spell_B on Target_B. So I need a trigger that can do this:
Detects when a spell that causes burning is cast.
- Since all my spells will be triggered, this will almost be intrinsic to the spells anyway.
Place the Burning buff on the target for the duration specified.
- Easy with dummy units.
Run a trigger which causes every unit with the Burning buff to be damaged for 2.8 every 0.20 seconds by the unit which caused Burning.
- This is where I think I can use a hash table to key the target with the caster. If this is possible, I would not have to use dynamic indexing to achieve proper damage credit.
Detect when no more units are burning and shut off the 0.20 second loop, to avoid performance issues.
- Easy with unit groups, just attach a condition at the end of the loop to shut it off, and then a condition on all Burning spells to turn the loop back on if it isn't already on.
Am I right in assuming hash tables will make it possible to pair target and caster so that triggered periodic damage will be doable without indexing?
The mechanic in Guild Wars I am trying to trigger is called "conditions," which are a family of debuffs that are caused by many different skills. They are like this:
Disease - 8 health loss per second, can spread to nearby units
Burning - 14 health loss per second
Blindness - 90% chance to miss on attacks
Now, there are many more that cause damage or some other status effect, but these are just examples. I know that Blindness would be very easy to trigger without hash tables by just using Drunken Haze via a dummy unit. What I am concerned with is the damaging conditions.
For example, the Burning condition can be applied by several different abilities, and can last for varying durations based on these abilities. What I want to do with a hash table is link the unit that applied Burning to the unit that is being burned so I can cause the caster to damage the victim (via a trigger) for 2.8 every 0.20 seconds.
Two heroes, Hero_A and Hero_B, each have a different spell that causes burning:
Spell_A - causes burning condition for 7 seconds
Spell_B - causes burning condition for 3 seconds
Hero_A casts Spell_A on Target_A, and 2 seconds later, Hero_B casts Spell_B on Target_B. So I need a trigger that can do this:
Detects when a spell that causes burning is cast.
- Since all my spells will be triggered, this will almost be intrinsic to the spells anyway.
Place the Burning buff on the target for the duration specified.
- Easy with dummy units.
Run a trigger which causes every unit with the Burning buff to be damaged for 2.8 every 0.20 seconds by the unit which caused Burning.
- This is where I think I can use a hash table to key the target with the caster. If this is possible, I would not have to use dynamic indexing to achieve proper damage credit.
Detect when no more units are burning and shut off the 0.20 second loop, to avoid performance issues.
- Easy with unit groups, just attach a condition at the end of the loop to shut it off, and then a condition on all Burning spells to turn the loop back on if it isn't already on.
Am I right in assuming hash tables will make it possible to pair target and caster so that triggered periodic damage will be doable without indexing?