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

Item soulbound question about trigger

Status
Not open for further replies.
Level 1
Joined
Aug 14, 2012
Messages
2
Hi there, just want to ask if this small trigger system is good enough or if there is anyway to improve it, seems fine ingame, but my guts tells me it could be improved, inb4 jass aka nuclear science.

Apparently it also works when loading hero (-load)
Tho trigger seems so short, and works, just fine, that's why I'm stunned that it actually worked, must be something wrong with it right? :S

  • Events
  • Unit - A unit acquires an item
  • Conditions
  • Actions
  • If (All conditions are true) then do (Then actions) else do (else actions)
  • If - Conditions
  • (Owner of (Item being manipulated)) Equal to Neutral Passive
  • Then - Actions
  • Item - change ownership of (Item being manipulated) to (Owner of (Hero manipulating item)) and change color
  • Else - Actions
  • If (All conditions are true) then do (Then actions) else do (Else actions)
  • If - Conditions
  • (Owner of (Hero manipulating item)) Not equal to (Owner of (Item being manipulated))
  • Then - Actions
  • Set TempPoint = (Position of (Hero manipulating item))
  • Unit - Order (Hero manipulating item to drop (Item being manipulated at TempPoint
  • Custom script: call RemoveLocation (Udg_TempPoint)
  • Quest - Display to (PlayerGroup((Owner of (Hero manipulating item)))) the secret message: Bla bla not yours
  • Else - Actions
 
Level 20
Joined
Jul 14, 2011
Messages
3,213
Set UnitVariable = (Triggering Unit)
And replace all the (Hero Manipulating Item) with UnitVariable

ItemVariable = (Item Being Manipulated)
And replace all the (Item Being Manipulated) with ItemVariable

3 -Set PlayerVariable = (Owner of ItemVariable)
And replace all the (Owner of ItemVariable) with PlayerVariable

In the end, replace all the (Owner of (Hero Manipulating Item)) with (Triggering Player)

  • Events
    • Unit - A unit acquires an item
  • Conditions
  • Actions
    • Set UnitVariable = (Triggering Unit)
    • Set ItemVariable = (Item being manipulated)
    • Set PlayerVariable = (Owner of ItemVariable)
    • If (All conditions are true) then do (Then actions) else do (else actions)
      • If - Conditions
        • PlayerVariable Equal to Neutral Passive
    • Then - Actions
      • Item - change ownership of ItemVariable to (Triggering Player) and change color
    • Else - Actions
      • If (All conditions are true) then do (Then actions) else do (Else actions)
        • If - Conditions
          • (Triggering Player) Not equal to PlayerVariable
      • Then - Actions
        • Set TempPoint = (Position of UnitVariable)
        • Unit - Order UnitVariable to drop ItemVariable at TempPoint
        • Custom script: call RemoveLocation (udg_TempPoint)
        • Custom script: call DisplayTimedTextToPlayer(GetTriggeringPlayer(), 0, 0, 10, "Bla bla not yours")
      • Else - Actions
The "DisplayTimedTextToPlayer()" prevents creating a force (Player group(Triggering player)) to display the message and destroy it later.

In this case "Hero Manipulating Item" is the same than (Triggering Unit), and (Triggering Player) stands as (Owner of (Triggering Unit)) in any Generic Unit Event :)
 
Status
Not open for further replies.
Top