I've searched for an addon that helps with loot management by auto transmogrifying certain types of loot depending on player choice. For example, a brawler might want to automatically transmog all massive armour to have a less cluttered transmog chest at the end of level to sort through. Surprisingly, I couldn't find anything. So I guess my first question is: is there such an addon that I just missed?
Anyway, I thought I'd make one just as an exercise, and to get to understand the t-engine a bit better. The way I see it working is: a player can invoke a dialog which presents them with a tabbed interface. Every type of item (e.g. dagger, massive armour, cloth hat) has a bunch of checkboxes representing different rarities. the player then checks the boxes for the items they want to get rid of and thus can get rid of , say, all staves and all gloves that are not purple or better.
I have a few questions and am hoping that someone might offer some help, so here goes:
1- How to give the player this ability. I can think of three approaches and would appreciate some advice:
- a- Give players an item which can be activated to bring up the dialog. How do I go about doing that? I guess I can do that in Player:onBirth(), but what if I wanted to give the item to characters that were generated without it. Which functions are responsible for initiating a new game "session"
b- Give players a talent that invokes the dialog. I noticed the following line in Actor:Init()However, I didn't find anything in the Attack talent code that linked it to "T_ATTACK". Does the game internally create this identifier by uppercasing the talent name and prefixing it with "T_"? So if my talent definition included the lineCode: Select all
self.talents[self.T_ATTACK] = self.talents[self.T_ATTACK] or 1
will the game automatically create the identifier "T_AUTOSQUELCH"?Code: Select all
name = "Autosquelch",
c- I've looked at Zizzo's Point Planner addon and he just binds a function to a key. This seems like the cleanest solution and I'll probably go with it. Still, I would like to know the answers to my questions for the first two options, just out of curiosity.
- a- Whenever the player acts. I can add something to Player:Act() but I'm afraid that will slow the game down if it had to go through the player's inventory every time they performed an action.
b- Whenever the player picks up an item. I can't seem to find the appropriate function to superload. I found references to Player:pickupFloor() but couldn't track down the function definition in either player.lua or actor.lua. Also I'm afraid of using this approach in case some code in the pickup process (either internal or from another addon) tries to do something to an object which I just destroyed, and ends up with a nil reference or something.
c- Once every X turns. Seems a bit inelegant to me.
Lastly, will any of this adversely affect character status (e.g. mark them as cheater or disallow entry to the ladder or something?)
Thank you for your time.