Set item bonuses.

Aphurea

New Member
Reaction score
3
I have been looking for a good few hours now for a way to create set items and do their bonuses, I have done most of it the one problem is making it so you can have any mix of items for the set items. Saying I have 4 items in the set and you only need 2 for it, is there any JASS code that would allow me to make it that it only requires 2 items from an array? Or even a GUI way of doing this.
Will +rep if you are a big help.
 

Cheddar

This is the way it was meant to be.
Reaction score
126
Code:
Events: Unit acquires an item
Conditions: Whatever
Actions: For each Integer A from 1 to 4, do Actions:
                     If: Unit has item of type (MySuperItem[Integer A] equal to True
                     Then: Set (ItemBeingCombined) equal to (Random item held by (Triggering unit) of type (MySuperItem[Integer A]
                     Else: (Skip remaining actions)
            For each Integer B from 1 to 4, do Actions:
                     If: Unit has item of type (MySuperItem[Integer B] equal to True
                     Then: Set (ItemBeingCombined2) equal to (Random item held by (Triggering unit) of type (MySuperItem[Integer B]
                     Else: (Skip remaining actions)
                     If: (ItemBeingCombined) not equal to (ItemBeingCombined2)
                     Then: Remove item of type (MySuperItem[Integer A]) from (Triggering unit)
                              Remove item of type (MySuperItem[Integer B]) from (Triggering unit)
                              Create item of type (YourAdCouldBeHere) for (Triggering unit)

Untested, but I think it would work.
 

Aphurea

New Member
Reaction score
3
I don't want the items to be mixed. What I plan on doing is when you have 2 items from the same set you get a passive buff, the two items will still take two slots (so people must make choices about their items). But +rep anyway for the help.
 

Aphurea

New Member
Reaction score
3
Sorry about double post but I have tried to work it out. So far I have created
Code:
Arcanite Set 2 Items
    Events
        Unit - A unit Acquires an item
    Conditions
    Actions
        For each (Integer A) from 1 to 4, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Hero manipulating item) has an item of type ArcaniteSet[(Integer A)]) Equal to True
                    Then - Actions
                        Set ArcaniteSet2Item1 = (Item carried by (Hero manipulating item) of type ArcaniteSet[(Integer A)])
                    Else - Actions
                        Skip remaining actions
        For each (Integer B) from 1 to 4, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Hero manipulating item) has an item of type ArcaniteSet[(Integer B)]) Equal to True
                    Then - Actions
                        Set ArcaniteSet2Item2 = (Item carried by (Hero manipulating item) of type ArcaniteSet[(Integer B)])
                    Else - Actions
                        Skip remaining actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                ArcaniteSet2Item1 Not equal to ArcaniteSet2Item2
            Then - Actions
                Unit - Add Arcanite Set (2)  to (Hero manipulating item)
            Else - Actions
                Do nothing

It doesn't work but I am curious if anyone can decipher a reason why? Or even a better way of doing it.

One problem I think is in there is:

Code:
 For each (Integer B) from 1 to 4, do (Actions)
            Loop - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        ((Hero manipulating item) has an item of type ArcaniteSet[(Integer B)]) Equal to True
                    Then - Actions
                        Set ArcaniteSet2Item2 = (Item carried by (Hero manipulating item) of type ArcaniteSet[(Integer B)])
                    Else - Actions
                        Skip remaining actions

Of course it is going to find an item, it's going to find the same item that Part one found. So I think that should be noted.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top