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

2 Item Drop/Restriction Questions

Status
Not open for further replies.
Level 7
Joined
May 21, 2009
Messages
289
I need an easier item drop system than this one- When the Demonic Goblin Dies, I need one "item set" (variable-array) to drop per player, but this trigger takes forever-
  • GOBLIN HALLOW
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Demonic Goblin
    • Actions
      • Wait 0.01 seconds
      • Set point = (Center of Goblin Hallow Items <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 1
        • Then - Actions
          • Item - Create itemdropgoblinhallow[(Random integer number between 1 and 6)] at point
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 2
            • Then - Actions
              • Item - Create itemdropgoblinhallow[(Random integer number between 1 and 6)] at point
              • Item - Create itemdropgoblinhallow[(Random integer number between 1 and 6)] at point
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 3
                • Then - Actions
                  • Item - Create itemdropgoblinhallow[(Random integer number between 1 and 6)] at point
                  • Item - Create itemdropgoblinhallow[(Random integer number between 1 and 6)] at point
                  • Item - Create itemdropgoblinhallow[(Random integer number between 1 and 6)] at point
                • Else - Actions
      • Custom script: call RemoveLocation(udg_point)
      • Item - Set the custom value of (Last created item) to 0
I also need a fix to this item restriction trigger- I need to make it so only the units listed can pick up the item class "permanent" but this trigger makes it so all the units listed CANNOT pick up the items. I only want the "if" part changed.
  • Warrior
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Hero manipulating item)) Not equal to Imperial (Warrior)
              • (Unit-type of (Hero manipulating item)) Not equal to Nord (Warrior)
              • (Unit-type of (Hero manipulating item)) Not equal to Redguard (Warrior)
              • (Unit-type of (Hero manipulating item)) Not equal to Dark Elf (Shadowblade)
              • (Unit-type of (Hero manipulating item)) Not equal to Orc (Warrior)
        • Then - Actions
          • Hero - Drop (Item being manipulated) from (Hero manipulating item)
        • Else - Actions
          • Do nothing
Thanks for any help you can provide!
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
The first trigger: Detect the number of players at the beginning of the game in some other trigger. Save it into a variable. And if someone leaves, modify the variable.

Then loop integer A from 1 to Number_of_players in that item creation trigger, and put that Item - create... inside the loop.

The second trigger:
  • Untitled Trigger 099
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
      • And - All (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Not equal to Paladin
          • (Unit-type of (Triggering unit)) Not equal to Mountain King
    • Actions
      • Hero - Drop (Item being manipulated) from (Triggering unit)
 
Level 7
Joined
May 21, 2009
Messages
289
The first trigger i cant do that- Its only for in one dungeon-IT NEEDS to use that exact trigger to somehow do it

The second trigger wont work ether- I'll have to copy and paste a billion units

EDIT:
Your second trigger I could do if I have no more options, but I really need an example for the first trigger, im not the greatest with variables and such.
 
Level 37
Joined
Mar 6, 2006
Messages
9,240
First trigger:

  • Untitled Trigger 101
    • Events
    • Conditions
    • Actions
      • Set Temp_Loc_1 = (Center of Region 015 <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in Heal_Group) Equal to 1
        • Then - Actions
          • Set Temp_Integer_1 = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in Heal_Group) Equal to 2
            • Then - Actions
              • Set Temp_Integer_1 = 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in Heal_Group) Equal to 3
                • Then - Actions
                  • Set Temp_Integer_1 = 3
                • Else - Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer A))) slot status) Equal to Is playing
            • Then - Actions
              • For each (Integer B) from 1 to Temp_Integer_1, do (Actions)
                • Loop - Actions
                  • Item - Create Tome of Experience at Temp_Loc_1
            • Else - Actions
      • Custom script: call RemoveLocation(udg_Temp_Loc_1)


Units listed here can pick up those items, rest can not:

  • Untitled Trigger 099 Copy
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-class of (Item being manipulated)) Equal to Permanent
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • (Unit-type of (Triggering unit)) Equal to Paladin
              • (Unit-type of (Triggering unit)) Equal to Mountain King
        • Then - Actions
        • Else - Actions
          • Hero - Drop (Item being manipulated) from (Triggering unit)
 
Level 7
Joined
May 21, 2009
Messages
289
Okay so now I have a problem- Heres the set of triggers I use, when the demonic goblin dies, the game crashes (fatal error) can someone help figure out why?
  • Demonic Goblin
    • Events
      • Unit - A unit Dies
    • Conditions
      • (Unit-type of (Triggering unit)) Equal to Demonic Goblin
    • Actions
      • Unit Group - Pick every unit in (Units in Demonic Goblin Victory <gen> owned by Neutral Hostile) and do (Actions)
        • Loop - Actions
          • Unit - Kill (Picked unit)
      • Wait 0.01 seconds
      • Unit Group - Pick every unit in (Units in Demonic Goblin Victory <gen>) and do (Actions)
        • Loop - Actions
          • Unit - Move (Picked unit) instantly to (Center of Goblin Hallow Rewards <gen>)
  • GOBLIN HALLOW
    • Events
      • Unit - A unit owned by Neutral Hostile Dies
    • Conditions
      • (Unit-type of (Dying unit)) Equal to Demonic Goblin
    • Actions
      • Wait 0.01 seconds
      • Set point = (Center of Goblin Hallow Items <gen>)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 1
        • Then - Actions
          • Set Temp_Interger2 = 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 2
            • Then - Actions
              • Set Temp_Interger2 = 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 3
                • Then - Actions
                  • Set Temp_Interger2 = 3
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 4
                    • Then - Actions
                      • Set Temp_Interger2 = 4
                    • Else - Actions
                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                        • If - Conditions
                          • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 5
                        • Then - Actions
                          • Set Temp_Interger2 = 5
                        • Else - Actions
                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                            • If - Conditions
                              • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 6
                            • Then - Actions
                              • Set Temp_Interger2 = 6
                            • Else - Actions
                              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                • If - Conditions
                                  • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 7
                                • Then - Actions
                                  • Set Temp_Interger2 = 7
                                • Else - Actions
                                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                    • If - Conditions
                                      • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 8
                                    • Then - Actions
                                      • Set Temp_Interger2 = 8
                                    • Else - Actions
                                      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                        • If - Conditions
                                          • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 9
                                        • Then - Actions
                                          • Set Temp_Interger2 = 9
                                        • Else - Actions
                                          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                                            • If - Conditions
                                              • (Number of units in (Units in Goblin Hallow Rewards <gen>)) Equal to 10
                                            • Then - Actions
                                              • Set Temp_Interger2 = 10
                                            • Else - Actions
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player((Integer A))) controller) Equal to User
              • ((Player((Integer B))) slot status) Equal to Is playing
            • Then - Actions
              • For each (Integer B) from 1 to Temp_Interger2, do (Actions)
                • Loop - Actions
                  • Item - Create itemdropgoblinhallow[(Random integer number between 1 and 6)] at (Center of Goblin Hallow Items <gen>)
            • Else - Actions
      • Custom script: call RemoveLocation(udg_point)
      • Item - Set the custom value of (Last created item) to 0
  • GOBLIN HALLOW Exit
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Goblin Hallow Items <gen> contains (Triggering unit)) Equal to True
    • Actions
      • Unit - Move (Triggering unit) instantly to (Center of Priest <gen>)
EDIT:
Nevermind I a Interger B in an Interger A spot
 
Last edited:
Status
Not open for further replies.
Top