• 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.

Using an item gives you Bloodlust ability! [Solved]

Level 11
Joined
Jun 20, 2017
Messages
380
I have an item that can use Bloodlust (Channel) on self or a friendly unit!
My problem is that if I use the item on the target, it still buffing me and not the target!
What I'm trying to achieve is an item that uses a channel ability or whatever which applies a buff to the target.
  • Bloodlust
    • Events
      • Unit - A unit Uses an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Bloodlust
    • Actions
      • -------- Setup --------
      • Set VariableSet TriggeringUnit = (Triggering unit)
      • Set VariableSet OwnerOfUnitPlayer = (Owner of TriggeringUnit)
      • -------- --------
      • -------- Setup Point --------
      • Set VariableSet PositionOfUnit = (Position of TriggeringUnit)
      • -------- --------
      • -------- Setup Dummy --------
      • Unit - Create 1 Dummy Bloodlust for OwnerOfUnitPlayer at PositionOfUnit facing Default building facing degrees
      • Set VariableSet LastCreatedUnit = (Last created unit)
      • Unit - Add a 0.50 second Generic expiration timer to LastCreatedUnit
      • -------- --------
      • -------- Cast Bloodlust --------
      • Unit - Add Bloodlust [Dummy] to LastCreatedUnit
      • Unit - Set level of Bloodlust [Dummy] for LastCreatedUnit to (Level of Channel [Custom] for TriggeringUnit)
      • Unit - Order LastCreatedUnit to Orc Shaman - Bloodlust TriggeringUnit
      • -------- --------
      • Custom script: call RemoveLocation(udg_PositionOfUnit)
 
Level 11
Joined
Jun 20, 2017
Messages
380
How exactly? because it crashes my game!
  • Draculas Cloak
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set VariableSet TriggeringUnit = (Triggering unit)
      • Set VariableSet TargetUnitOfAbilityBeingCast = (Target unit of ability being cast)
      • Set VariableSet OwnerOfUnitPlayer = (Owner of TriggeringUnit)
      • -------- --------
      • -------- Setup Point --------
      • Set VariableSet PositionOfUnit = (Position of TriggeringUnit)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Bloodlust [Channel] [Custom] Item
        • Then - Actions
          • -------- Setup Dummy --------
          • Unit - Create 1 [Dummy] Select for OwnerOfUnitPlayer at PositionOfUnit facing Default building facing degrees
          • Set VariableSet LastCreatedUnit = (Last created unit)
          • Unit - Add a 0.50 second Generic expiration timer to LastCreatedUnit
          • -------- --------
          • Unit - Add Bloodlust (Neutral Hostile 1) [Custom] Dummy to LastCreatedUnit
          • Unit - Set level of Bloodlust (Neutral Hostile 1) [Custom] Dummy for LastCreatedUnit to (Level of (Ability being cast) for TriggeringUnit)
          • Unit - Order LastCreatedUnit to Orc Shaman - Bloodlust TriggeringUnit
        • Else - Actions
          • Unit - Create 1 [Dummy] Select for (Owner of TargetUnitOfAbilityBeingCast) at (Position of TargetUnitOfAbilityBeingCast) facing Default building facing degrees
          • Set VariableSet LastCreatedUnit = (Last created unit)
          • Unit - Add a 0.50 second Generic expiration timer to LastCreatedUnit
          • -------- --------
          • Unit - Add Bloodlust (Neutral Hostile 1) [Custom] Dummy to LastCreatedUnit
          • Unit - Set level of Bloodlust (Neutral Hostile 1) [Custom] Dummy for LastCreatedUnit to (Level of (Ability being cast) for TargetUnitOfAbilityBeingCast)
          • Unit - Order LastCreatedUnit to Orc Shaman - Bloodlust TargetUnitOfAbilityBeingCast
      • -------- --------
      • Custom script: call RemoveLocation(udg_PositionOfUnit)
 
