• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Spell] "Stab Spell"

Status
Not open for further replies.
Level 5
Joined
Jan 18, 2012
Messages
179
Hey guys I am looking for a realistic GUI combat system, so is there a stab spell on hiveworkshop or smth similiar that works like that? I searched alot but couldn't find one, shall I request it or you know something more than I do?

If you didn't get it, stab spell means: You click it (not target, but click, like berserk,roar,etc), it does your caster's base damage or smth, and any unit infront of caster loses that damage as health in a small range (sword's range)
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
So basically you want to damage units in cone-like shape in front of the caster? Something like "Cleaving Attack" ability but an active skill instead?

Edit: If you want what I wrote about, you can use this trigger for it. Just make a dummy ability for your hero to start this spell.
  • Meat Hook Cleave Copy
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to YourAbility
    • Actions
      • Set TempPoint1 = (Position of (Triggering unit)) /// this is point variable
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in (Units within 300.00 of TempPoint1 matching ((((Matching unit) is alive) Equal to True) and (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False))) and do (Actions)
        • Loop - Actions
          • Set TempPoint2 = (Position of (Picked unit)) /// this is point variable
          • Set Facing = (Facing of (Triggering unit)) /// this is Real variable
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Acos((Cos((Facing - (Angle from TempPoint1 to TempPoint2)))))) Less than or equal to 45.00
            • Then - Actions
              • Unit - Cause (Triggering unit) to damage (Picked unit), dealing XYZ damage of attack type Chaos and damage type Normal
            • Else - Actions
          • Custom script: call RemoveLocation(udg_TempPoint2)
          • Custom script: set udg_TempPoint2 = null
      • Custom script: call RemoveLocation(udg_TempPoint1)
      • Custom script: set udg_TempPoint1 = null
The number 45 at the end of this line:
  • (Acos((Cos((Facing - (Angle from TempPoint1 to TempPoint2)))))) Less than or equal to 45.00
means that you will pick up units that are within 45 degrees to the left and 45 to the right from where your unit is facing. Setting the number to 60 will change it to 60 degrees.

If you want the damage of this ability to be equal to normal damage of your hero, you will need to calculate it.
Usually, the calculation looks like this
- for minimum damage: [DAMAGE BASE] + [PRIMARY ATTRIBUTE] + [NUMBER OF DICE]
- for maximum damage: [DAMAGE BASE] + [PRIMARY ATTRIBUTE] + [ (NUMER OF DICE) * (SIDES PER DICE) ]
you add primary attribute because that one by default adds +1 damage per each point of the attribute.
Damage base, number of dice and sides per dice can be found under Combat part of your unit in object editor.
 
Last edited:
Level 5
Joined
Jan 18, 2012
Messages
179
Please check my post in your wall, what I wan't exactly is that: The hero will do normal attack damage and any unit infront of him in range of his sword (small range) will take 20 DMG.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
Couldn't figure out how to attach map to PM, so I'm adding it here.
I am currently using old WCIII version, so you may get notification when loading this map; however everything should work well.

The map includes a very basic "How to import spell" and "How to customize this spell". Both can be found in the trigger editor.

----
Also, the calculation for this spell is not my own idea, I've found it some time back in one of threads here and thought I could use it for my own maps as well (so I take no credits for this :wink: )
 

Attachments

  • StabSpell.w3x
    15.2 KB · Views: 116
Status
Not open for further replies.
Top