• 🏆 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] A few questions for spell set-up

Status
Not open for further replies.
Level 1
Joined
Oct 12, 2011
Messages
3
I have some questions(as the title would imply) about setting up a few spells through Triggers. I know very little about GUI and JASS, and I'm fairly new to using the editor for things like this, but, anyway, here are my questions:

1. I want to setup a spell that is used as an on-hit ability that deals damage based on level&stats but has a cooldown. I tried using a few of the in-game ones that are similiar as a base(cold arrows and searing arrows), the ability was used on hit, the cooldown procced properly, but the triggers didn't add any damage. I'd also like the ability to stun for 1 second, but I couldn't find a way to stun the unit with triggers.
This is what I have so far(Currently using Cold Arrows as base ability, have duration for Heros&Units set to 1 second, slows by 0.01 and deals 0.01 damage, I assumed this necessary for triggers):
  • Slam
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Slam
    • Actions
      • Set Caster2 = (Triggering unit)
      • Set Target2 = (Target unit of ability being cast)
      • Set LoopCounter2 = 0
      • Unit - Cause Caster2 to damage Target2, dealing ((Real((Strength of Caster2 (Include bonuses)))) x (0.10 x (Real((Level of Slam for Caster2))))) damage of attack type Normal and damage type Normal
      • Trigger - Turn on SlamMove <gen>
  • SlamMove
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set TempLoc03 = (Position of Caster2)
      • Set TempLoc04 = (Position of Target2)
      • Set TempLoc05 = (TempLoc04 offset by 5.00 towards (Angle from TempLoc03 to TempLoc04) degrees)
      • Unit - Move Target1 instantly to TempLoc05
      • Custom script: call RemoveLocation(udg_TempLoc03)
      • Custom script: call RemoveLocation(udg_TempLoc04)
      • Custom script: call RemoveLocation(udg_TempLoc05)
      • Set LoopCounter2 = (LoopCounter2 + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LoopCounter Greater than 25
        • Then - Actions
          • Unit - Order Target2 to Attack Caster2
          • Trigger - Turn off (This trigger)
        • Else - Actions
It's basically a copy-paste of the ability I have below that does work, but I don't know what I need to change to make it work, nor what to change to make it stun. Also, the knockback was going to be just for effect, if I have to disable it to make this ability work properly I can.

2. I also wanted a passive ability like Immolate(which I tried using as a base) that burned nearby enemies for damage, but that also increases health regen by a flat amount in an AoE around the hero containing it. I also tried Unholy Aura as a base, but having the health regen at 0.05 seemed to increase his actual health regen by a lot more than 0.05, and I wasn't sure how to set-up the AoE damage

3. The third ability I'm having trouble with is a mana-shield-like ability that absorbs 1 damage per point of mana, and increases mana regen. I used Mana Shield as a base, because it seemed obvious, but I still can't find a way to set-up triggers to increase regeneration.

So far, this is the spell I have working, it's faily simple and I used paskovich's tutorial(http://www.hiveworkshop.com/forums/...ials-279/creating-some-basic-abilities-32827/) to set-up the knockback. In fact, really all I did was add the trigger for damage and the trigger for the unit to attack move to the caster(sometimes the unit would drop aggro, or just wouldn't aggro from the initial cast)
  • AquaJet
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Aqua Jet (Neutral Hostile)
    • Actions
      • Set Caster1 = (Triggering unit)
      • Set Target1 = (Target unit of ability being cast)
      • Set LoopCounter = 0
      • Unit - Cause Caster1 to damage Target1, dealing ((Real((Intelligence of Caster1 (Include bonuses)))) x (0.10 x (Real((Level of Aqua Jet (Neutral Hostile) for Caster1))))) damage of attack type Spells and damage type Normal
      • Trigger - Turn on AquaJetMove <gen>
  • AquaJetMove
    • Events
      • Time - Every 0.02 seconds of game time
    • Conditions
    • Actions
      • Set TempLoc00 = (Position of Caster1)
      • Set TempLoc01 = (Position of Target1)
      • Set TempLoc02 = (TempLoc01 offset by 5.00 towards (Angle from TempLoc00 to TempLoc01) degrees)
      • Unit - Move Target1 instantly to TempLoc02
      • Custom script: call RemoveLocation(udg_TempLoc00)
      • Custom script: call RemoveLocation(udg_TempLoc01)
      • Custom script: call RemoveLocation(udg_TempLoc02)
      • Set LoopCounter = (LoopCounter + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • LoopCounter Greater than 50
        • Then - Actions
          • Unit - Order Target1 to Attack Caster1
          • Trigger - Turn off (This trigger)
        • Else - Actions
Anything I can do to clean up any leaks is always appreciated, I'm a little ignorant as to everything that could cause a leak.
EDIT: Also, I want the abilities to preferably be multiplayer(MUI if I'm not mistaken?), no duplicate classes currently, but I MAY change that in the future, once I've set up more of the map.
EDITAGAIN: After re-reading it, I noticed I didn't really ask any questions, sorry : /
Here are the questions, stripped and basic:
1. How do I set up an on-hit ability with a cooldown that stuns and deals damage, with a small knockback?
2. How do I set up an ability to increase health regen by a flat amount in an aura around the unit, and burn nearby enemies for flat damage?
3. How do I set up a mana-shield-esque ability that also increases the unit's mana regeneration by a flat amount?
 
Last edited:
Level 37
Joined
Mar 6, 2006
Messages
9,240
1. Use Channel as the base ability.

Delete Art - Target, Art - Effect and Art - Caster.
Set base order id to something else than channel. It is used to order the unit to perform the ability.
Set disable other abilities to false.
Set follow through time to 1. Ths is the duration the unit keeps the order of this ability, and does not auto-attack for example.
Set options to visible, so the ability button shows up.
Target type - unit.
Adjust cast range, mana cost and cooldown.
Add enemy to targets allowed. Add others to your liking.

When the unit starts the effect of the ability, create a dummy unit and order it to cast custom storm bolt on the target. Use a knockback system from the spell database, add the target to it.

2.
Event - Unit is issued an order
Condition - Issuerd order == immolation
Events
Add unit to unit group
Add custom item life regeneration ability to unit
Turn on trigger 2

In trigger 2 you loop through all units in the group every 1 second or so. If the unit has buff immolation, do nothing. If the unit doesn't have it, remove the life regen ability and remove the unit from the group. Turn trigger off if the group is empty.

3.
Pretty much the same but you need to add mana to the unit in the looping trigger, and not add an ability.
 
Level 8
Joined
Dec 9, 2009
Messages
397
I see you have 6 temp locs, which is really unnecessary unless you need to save 6 locations at one time for 1 trigger.

Same with your caster01 caster 02, I'm sure you won't have 2 casting units in the same trigger.

as long as you have no waits you don't need to use different variables.

Have all your casting units set to "Caster"

If a trigger uses 1 loc in it, it only needs "TempLoc"
and all triggers can use temp loc.
 
Level 8
Joined
Jan 8, 2010
Messages
493
1. if you want a on-hit ability like Searing Arrows/Cold Arrows with other effects (knockback, stat-based damage) you can base it off from those abilities, set damage to 0, and duration to something like 0.10, or anything as long as it's not 0.00. then use a damage-detect system (if you're GUI, you can use Weep's or Bribe's system, search for it in the spells section). then use a trigger to whenever a unit takes damage, check if it has the buff from those abilities (i prefer Cold Arrows since it gives the buff). if the unit has the buff, add what you would like. (knockback, stat-based damage, etc)

2/3. just like what Maker said. you can also use the condition
Issued Order = "Unimmolation"
to check for unit's that stop Immolation instead of using a periodic trigger that checks if a unit has Immolation buff.
 
Level 1
Joined
Oct 12, 2011
Messages
3
Thank you all for the help, it's been very helpful and I greatly appreciate it!

I see you have 6 temp locs, which is really unnecessary unless you need to save 6 locations at one time for 1 trigger.

Same with your caster01 caster 02, I'm sure you won't have 2 casting units in the same trigger.

as long as you have no waits you don't need to use different variables.

Have all your casting units set to "Caster"

If a trigger uses 1 loc in it, it only needs "TempLoc"
and all triggers can use temp loc.

Oh, lol, I assumed I had to use different variables, I didn't know if there would or wouldn't be issues with those abilities if multiple triggers used the same variables
 
Status
Not open for further replies.
Top