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

Sick Items

Status
Not open for further replies.
Level 3
Joined
Jan 2, 2010
Messages
34
Hi i had an idea to create a normal simply 'Control' ability to control for few second enemy hero. It's worked but there was a bad thing... i can give someone his items ;/
I tried to set his items to array variables -> delete -> and after control create again but it don't create all of his items, only few ;(

  • Trigger
    • Events
      • Unit - Unit using ability
    • Conditions
      • (Ability being cast) equal to Control
    • Actions
      • Set Target = (target unit of ability being cast)
      • Set Owner = (Owner of (Triggering unit))
      • Set Target_Owner = (Owner of (Target))
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Item[(Integer A)] = (Item-type of (Item carried by Target in slot (Integer A)))
          • Item - Remove (Item carried by Target of type Item[(Integer A)])
      • Wait 1.00 seconds
      • Unit - Hide (Triggering unit)
      • Unit - Change ownership of Target to Owner
      • Wait (10.00 + (5.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) seconds
      • Unit - Unhide (Triggering unit)
      • Unit - Change ownership of Target to Target_Owner
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Hero - Create Item[(Integer A)] and give it to Target
Help me with that ;(
 
  • Trigger
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • Hashtable - Create a hashtable
    • Set Hashtable = (Last created hashtable)
  • Trigger1
  • Events
    • Unit - A unit starts the effect of an ability
  • Conditions
    • (Ability being cast) Equal to Control
  • Actions
    • Unit - Hide (Target unit of ability being cast)
    • Set Point1 = (Position of (Target unit of ability being cast))
    • Unit - Create 1 Unit-type of (Target unit of ability being cast) for (Owner of (Triggering unit)) at Point1 facing (Facing of (Target unit of ability being cast))
    • For each (IntegerA) from 1 to 6, do (Actions)
      • Loop - Actions
        • Hero - Create (Item-type of (Item carried by (Target unit of ability being cast) in slot (IntegerA))) and give it to (Last created unit)
    • Unit - Save (Target unit of ability being cast) as (Key(1)) of (Key(Last created unit)) in Hashtable
    • Hashtable - Save (10.00 + (5.00 x (Real((Level of (Ability being cast) for (Triggering unit)))))) as (Key(2)) of (Key(Last created unit)) in Hashtable
    • Unit Group - Add (Last created unit) to (Temp_Group)
    • Custom script: call RemoveLocation (udg_Point1)
    • Trigger - Turn on Trigger3 <gen>
  • Trigger3
  • Events
    • Time - Every 1.00 seconds of game-time
  • Conditions
  • Actions
    • If (All conditions are true) then do (Actions) else do (Actions)
      • If - Conditions
        • (Temp_Group is empty) Equal to False
      • Then - Actions
        • Unit Group - Pick every unit in (Temp_Group) and do (Actions)
          • Loop - Actions
            • Set RemainingTime = (Load (Key(2)) of (Key(Picked unit)) from Hashtable)
            • Hashtable - Save (RemainingTime - 1.00) as (Key(2)) of (Key(Picked unit)) in Hashtable
            • If (All conditions are true) then do (Actions)
              • If - Conditions
                • (RemainingTime) Equal to 0
              • Then - Actions
                • Unit Group - Remove (Picked unit) from (Temp_Group)
                • Set Point2 = (Position of (Picked unit))
                • Unit - Move (Load (Key(0)) of (Key(Picked unit)) from Hashtable to (Point2) facing (Facing of (Picked unit))
                • Unit - Unhide (Load (Key(0)) of (Key(Picked unit)) from Hashtable
                • Unit - Remove (Picked unit) from the game //To avoid hero death messages
                • Hashtable - Clear all child hashtables of (Key(Picked unit)) from Hashtable
                • Custom script: call RemoveLocation (udg_Point2)
              • Else - Actions
  • Trigger4
  • Events
    • Unit - A unit acquires an item
  • Conditions
    • ((Triggering unit) is in Temp_Group) Equal to True
  • Actions
    • Hero - Drop (Item being manipulated) from (Triggering unit)
  • Trigger5
  • Events
    • Unit - A unit loses an item
  • Conditions
    • ((Triggering unit) is in Temp_Group) Equal to True
  • Actions
    • Hero - Create 1 (Item-type of (Item being manipulated)) and give it to (Triggering unit)
    • Item - Remove (Item being manipulated)
 
Level 3
Joined
Jan 2, 2010
Messages
34
wow :D
hm... someone on THW chat told me there's a nice trick :p
  • Item - Make Item Undroppable
i didn't know there's something like that but it's work :D
 
Status
Not open for further replies.
Top