Last edited:
Level 30
Joined
Aug 29, 2012
Messages
1,384
I don't understand why the if/then/else is necessary, I think you can simplify it a lot
  • Bloodlust
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Bloodlust (Item)
    • Actions
      • Set VariableSet Point_Temp = (Position of (Triggering unit))
      • -------- -------------------- --------
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at Point_Temp facing Default building facing degrees
      • Unit - Add a 1.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Bloodlust (Actual) to (Last created unit)
      • Unit - Order (Last created unit) to Orc Shaman - Bloodlust (Target unit of ability being cast)
      • -------- -------------------- --------
      • Custom script: call RemoveLocation(udg_Point_Temp)
Whether you cast it on yourself or an ally the dummy will target the unit of the ability being cast anyway
 
Last edited:

Uncle

Warcraft Moderator
Level 73
Joined
Aug 10, 2018
Messages
7,877
Just to clarify, in Chaosium's trigger the (Ability being cast) is your Channel item ability and the Dummy is given the REAL Bloodlust ability. Otherwise, you would be creating an infinite loop again.

Long story short, Items use the same exact Ability Event system that you've been using in your other custom ability triggers.
 
Level 14
Joined
Jan 10, 2023
Messages
250
I want to clarify my remark, in case that was misunderstood (@Uncle I was wondering if you thought I was commenting on Chaosium's trigger, that trigger is fine - I was referring to AlwaysAndForever's trigger and affirming Chaosium that the If/Then/Else isn't just unnecessary, it's the problem with AlwaysAndForever's import of Chaosium's trigger).

This trigger has an infinite loop (both do, but I only need one example):
  • Draculas Cloak
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Set VariableSet TriggeringUnit = (Triggering unit)
      • Set VariableSet TargetUnitOfAbilityBeingCast = (Target unit of ability being cast)
      • Set VariableSet OwnerOfUnitPlayer = (Owner of TriggeringUnit)
      • -------- --------
      • -------- Setup Point --------
      • Set VariableSet PositionOfUnit = (Position of TriggeringUnit)
      • -------- --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Ability being cast) Equal to Bloodlust [Channel] [Custom] Item
        • Then - Actions
          • -------- Setup Dummy --------
          • Unit - Create 1 [Dummy] Select for OwnerOfUnitPlayer at PositionOfUnit facing Default building facing degrees
          • Set VariableSet LastCreatedUnit = (Last created unit)
          • Unit - Add a 0.50 second Generic expiration timer to LastCreatedUnit
          • -------- --------
          • Unit - Add Bloodlust (Neutral Hostile 1) [Custom] Dummy to LastCreatedUnit
          • Unit - Set level of Bloodlust (Neutral Hostile 1) [Custom] Dummy for LastCreatedUnit to (Level of (Ability being cast) for TriggeringUnit)
          • Unit - Order LastCreatedUnit to Orc Shaman - Bloodlust TriggeringUnit
        • Else - Actions
          • Unit - Create 1 [Dummy] Select for (Owner of TargetUnitOfAbilityBeingCast) at (Position of TargetUnitOfAbilityBeingCast) facing Default building facing degrees
          • Set VariableSet LastCreatedUnit = (Last created unit)
          • Unit - Add a 0.50 second Generic expiration timer to LastCreatedUnit
          • -------- --------
          • Unit - Add Bloodlust (Neutral Hostile 1) [Custom] Dummy to LastCreatedUnit
          • Unit - Set level of Bloodlust (Neutral Hostile 1) [Custom] Dummy for LastCreatedUnit to (Level of (Ability being cast) for TargetUnitOfAbilityBeingCast)
          • Unit - Order LastCreatedUnit to Orc Shaman - Bloodlust TargetUnitOfAbilityBeingCast
      • -------- --------
      • Custom script: call RemoveLocation(udg_PositionOfUnit)
  1. Event fires when an ability starts its effect
  2. Check for Bloodlust
  3. Then/Else:
    • If it is Bloodlust, there is no infinite loop (assuming AlwaysAndForever is using two distinct bloodlusts here).
    • If it is not Bloodlust, a dummy is made that casts an ability, causing the event of this trigger to fire, infinite loop.
 
Last edited:
Top