• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Unable to pick while under effect or hold when ability is being casted

Status
Not open for further replies.
Level 10
Joined
Nov 3, 2009
Messages
686
Hey,

Firstly sorry for my epic bad English.
Secondly having problemos with my triggers. I want to make that when hero is under effect of buff he can't pick up item(in my map flag) and when holding a flag he cast a spell the flag is dropped. Everything seems to work, just not with text when u pick random item or just cast spell while not holding a flag TEXT STILL APPEARS.

HERE'S MY EPIC TRIGGERS:
  • CTF unable to pick
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Forest Titans Flag
          • (Item-type of (Item being manipulated)) Equal to Sky Titans Flag
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Stealth ) Equal to True
          • ((Triggering unit) has buff Divine Shield) Equal to True
          • ((Triggering unit) has Flag_Alliance) Equal to True
        • Then - Actions
          • Hero - Drop Flag_Alliance from (Triggering unit)
        • Else - Actions
          • Hero - Drop Flag_Horde from (Triggering unit)
      • Game - Display to (Player group((Triggering player))) the text: |cffFF0000Unable to...
  • CTF unable to cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • ((Ability being cast) Equal to Divine Shield [Paladin]) or ((Ability being cast) Equal to Stealth [Rogue])
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has Flag_Alliance) Equal to True
        • Then - Actions
          • Hero - Drop Flag_Alliance from (Triggering unit)
        • Else - Actions
          • Hero - Drop Flag_Horde from (Triggering unit)
      • Game - Display to (Player group((Owner of (Triggering unit)))) the text: |cffFF0000Unable to...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
That's because you actually tell the trigger to show the text no matter what.
You need to place the game message within the else-section of the ITE, like this:
  • CTF unable to pick
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Forest Titans Flag
          • (Item-type of (Item being manipulated)) Equal to Sky Titans Flag
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) has buff Stealth ) Equal to True
          • ((Triggering unit) has buff Divine Shield) Equal to True
          • ((Triggering unit) has Flag_Alliance) Equal to True
        • Then - Actions
          • Hero - Drop Flag_Alliance from (Triggering unit)
        • Else - Actions
          • Hero - Drop Flag_Horde from (Triggering unit)
          • Game - Display to (Player group((Triggering player))) the text: |cffFF0000Unable to...
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Oh I see, that's because the trigger is really weird (didn't actually look at it until now D:).

1) The conditions in that ITE should be Or - Conditions, and the check for which flag it is shouldn't matter.
2) The Then-section should contain both drop-actions and the text
3) The Else-section shouldn't contain anything.

  • CTF unable to pick
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Forest Titans Flag
          • (Item-type of (Item being manipulated)) Equal to Sky Titans Flag
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • ((Triggering unit) has buff Stealth ) Equal to True
              • ((Triggering unit) has buff Divine Shield) Equal to True
        • Then - Actions
          • Hero - Drop Flag_Alliance from (Triggering unit)
          • Hero - Drop Flag_Horde from (Triggering unit)
          • Game - Display to (Player group((Triggering player))) the text: |cffFF0000Unable to...
        • Else - Actions
I think this works.
Yeah, it drops both flags (which is impossible), but if the hero isn't carrying that item, it won't do anything. Seems safe :p.

(Also: "(Player group((Triggering player)))" leaks (you create a player group), you should take care of that :).
 
Status
Not open for further replies.
Top