• 🏆 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] Self-cast hero buff ability (noob question)

Status
Not open for further replies.
Level 2
Joined
Aug 18, 2022
Messages
7
I want to add a new ability which is basically a self-cast Bloodlust or a weaker Chemical Rage (minus the transformation). I figured I could just copy the latter and remove the transformation-related stuff, but it seems like it's not possible to remove fields. I also tried copying Berserk, but then it's no longer a hero ability (can't be leveled up, etc.).

Any tips on how I should make the ability? Am I approaching this from a completely wrong side?

EDIT: nvm found that you can convert a normal ability into a hero ability with one simple check
 
Last edited:
Level 21
Joined
Dec 4, 2007
Messages
1,482
There should be a self cast bloodlust on the Rexxar's boars already.

Chemical rage should work too, just make the transform the same model with faster attacks and slightly increased size.
 

Uncle

Warcraft Moderator
Level 64
Joined
Aug 10, 2018
Messages
6,585
Most custom spells use Dummy units, which are uncontrollable and completely invisible units, to cast spells for you.
This method can be used to recreate the effects of any ability via triggers.

Here's an example:
  • Dummy Spell
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust (Hero)
    • Actions
      • -------- Setup: --------
      • Set VariableSet Caster = (Triggering unit)
      • Set VariableSet DummyPoint = (Position of Caster)
      • -------- --------
      • -------- Create Dummy: --------
      • Unit - Create 1 Dummy for (Owner of Caster) at DummyPoint facing Default building facing degrees
      • Set VariableSet DummyUnit = (Last created unit)
      • Unit - Add a 0.50 second Generic expiration timer to DummyUnit
      • -------- --------
      • -------- Cast Bloodlust: --------
      • Unit - Add Bloodlust (Dummy) to DummyUnit
      • Unit - Set level of Bloodlust (Dummy) for DummyUnit to (Level of (Ability being cast) for Caster)
      • Unit - Order DummyUnit to Orc Shaman - Bloodlust Caster
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation(udg_DummyPoint)
Bloodlust (Hero) is based on Thunderclap. When the Hero casts this ability a Dummy unit is created and casts Bloodlust on him. So you're basically giving your Hero a fake ability which is used to trigger the effects of the real ability (Bloodlust). This leaves us with what appears to be Bloodlust but without the Autocasting/Targeting mechanics.

This same method can be used with Unit Group variables and the Pick Every Unit action to do things like cast Area of Effect Bloodlust:
Note: I took this from another thread which is why it's called War Cry.
  • Area of Effect Bloodlust
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to War Cry (Hero)
    • Actions --------
      • -------- Set some important Variables and add nearby units to a Unit Group: --------
      • Set VariableSet WarCry_Caster = (Triggering unit)
      • Set VariableSet WarCry_Player = (Triggering player)
      • Set VariableSet WarCry_Point = (Position of WarCry_Caster)
      • Set VariableSet WarCry_Group = (Units within 1000.00 of WarCry_Point.)
      • -------- --------
      • -------- Setup the Dummy which will cast Bloodlust: --------
      • Unit - Create 1 Dummy for WarCry_Player at WarCry_Point facing Default building facing degrees
      • Set VariableSet WarCry_Dummy = (Last created unit)
      • Unit - Add War Cry (Dummy) to WarCry_Dummy
      • Unit - Set level of War Cry (Dummy) for DummyUnit to (Level of (Ability being cast) for Caster)
      • Unit - Add a 0.50 second Generic expiration timer to WarCry_Dummy
      • -------- --------
      • -------- Cast Bloodlust on valid units within X range of the caster: --------
      • Unit Group - Pick every unit in WarCry_Group and do (Actions)
        • Loop - Actions
          • Set VariableSet WarCry_Target = (Picked unit)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (WarCry_Target is alive) Equal to True
              • (WarCry_Target belongs to an ally of WarCry_Player.) Equal to True
              • (WarCry_Target is A structure) Equal to False
            • Then - Actions
              • Unit - Order WarCry_Dummy to Orc Shaman - Bloodlust WarCry_Target
            • Else - Actions
      • -------- --------
      • -------- Clean up memory leaks: --------
      • Custom script: call RemoveLocation (udg_WarCry_Point)
      • Custom script: call DestroyGroup(udg_WarCry_Group)
 

Attachments

  • Dummy Example.w3m
    18 KB · Views: 8
Last edited:
Status
Not open for further replies.
Top