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

How to make item that gives stats to primary attribute?

Status
Not open for further replies.
Level 6
Joined
Aug 31, 2018
Messages
157
I know how to make items that gives +str/agi/int but the think that i want is, to make 1 item that gives +primary attribute so anyone can buy it. In other way ill have to make like 30 coppies for different attributes Str/agi/int instead of making just 1 that gives primary attribute and will work for every class.
 
I assume you want to just use a perishable tome not a permanent item.
In that case, maybe you want to use this simple trigger that i made. Since we can not truly detect the hero's primary attribute we can run multiple conditions checking the type of the hero that used the Tome.


  • Primary Att Tome
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • (Item-type of (Item being manipulated)) Equal to Tome of Primary Attribute
    • Actions
      • -------- Str Hero --------
      • 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
              • (Unit-type of (Triggering unit)) Equal to Tauren Chieftain
        • Then - Actions
          • Hero - Modify Strength of (Triggering unit): Add 1
        • Else - Actions
      • -------- Agi Hero --------
      • 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 Blademaster
              • (Unit-type of (Triggering unit)) Equal to Shadow Hunter
        • Then - Actions
          • Hero - Modify Agility of (Triggering unit): Add 1
        • Else - Actions
      • -------- Int Hero --------
      • 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 Archmage
              • (Unit-type of (Triggering unit)) Equal to Blood Mage
              • (Unit-type of (Triggering unit)) Equal to Far Seer
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 1
        • Else - Actions


In my case, using the trigger above, i just assumed that i only had the Human and Orc standard heroes as playable heroes in my map. You need to adjust this trigger so that it meets the needs of your map. If you have 100 playable heroes you have to make 100 conditions (Type of Unit equals ....). That would be challenging but doable; It wont take you a lot of time.

Please find attached a simple map that i made that includes the trigger above. Have fun! :wink:
 

Attachments

  • Primary Attribute Tome.w3x
    33.2 KB · Views: 39
Since we can not truly detect the hero's primary attribute
This was the case pre warcraft 3 V1.31. By using Unit - Get Unit Integer Field one can read the primary attribute index of ConvertHeroAttribute.
JASS:
  // Hero Attribute
    constant heroattribute  HERO_ATTRIBUTE_STR              = ConvertHeroAttribute(1)
    constant heroattribute  HERO_ATTRIBUTE_INT              = ConvertHeroAttribute(2)
    constant heroattribute  HERO_ATTRIBUTE_AGI              = ConvertHeroAttribute(3)

This function was also ported to GUI means one could do something like this below. One reads the Unit Integer Field and compares it to 1 if that is the case the unit is a str hero. If it is 2 it is an int hero and if it is 3 it is a agi hero.
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
      • (Unit: (Triggering unit)'s Integer Field: Primary Attribute ('upra')) Equal to 1
    • Then - Actions
      • Hero - Modify Strength of (Triggering unit): Add 1
    • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit: (Triggering unit)'s Integer Field: Primary Attribute ('upra')) Equal to 2
        • Then - Actions
          • Hero - Modify Intelligence of (Triggering unit): Add 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit: (Triggering unit)'s Integer Field: Primary Attribute ('upra')) Equal to 3
            • Then - Actions
              • Hero - Modify Agility of (Triggering unit): Add 1
            • Else - Actions
 
Level 3
Joined
Aug 24, 2014
Messages
30
I made an example using 2 Attributes
Need to create 2 spell, 1 for agi another for int.
Captura de pantalla 2022-11-25 201408.png
 
Level 39
Joined
Feb 27, 2007
Messages
5,016
  1. Make your own thread for a unique question. No reason to reply to an old (but not excessively old) thread other than that you're talking about the same topic... but there are probably like 15 other threads on this topic you could have chosen instead so this one isn't unique or better. Just make your own.

  2. How To Post Your Trigger

  3. You need to explain what does or doesn't work about what you're doing. What are you trying to achieve? What happens that you don't expect? What doesn't happen that should happen?
 
Level 3
Joined
Aug 24, 2014
Messages
30
  1. Make your own thread for a unique question. No reason to reply to an old (but not excessively old) thread other than that you're talking about the same topic... but there are probably like 15 other threads on this topic you could have chosen instead so this one isn't unique or better. Just make your own.

  2. How To Post Your Trigger

  3. You need to explain what does or doesn't work about what you're doing. What are you trying to achieve? What happens that you don't expect? What doesn't happen that should happen?
Ok, soon create a new post and explain everything there.
 
Status
Not open for further replies.
Top