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