• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Heirloom

Status
Not open for further replies.
Level 2
Joined
Aug 11, 2015
Messages
8
Hey
I'm trying to do something that works like heirlooms in WoW. An item that levels up with a hero wearing it consequently applying better bonuses and stats.
I even want to make possible to drop that item and when I pick it up with another hero, level of that item is set to same as the hero picking it up.

But it is harder than I expected it will be.

I had one idea for it but it's totally suboptimal and too complicated. Maybe someone has some simple and effective idea to acomplish that?
 
Level 5
Joined
Jan 19, 2018
Messages
126
I think you might have to make different versions of the item for each level.
Then have a trigger replace the item based on the hero level when he gains a level.
Then make a second trigger handling if the hero picks up an heirloom to replace the item with the appropriate item level based on the hero level.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Another option is to put stat-buff skills on the hero and change the level of those or add/remove(depending on what result you are looking for) according to the level of the hero and if he has or not an item.

2 Triggers would be like:

Unit acquires item
Item is heirloom
Set Level of stat-skills for unit according to lvl / Add needed stat-skills according to level

Unit loses item //I am not sure what exactly the event would be or if there is one...
Item is heirloom
Set level of stat-skills for unit to 0 / Remove all stat-skills

PS: If you use the item versions for stat bonus, it stacks and does not show in the command card (as I remember)

Edit: Doing only a single item and stat-skills is a bit more customize-able
 
Level 5
Joined
Jan 19, 2018
Messages
126
...
PS: If you use the item versions for stat bonus, it stacks and does not show in the command card (as I remember)
Edit: Doing only a single item and stat-skills is a bit more customize-able
I don't think replacing an item an a Hero's inventory will make the hero retain the stats of the old item.
 
Level 2
Joined
Aug 11, 2015
Messages
8
Well. I tried Abyssion solution before I posted here. That was the first thing i thought about. The problem was that when hero was levelin up and trigger was replacing the item by droping it on the ground and deleting and givin another item to a hero -> heirloom drop trigger was working and item was duplicating itself on the ground.

I will try nedio solution now. It looks really convenient. Thanks guys
 
Level 5
Joined
Jan 19, 2018
Messages
126
Well. I tried Abyssion solution before I posted here. That was the first thing i thought about. The problem was that when hero was levelin up and trigger was replacing the item by droping it on the ground and deleting and givin another item to a hero -> heirloom drop trigger was working and item was duplicating itself on the ground.

I will try nedio solution now. It looks really convenient. Thanks guys
Then there was something horribly wrong with your trigger. Here is a system that I created based on the campaign shadow orb since it had 10 versions already.
It swaps the item properly when the hero levels or picks up the item.
And its not even that many lines of code!
  • Heirloom Item Initialization
    • Events
      • Time - Elapsed game time is 0.10 seconds
    • Conditions
    • Actions
      • Set HeirloomItem[0] = Shadow Orb +1
      • Set HeirloomItem[1] = Shadow Orb +2
      • Set HeirloomItem[2] = Shadow Orb +3
      • Set HeirloomItem[3] = Shadow Orb +4
      • Set HeirloomItem[4] = Shadow Orb +5
      • Set HeirloomItem[5] = Shadow Orb +6
      • Set HeirloomItem[6] = Shadow Orb +7
      • Set HeirloomItem[7] = Shadow Orb +8
      • Set HeirloomItem[8] = Shadow Orb +9
      • Set HeirloomItem[9] = Shadow Orb +10
  • Hero Levels Heirloom
    • Events
      • Unit - A unit Gains a level
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • ((Leveling Hero) has an item of type HeirloomItem[0]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[1]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[2]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[3]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[4]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[5]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[6]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[7]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[8]) Equal to True
          • ((Leveling Hero) has an item of type HeirloomItem[9]) Equal to True
    • Actions
      • Set ItemIndex = ((Hero level of (Leveling Hero)) - 1)
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[0])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[1])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[2])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[3])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[4])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[5])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[6])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[7])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[8])
      • Item - Remove (Item carried by (Leveling Hero) of type HeirloomItem[9])
      • Hero - Create HeirloomItem[ItemIndex] and give it to (Leveling Hero)
  • Hero Picks Up Heirloom
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[0]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[1]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[2]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[3]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[4]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[5]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[6]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[7]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[8]
          • (Item-type of (Item being manipulated)) Equal to HeirloomItem[9]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Or - Any (Conditions) are true
            • Conditions
              • ((Hero manipulating item) has an item of type HeirloomItem[0]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[1]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[2]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[3]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[4]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[5]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[6]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[7]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[8]) Equal to True
              • ((Hero manipulating item) has an item of type HeirloomItem[9]) Equal to True
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Set ItemIndex = ((Hero level of (Hero manipulating item)) - 1)
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[0])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[1])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[2])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[3])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[4])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[5])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[6])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[7])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[8])
          • Item - Remove (Item carried by (Hero manipulating item) of type HeirloomItem[9])
          • Hero - Create HeirloomItem[ItemIndex] and give it to (Hero manipulating item)
          • Trigger - Turn on (This trigger)
        • Else - Actions
 
Level 5
Joined
Jan 19, 2018
Messages
126
What do you mean? I'm not following your method at all, I'm not saying your method won't work
but I don't understand what makes your method more "customizeable"?
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
Ok, So, my method is faster, has less code, easier to maintain. Imagine that you have 10000 levels on your heroes rather than 10? Or even 50 would be a pain to do...

Here is what you do, this is the core idea, will give example for when a Heirloom is picked and you should figure out for when dropped/lost:


