• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

[Spell] Trying to make Hashtable work with Special Effect.

Status
Not open for further replies.
Level 9
Joined
Jul 7, 2011
Messages
275
Hello everyone.

I'm here asking for help so I can solve a problem with my custom skill (use triggers).

As Special Effect there is no trigger to group. So I'm using Hashtable to store all the effects, and so destroy them.

But I can not communicate to the Editor that the data inside the hashtable must be loaded and destroyed. Check below what I have done to now:

  • Events
    • Time - Elapsed game time is 1.00 seconds
  • Conditions
  • Actions
    • Visibility - Disable black mask
    • Visibility - Disable fog of war
    • Player Group - Pick every player in (All players) and do (Camera - Pan camera for (Picked player) to (Center of Taverna <gen>) over 0.00 seconds)
    • Player Group - Pick every player in (All players) and do (Player - Add 1000 to (Picked player) Current gold)
    • Set WindfuryChance = 8
    • Set WindfuryAttacks = 2
    • Hashtable - Create a hashtable
    • Set WindfuryHashtable = (Last created hashtable)
  • Windfury Learn
    • Events
      • Unit - A unit Learns a skill
    • Conditions
      • (Learned Hero Skill) Equal to Windfury Weapon
    • Actions
      • Set WindfuryLearned = (Learning Hero)
      • Set WindfuryChance = (WindfuryChance + 2)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Windfury Weapon for (Learning Hero)) Greater than or equal to 5
        • Then - Actions
          • Set WindfuryAttacks = 3
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Windfury Weapon for (Learning Hero)) Equal to 1
        • Then - Actions
          • Set WindfuryCouting = WindfuryAttacks
        • Else - Actions
  • Windfury Working
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Attacking unit) Equal to WindfuryLearned
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Random integer number between 1 and 100) Less than or equal to WindfuryChance
        • Then - Actions
          • Unit - Create 1 Dummy 002 for (Owner of (Attacking unit)) at (Position of (Attacking unit)) facing Default building facing degrees
          • Set Windfurydummy = (Last created unit)
          • Unit - Add a 5.00 second Generic expiration timer to Windfurydummy
          • Unit - Order Windfurydummy to Undead Necromancer - Unholy Frenzy (Attacking unit)
          • Special Effect - Create a special effect at (Position of (Attacked unit)) using Abilities\Spells\NightElf\Cyclone\CycloneTarget.mdl
          • Hashtable - Save Handle Of(Last created special effect) as (WindfuryDates + 1) of WindfuryDates in WindfuryHashtable
          • Set WindfuryCouting = (WindfuryCouting - 1)
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • WindfuryCouting Less than or equal to 0
        • Then - Actions
          • Unit - Remove Windfury buff from (Attacking unit)
          • Set WindfuryCouting = WindfuryAttacks
        • Else - Actions
  • Events
    • Time - Every 2.00 seconds of game time
  • Conditions
  • Actions
    • For each (Integer A) from 1 to 10, do (Actions)
      • Loop - Actions
        • Special Effect - Destroy (Load (Integer A) of WindfuryDates in WindfuryHashtable)



I wish the Special Effect lasts only 2 seconds, after it is destroyed.

About Maledict, I abandoned. Now I'm just working on my project that I announced. Depending will be fun to play.

Edited: Accountant is not working correctly if you want to help me in that too. Then I'm going to review triggers and try to fix all.
 
Last edited:

Chaosy

Tutorial Reviewer
Level 40
Joined
Jun 9, 2011
Messages
13,186
For starters, it is generally not suggested to such a "learn skill trigger" you simply do : damage[levelOfAbility] in the trigger that starts the spell.
The way you store the data is also flawed in multiple ways.

Store the effect as:
(handle id of attacking unit) of 0

this means that that each unit will have an effect saved at position 0, this makes it way easier and cleaner to remove.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
Be aware the maximum faster attack speed a unit can have is +400%. This is from all sources including agility, buffs, abilities and items. After this it will not attack any faster.

What you want is a simple trigger system to handle timed special effects. This works much like normal MUI abilities except only manages a single special effect per instance. If one polls he duration of the special effects, this could be implemented only using arrays (no hash tables).
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Be aware the maximum faster attack speed a unit can have is +400%. This is from all sources including agility, buffs, abilities and items. After this it will not attack any faster.

What you want is a simple trigger system to handle timed special effects. This works much like normal MUI abilities except only manages a single special effect per instance. If one polls he duration of the special effects, this could be implemented only using arrays (no hash tables).

Hold on, I thought there is only a limit on max atk spd, 10/s.
There are plenty of maps that turn 0.3/s-0.5/s into 10/s, which is way above 400%. Except if it uses different math for that ?
Even 1/s > 10/s is above 400%...

regards
-Ned
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,232
Hold on, I thought there is only a limit on max atk spd, 10/s.
There are plenty of maps that turn 0.3/s-0.5/s into 10/s, which is way above 400%. Except if it uses different math for that ?
Even 1/s > 10/s is above 400%...
There is a limit on maximum faster attack speed of -80% to +400%. If a unit has a default attack rate of 1 attack per game second then it will max out at 5 attacks per game second. If a unit has an attack rate of 2 attacks per game second then it will max out at 10 attacks per game second.

Faster attack speed limit has nothing to do with the base attack speed of a unit. That said the unit may be subject to other limits before reaching the maximum faster attack speed limit such as due to backswing time or hard limits to attacks per game second.
 
Status
Not open for further replies.
Top