please help me

Level 2
Joined
Apr 24, 2010
Messages
18
please help me make a trigger when a hero who brought items such as armor, swords, hats, shoes ... immediately appear on the items that the hero:pal:
 
Level 17
Joined
Jan 21, 2006
Messages
2,545
You should read the sticky at the very top of the Triggers & Scripts section that Rui just posted. If you don't know what the hell you're doing and you are unable to start a trigger, then post it in the World Editor Help section.
 
Level 39
Joined
Nov 6, 2008
Messages
8,319
I believe he is speaking of an attachment system. It's simple.
  • Tri
  • Events
    • Map Initialization
  • Conditions
  • Actions
    • ----- Items' setup; Variable type: Item-type-----
    • Set Items[1] = Boots of Speed
    • Set Items[2] = Hat
    • Set Items[3] = Gloves of Agility
    • ----- Attachment paths; Variable type: String -----
    • Set ItemAttachments[1] = war3mapImported\Boots.mdx
    • Set ItemAttachments[2] = war3mapImported\WizardsHat.mdx
    • Set ItemAttachments[3] = war3mapImported\GlovesHaste.mdx
    • ----- Attachment points; Variable type: String -----
    • Set Points[1] = foot, left + foot, right
    • Set Points[2] = head
    • Set Points[3] = hand, left + hand, right
The "+"'s in "Points[]" variable are made with "Substring" function.
  • Trigger
  • Events
    • Unit - A unit acquires an item
  • Conditions
  • Actions
    • For each (IntegerA) from 1 to 3, do (Actions)
      • Loop - Actions
        • If (All conditions are true) then do (Actions) else do (Actions)
          • If - Conditions
            • (Item-type of (Item being manipulated)) Equal to Items[(IntegerA)]
          • Then - Actions
            • Special Effect - Create a special effect on Points[(IntegerA)] of (Triggering unit), using ItemAttachments[(IntegerA)]
          • Else - Actions
Use the same with Unit - A unit loses an item event and Destroy the effects. Save the effects using arrays or hashtables.
 
Top