I've never made a town NPC myself, but I assume the method should work roughly the same way. Otherwise I'm sure there's a town NPC example in the example mod too.
For the accessory, I'm not sure whether tModLoader has any easier way, but the way I do it is a bit tricky for newbs and it involves a global player code checking whether any player is equipping X item when specific methods are called (for example, I have an armor that deals damage in an area every time the Hurt method in global player is called, but only runs the code if they have the full armor set equipped).
No, it would go in a different .cs file in the mod's root folder (the same folder where the mod's main .cs file is). This code is untested but roughly what it should look like for a global code that checks whether an accessory is equipped and run an effect on the event of the player getting damaged. https://puu.sh/xoTnf/f4b355699f.txt
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.