You make Stat item bonus(or what ever was the name) each with increasing stat bonus. Item Stat Bonus, or something similar is the name of the ability in game, BUT, we are not going to use it as item ability but rather as a unit ability. When you add this to a unit, it stacks and does not show in teh command card. Each ability would have a power of 2 stat bonus.

you need:

1 item - Dummy item, no skills or bonuses, nice description, icon, visuals
X amount of skills depending on how much bonus you want to add to the hero like:
Skill 1 = +1 Atk*
Skill 2 = +2 Atk*
Skill 3 = +4 Atk*
Skill 4 = +8 Atk*
Skill 5 = +16 Atk*
Skill 6 = +32 Atk*
...
Skill 10 = +2^10
...
Skill X = +2^X

*Atk = Whatever bonus you want to do. If you want multiple types of bonuses you will have to do:

Agi_Bonus_SKill 1 = +1 Agi
Agi_Bonus_SKill 2 = +2 Agi
...
Agi_Bonus_SKill X = + +X Agi

Str_Bonus_SKill 1 = +1 Str
Str_Bonus_SKill 2 = +2 Str
...
Str_Bonus_SKill X = + +X Str

And so on.


Disclaimer: The following trigger has been written in plain text with no use of WE. Events, actions, conditions may not match to how they would look in WE. The following trigger is purely a pseudo code of what I am trying to pass over.
  • Event - Unit Aquires an Item
  • Condition - Item being manipulated = Heirloom
  • Actions
  • Int_Or_Real_How_Much_Bonus_To_Add = (Nice_formula_from_hero_level_and_stuff)
  • Loop - For Index_int (Number_Of_Stat_Bonus_Skills to 0)
    • If - (Stat_Bonus_Of_Level[Index_int] >= Int_Or_Real_How_Much_Bonus_To_Add)
      • Add Our_Custom_Skill[Index_int] to triggering unit
      • Int_Or_Real_How_Much_Bonus_To_Add = Int_Or_Real_How_Much_Bonus_To_Add - Stat_Bonus_Of_Level[Index_int]
      • If - (Stat_Bonus_Of_Level[Index_int]) <= 0
        • Skip remaining actions
This is customize-able as you can use it for multiple systems with a bit of tweeking. You could make custom stat bonuses from multiple sources, e.g. items, auras, skills, terrain, facing, day/night cycle. What I am explaining here could be used for highly customized stat-bonus system.
 
Last edited:
Level 2
Joined
Aug 11, 2015
Messages
8
I did it and it works perfeclty fine. Just one thing more.
What is the best way to make an item unique? I mean that you cannot wear 2 heirlooms at the same time, just one.
 
Level 5
Joined
Jan 19, 2018
Messages
126
Ah I see what you mean now that's very interesting and I also took a look at the custom stat system that's very cool but I see there is a downside
the item tooltip doesn't change which kind of sucks but I guess that is the only con.
 
Level 12
Joined
Mar 24, 2011
Messages
1,082
@Abyssion You are entirely correct. Workaround:

Stick a dummy spell to the item.
Very general item tooltip saying. "Heirloom is blah, grows with you, blah, become stronger, blah. You can activate the hidden power to understand your bond with the heirloom" or something of the sort
Trigger:
Event - Unit starts the effect of an spell //or however it is worded
Condition - Spell being cast equal to Heirloom bond // or whatever
Actions:
String_var = Concatenated string(your current heirloom powers)
Message - Display to local player triggering player String_var

@Koba10s
Add this to your "Unit picks heirloom" trigger

Loop for IntDex 0 to 5 // or is it 1 to 6 ?
Item in slot IntDex for triggering unit = Heirloom
Item - Drop Item being manipulated
Message to local player - You greedy bastard!!
 
Last edited:
Level 5
Joined
Jan 19, 2018
Messages
126
I did it and it works perfeclty fine. Just one thing more.
What is the best way to make an item unique? I mean that you cannot wear 2 heirlooms at the same time, just one.
You can make a simple trigger that checks a unit's inventory if he picks up an heirloom and then drops the heirloom he just picked up
if the conditions are true. Something like this works:
  • Heirloom Limit
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Item-type of (Item being manipulated)) Equal to Heirloom 1
          • (Item-type of (Item being manipulated)) Equal to Heirloom 2
          • (Item-type of (Item being manipulated)) Equal to Heirloom 3
          • (Item-type of (Item being manipulated)) Equal to Heirloom 4
          • (Item-type of (Item being manipulated)) Equal to Heirloom 5
    • Actions
      • Set HeirloomCounter = 0
      • Set HeroManipulatingItem = (Hero manipulating item)
      • Set Temp_Item_Position = (Position of (Item being manipulated))
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Or - Any (Conditions) are true
                • Conditions
                  • Heirloom 1 Equal to (Item-type of (Item carried by HeroManipulatingItem in slot (Integer A)))
                  • Heirloom 2 Equal to (Item-type of (Item carried by HeroManipulatingItem in slot (Integer A)))
                  • Heirloom 3 Equal to (Item-type of (Item carried by HeroManipulatingItem in slot (Integer A)))
                  • Heirloom 4 Equal to (Item-type of (Item carried by HeroManipulatingItem in slot (Integer A)))
                  • Heirloom 5 Equal to (Item-type of (Item carried by HeroManipulatingItem in slot (Integer A)))
            • Then - Actions
              • Set HeirloomCounter = (HeirloomCounter + 1)
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • HeirloomCounter Greater than 1
                • Then - Actions
                  • Unit - Order HeroManipulatingItem to drop (Item being manipulated) at Temp_Item_Position
                  • Custom script: call RemoveLocation(udg_Temp_Item_Position)
                • Else - Actions
            • Else - Actions
 
Status
Not open for further replies.
Top