not sure about this

Mezion

New Member
Reaction score
0
Hi ^^
I hope I'm not bothering you , I need some help with a trigger.
It works, but only for ennemies. They cant use it agains me.
(The original spell work on me and it seems my unit get wanter from the wierd patern it follow, but I don't get the debuff based on Drunken haze :( )

Here's the code, I'm pretty sure it got something to do with local unit u, but I don't realy know JASS and I'm not sure how to correct this.

Trigger:
  • Confusion H
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Ability being cast) Equal to Confusion (H)) or ((Ability being cast) Equal to Confusion (M))
    • Actions
      • Custom script: local unit u
      • Set intIntell[0] = (Intelligence of (Triggering unit) (Include bonuses))
      • Unit - Create 1 Dummy for (Owner of (Triggering unit)) at (Position of (Triggering unit)) facing Default building facing degrees
      • Unit - Add Confusion (STATUS)(Part II) to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Target unit of ability being cast)
      • Unit - Cause (Last created unit) to damage (Target unit of ability being cast), dealing (0.50 x (Real(intIntell[0]))) damage of attack type Pierce and damage type Normal
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Set intTARGET[2] = (Target unit of ability being cast)
      • Unit - Add Wander (Neutral) to (Target unit of ability being cast)
      • Custom script: set u = udg_intTARGET[2]
      • Wait 10.00 seconds
      • Custom script: set udg_intTARGET[2] = u
      • Unit - Remove Wander (Neutral) from intTARGET[2]
      • Custom script: set u = null
 

jig7c

Stop reading me...-statement
Reaction score
123
if it only works for enemies, and not for you?
in the object editor, for that ability, in the targets allowed, change the settings around

if you are playing against computer, and if this is a custom skill, which it is, then the computer will never cast it..

in jass
custom script: local unit u

is equal to in GUI
going to the variable editor, (Ctrl + B), making a unit variable, and naming it the letter u

in jass, you have the ability to declare variable in the trigger, but has to be above ANY other action line

hence the line
Custom script: set u = udg_intTARGET[2]

p.s.
it leaks a point
 

Bogrim

y hello thar
Reaction score
154
The reason for your enemy computer player isn't using the ability is because its AI doesn't know how to use it, it's probably due to the ability you have chosen to base your spell on.

The the reason for your own units aren't getting the debuff is because you haven't modified the target field in the Drunken Haze ability, not allowing the spell to target friendly units. The dummy is basically issued an invalid order ("Cannot target friendly units").

Your trigger works just fine, though it could use several improvements:
Trigger:
  • Your Trigger
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Confusion
    • Actions
      • Custom script: local unit u = GetSpellTargetUnit()
      • Set Temp_Point = (Position of (Target unit of ability being cast))
      • Unit - Cause (Triggering unit) to damage (Target unit of ability being cast), dealing (0.50 x (Real((Intelligence of (Triggering unit) (Include bonuses))))) damage of attack type Pierce and damage type Normal
      • Unit - Create 1 Dummy Unit for (Owner of (Triggering unit)) at Temp_Point facing Default building facing degrees
      • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
      • Unit - Add Drunken Haze to (Last created unit)
      • Unit - Order (Last created unit) to Neutral Pandaren Brewmaster - Drunken Haze (Target unit of ability being cast)
      • Unit - Add Wander (Neutral) to (Target unit of ability being cast)
      • Custom script: call RemoveLocation( udg_Temp_Point )
      • Wait 10.00 seconds
      • Custom script: set udg_Temp_Unit = u
      • Unit - Remove Wander (Neutral) from Temp_Unit
      • Custom script: set u = null
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top