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

[Catalog] Level+Slot+Group+Version Filter

Level 31
Joined
Jul 10, 2007
Messages
6,306
It certainly does.

If you have 12 heroes that all use the same group of items, like potions, you can add that group to 1 group, like misc items, and then add that group to each hero

hero.add(miscitems)
hero2.add(miscitems)

etc ; )

edit
ofc groups don't only just have to be heroes... you can group up anything you like : ). Also, adding additional slots is super easy too ;p.

JASS:
    private struct SlotFilter2 extends array
        private static Table array slotId
        private static integer slotCount = 0
        method operator [] takes integer slot returns integer
            if (0 == slotId[this]) then
                set slotId[this] = Table.create()
            endif
            if (not slotId[this].has(slot)) then
                set slotCount = slotCount + 1
                set slotId[this][slot] = slotCount
            endif
            return slotId[this][slot]
        endmethod
    endstruct
    private struct SlotFilter extends array
        private static Table array slotId
        private static integer slotCount = 0
        method operator [] takes integer slot returns SlotFilter2
            if (0 == slotId[this]) then
                set slotId[this] = Table.create()
            endif
            if (not slotId[this].has(slot)) then
                set slotCount = slotCount + 1
                set slotId[this][slot] = slotCount
            endif
            return slotId[this][slot]
        endmethod
    endstruct

Boom, 2 slots now ;D.
 
Top