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

Why this skill dont work?

Status
Not open for further replies.
Level 4
Joined
Jan 30, 2012
Messages
61
[hidden="Trigger]
  • Artillery Barrage
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Artillery Barrage [|cffFF0000E|r]
    • Actions
      • Game - Display to (All players) for 5.00 seconds the text: (|cff00ff00 + ((Name of (Owner of (Triggering unit))) + calls an artillery barrage|r))
      • Unit - Create 1 Artillery Barrage Anzeige for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
      • Wait 2.50 seconds
      • Unit - Create 1 Artillery Barrage for (Owner of (Triggering unit)) at ((Target point of ability being cast) offset by (Random real number between 0.00 and 350.00) towards (Random real number between 0.00 and 360.00) degrees) facing Default building facing degrees
      • Wait 0.10 seconds
      • Unit - Create 1 Artillery Barrage for (Owner of (Triggering unit)) at ((Target point of ability being cast) offset by (Random real number between 0.00 and 350.00) towards (Random real number between 0.00 and 360.00) degrees) facing Default building facing degrees
      • Wait 0.10 seconds
      • Unit - Create 1 Artillery Barrage for (Owner of (Triggering unit)) at ((Target point of ability being cast) offset by (Random real number between 0.00 and 350.00) towards (Random real number between 0.00 and 360.00) degrees) facing Default building facing degrees
      • Wait 0.10 seconds
      • Unit - Create 1 Artillery Barrage for (Owner of (Triggering unit)) at ((Target point of ability being cast) offset by (Random real number between 0.00 and 350.00) towards (Random real number between 0.00 and 360.00) degrees) facing Default building facing degrees
      • Wait 0.10 seconds
      • Unit - Create 1 Artillery Barrage for (Owner of (Triggering unit)) at ((Target point of ability being cast) offset by (Random real number between 0.00 and 350.00) towards (Random real number between 0.00 and 360.00) degrees) facing Default building facing degrees
[/hidden]



The Hero has the main skill (its far sight) and it shall create bombs (Name of the unit is "Artillery Barrage") at random points of the target point of the hero ability.... but it creates this bombs at the Center of the Map...Why?
 
Last edited by a moderator:
Use locals...

  • Artillery Barrage
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Artillery Barrage [|cffFF0000E|r]
  • Actions
    • Custom script: local unit u
    • Custom script: local location loc = GetSpellTargetLoc()
    • Game - Display to (All players) for 5.00 seconds the text: (|cff00ff00 + ((TriggeringPlayer))) + calls an artillery barrage|r))
    • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'unit_id', loc, 0)
    • Wait 2.50 seconds
    • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'unit_id', loc, GetRandomReal(-1,1))
    • Wait 0.10 seconds
    • Custom script:...and so on...
    • Custom script: call RemoveLocation(loc)
    • Custom script: set loc = null
    • Custom script: set u = null
 
Level 7
Joined
Apr 30, 2011
Messages
359
Use locals...

  • Artillery Barrage
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Artillery Barrage [|cffFF0000E|r]
  • Actions
    • Custom script: local unit u
    • Custom script: local location loc = GetSpellTargetLoc()
    • Game - Display to (All players) for 5.00 seconds the text: (|cff00ff00 + ((TriggeringPlayer))) + calls an artillery barrage|r))
    • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'unit_id', loc, 0)
    • Wait 2.50 seconds
    • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'unit_id', loc, GetRandomReal(-1,1))
    • Wait 0.10 seconds
    • Custom script:...and so on...
    • Custom script: call RemoveLocation(loc)
    • Custom script: set loc = null
    • Custom script: set u = null

complete one:
  • Artillery Barrage
  • Events
    • Unit - A unit Starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Artillery Barrage [|cffFF0000E|r]
  • Actions
    • Custom script: local unit u
    • Custom script: local location tl = GetSpellTargetLoc()
    • Custom script: local location ll
    • Custom script: local integer i = 5
    • Game - Display to (All players) for 5.00 seconds the text: (|cff00ff00 + ((TriggeringPlayer))) + calls an artillery barrage|r))
    • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'AnzeigeUnitId', tl, 270)
    • Wait 2.50 seconds
    • Custom script: loop
    • Custom script: set i = i - 1
    • Custom script: set ll = PolarProjectionBJ(tl, GetRandomReal(0, 350), GetRandomReal(0, 360))
    • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'UnitId', ll, 270)
    • Custom script: exitwhen i == 0
    • Wait 0.10 seconds
    • Custom script: endloop
    • Custom script: call RemoveLocation(tl)
    • Custom script: set tl = null
    • Custom script: call RemoveLocation(ll)
    • Custom script: set ll = null
    • Custom script: set u = null
what to replace:
1.
  • Custom script: local integer i = 5
can be replaced with any numbers, it determines how much numbers of this lines:
  • Unit - Create 1 Artillery Barrage for (Owner of (Triggering unit)) at ((Target point of ability being cast) offset by (Random real number between 0.00 and 350.00) towards (Random real number between 0.00 and 360.00) degrees) facing Default building facing degrees
  • Wait 0.10 seconds
2.
  • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'AnzeigeUnitId', tl, 270)
replace 'AnzeigeUnitId' by a unit's rawcode, example: 'hpea', 'Hblm'
you can see it by pressing Ctrl + D in your object editor
3.
  • Custom script: set u = CreateUnitAtLoc(GetTriggerPlayer(), 'UnitId', ll, 270)
just like above, but for those other Artillery units
 
Status
Not open for further replies.
Top