• 🏆 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] How to develop?

Status
Not open for further replies.
Level 11
Joined
Mar 27, 2011
Messages
293
Hello!,

Good morning, good afternoon or good evening to you that are reading this thread, I write it because I have the following questions to be answered about the development of spells in GUI / Triggers. Namely:

  • How to develop a spell which is a skill that can be chosen aura which should be activated? For example: a paladin auras has two: the retribution and protection, such as manufacture this spell for the user to choose which should remain in the paladin aura?
  • How to develop a very spell and uses the hashtable that allows the use of numerous times by various Casters on the same target?

Finally, thank you for kindly participating in this thread, feel free to opine, suggest, criticize, and help in the end, makes its contribution.
 
hello Losam,

For the First Question :
1. Make a Spellbook ability, then create 2 channel abilities with different base ID, and the aura ability.
2. Make this trigger for each aura :
  • Events
  • Unit - Unit Start the Effect of an ability
  • Conditions
  • Ability being cast equals to Your_Aura (Ability)
  • Actions
  • Set Unit_Group = Unit within (Aura_Range) matching (Matching Unit) is an ally of (Triggering Player) equals to true
  • Unit Group
    • Loop
      • Actions
        • Unit - Remove (Switched_Aura_Buff) from (Picked Unit)
  • Unit - Remove (Switched_Aura) from (Triggering Unit)
  • Unit - Add (Your_Aura) to (Triggering Unit)
  • -----------Below you only need one of them----------
  • -----------UMSWE----------
  • Unit Group - Destroy Unit_Group
  • -----------World Editor--------
  • Custom Script - Call DestroyGroup(udg_Unit_Group)
Done!
Good luck :)
Have a nice day.
 
Last edited:
hello Losam,

For the First Question :
1. Make a Spellbook ability, then create 2 channel abilities with different base ID, and the aura ability.
2. Make this trigger for each aura :
  • Events
  • Unit - Unit Start the Effect of an ability
  • Conditions
  • Ability being cast equals to Your_Aura (Ability)
  • Actions
  • Set Unit_Group = Unit within (Aura_Range) matching (Matching Unit) is an ally of (Triggering Player) equals to true
  • Unit Group
    • Loop
      • Actions
        • Unit - Remove (Switched_Aura_Buff) from (Picked Unit)
  • Unit - Remove (Switched_Aura) from (Triggering Unit)
  • Unit - Add (Your_Aura) to (Triggering Unit)
  • -----------Below you only need one of them----------
  • -----------UMSWE----------
  • Unit Group - Destroy Unit_Group
  • -----------World Editor--------
  • Custom Script - Call RemoveLocation(udg_Unit_Group)
Done!
Good luck :)
Have a nice day.

A group should use DestroyGroup because it is not a location. Your trigger lacks a base point from which the AoE works. Also, auras last some 3 secs before disappearing, no matter if you are not in range anymore.

How to develop a very spell and uses the hashtable that allows the use of numerous times by various Casters on the same target?

You dont need a hashtable for a spell to be Mui. All you need is understanding.
 

Dr Super Good

Spell Reviewer
Level 64
Joined
Jan 18, 2005
Messages
27,202
•How to develop a spell which is a skill that can be chosen aura which should be activated? For example: a paladin auras has two: the retribution and protection, such as manufacture this spell for the user to choose which should remain in the paladin aura?
Spell book with abilities or a dummy toggle ability for setting the aura. The actual auras are placed in a spell book that is disabled so as not to be visible to the owner (most of the time at least). You can add and remove spell book abilities, each containing 1 aura to adjust which aura is active. Aura ability level can be modified using triggers like it was any ability (nothing special, just reference the ability type, the unit and set the level).

•How to develop a very spell and uses the hashtable that allows the use of numerous times by various Casters on the same target?
Complex abilities with no real periodic nature require you to use the hashtable in such a way as to avoid collisions. If a collision does occur you can use linked list principles to handle the collision. As hashtables are slower than array lookups, an indexing system is used to store the ability instance data with a unique index per instance. When hashtables are used you store this instance index integer on the unit, and not actual data. In the case of a hash collision you can make instances link to each other like a linked list and then iterate through the linked list until you find the instance you are after or do the effect you want however cases where hashtable collisions could occur are few and far between.

The other approach is to iterate through all active instances ever periodic unit and do some actions. This is best for abilities with durations and will mostly avoid the need for hashtables completely.

An ability instance is one unit of the ability that is doing an effect. It can be per ability cast, per unit affected or even based on other events.
 
Status
Not open for further replies.
Top