• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

Item Buy Problem

Status
Not open for further replies.
Level 12
Joined
Nov 20, 2007
Messages
660
I'm having a probelm with my item trigger. It is supposed to make you unable to buy Boots of Agility from shop if you don't have Boots Recipe but it doesn't work ok. The item is removed but the stats are not removing, also i want to know if there are leaks. Thanks:goblin_yeah:
Exemple : i buy boots of agility (boots of agility gives me 5 agility) but i don't have the recipe so the item (boots of agility) is removed but the stats are not removed (i still have 5 agility)
  • Items
    • Events
      • Unit - A unit Sells an item (from shop)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Sold Item)) Equal to Boots of Agility
        • Then - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Buying unit) has an item of type Boots Recipe) Equal to True
            • Then - Actions
              • Special Effect - Create a special effect attached to the origin of (Buying unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
              • Special Effect - Destroy (Last created special effect)
            • Else - Actions
              • Hero - Drop (Sold Item) from (Buying unit)
              • Item - Remove (Sold Item)
              • Game - Display to (Player group((Owner of (Triggering unit)))) the text: This item requement...
        • Else - Actions
 
1) Yes, this one leaks:
  • Game - Display to (Player group((Owner of (Triggering unit)))) the text: This item requement...
Use
  • Set TempForce = (Player Group(Owner of (Buying unit)))
  • Game - Display to TempForce the text: This item requement...
  • Custom script: call DestroyForce (udg_TempForce)
2) You will have to use a custom stat-add system, because I'm guessing you are using power-up(s)?

  • Items
  • Events
    • Unit - A unit Sells an item (from shop)
  • Conditions
  • Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • (Item-type of (Sold Item)) Equal to Boots of Agility
      • Then - Actions
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • ((Buying unit) has an item of type Boots Recipe) Equal to True
          • Then - Actions
            • Hero - Modify Agility of (Buying unit): Add 5
            • Special Effect - Create a special effect attached to the origin of (Buying unit) using Abilities\Spells\Items\AIem\AIemTarget.mdl
            • Special Effect - Destroy (Last created special effect)
          • Else - Actions
            • Hero - Modify Agility of (Buying unit): Subtract 5
            • Hero - Drop (Sold Item) from (Buying unit)
            • Item - Remove (Last dropped item)
            • Set TempForce = (Player Group(Owner of (Buying unit)))
            • Game - Display to TempForce the text: This item requement...
            • Custom script: call DestroyForce (udg_TempForce)
      • Else - Actions
 
Status
Not open for further replies.
Top