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

[Trigger] Structure critical item

Status
Not open for further replies.
Level 2
Joined
May 3, 2009
Messages
22
I hope the title says everything I need. I need an item that gives a unit critical attack only to buildings. here is what I have but it's for all units and buildings

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units in (Entire map)) and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Picked unit) is A structure) Equal to True
            • Then - Actions
              • Trigger - Add to Damage <gen> the event (Unit - (Picked unit) Takes damage)
            • Else - Actions
  • EnterRect
    • Events
      • Unit - A unit enters (Entire map)
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • ((Triggering unit) is A structure) Equal to True
        • Then - Actions
          • Trigger - Add to Damage <gen> the event (Unit - (Triggering unit) Takes damage)
        • Else - Actions
  • Damage
    • Events
    • Conditions
      • ((Damage source) has an item of type Cursed Amulet part one) Equal to True
      • (Random integer number between 1 and 100) Less than or equal to 15
    • Actions
      • Trigger - Turn off (This trigger)
      • Set IntegerVariable = (Integer((Damage taken)))
      • Special Effect - Create a special effect attached to the origin of (Attacked unit) using Abilities\Spells\Items\AIso\AIsoTarget.mdl
      • Floating Text - Create floating text that reads ((String(((Damage taken) x 2.25))) + !) above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 100.00%, 100.00%), and 0.00% transparency
      • Floating Text - Set the velocity of (Last created floating text) to 30.00 towards 90.00 degrees
      • Floating Text - Change (Last created floating text): Disable permanence
      • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
      • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
      • Unit - Cause (Damage source) to damage (Triggering unit), dealing ((Damage taken) x 2.25) damage of attack type Normal and damage type Normal
      • Special Effect - Destroy (Last created special effect)
      • Trigger - Turn on (This trigger)
 
Last edited:
Level 19
Joined
Feb 4, 2009
Messages
1,313
then add something like "if level of *your critical strike dummy ability* is greater then 0" but you should know that events, special effects and unit groups leak (if something leaks it increases the memory usage of wc3 and if there is to much leak which could happen easily with units hitting and critting all the time the game will crash or take hours to exit)
 
Level 2
Joined
May 3, 2009
Messages
22
Well I'm not sure what ur talking about but if it's about my trigger leaking? I doubt it
I just need that to be for only the holder of the item not for all units
 
Level 19
Joined
Feb 4, 2009
Messages
1,313
oh sry didn't read that's an item oO (well of cause i read it but somehow I forgot it x)
in this case you have to loop threw all inventory slots and check if your item is in it

however it creates a new event every time a unit enters the map and a specialeffect which is not destroyed on every damage taken event (which might trigger if the unit takes damage from a spell instead of an attack)
 
Level 2
Joined
May 3, 2009
Messages
22
Em, ok just to make it clear, I'm not very good at this so lets take it slow and easy cuz I need to follow. I might be able to do the all inventory slots check stuff after a lot of struggle with WE but the second part I don't understand unless adding a "destroy last created special effect is the problem solver


EDit: OK, I did a update on the trigger for specific item now I need to convert the string into real cuz i don't want the .000 number
 
Last edited:
Status
Not open for further replies.
Top