1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Townfolk 1.0 (Karma-Based NPC) 2015-10-26

Random good or evil NPC, that greets players based on it's karma vs theirs

  1. Anomaly
    ::Townfolk 1.0::

    Hello everyone. Here we have Townfolk. Townfolk is an NPC that will speak to players in passing. The response that is delivered is based on the NPC's karma, checked against the player it is speaking to.

    The NPC's Karma is random.
    Code (C#):
    1. this.Karma = (Utility.RandomMinMax(-500, 500));
    And based on it's karma, it's title is determined (also Random).
    (example: )
    Code (C#):
    1. if (this.Karma < 0)//bad
    2. {
    3. switch( Utility.Random(5) )
    4. {
    5. case 0:
    6. this.Title = "The Beggar";
    7. break;
    8. case 1:
    9. this.Title = "The Pickpocket";
    10. break;
    11. case 2:
    12. this.Title = "The Unsavory";
    13. break;
    14. case 3:
    15. this.Title = "The Vagabond";
    16. break;
    17. case 4:
    18. this.Title = "The Vagrant";
    19. break;
    20. }
    21. }
    You may want to edit the strings, (commented accordingly, titled to be easy enough to remember which belongs to what), as they are quite generic.

    Installation is as simple as drag-and-drop into your custom script folder. I know it isn't much, but i hope someone finds some use from it. I'm open for ideas as well, if you think we can improve on it. Any questions, just ask. ~Thanks

    Special thanks to Omegaexdeath for his guide on Talking NPC's who can teach, the idea was largely driven from stumbling across his post.
    https://www.servuo.com/threads/howtomake-talking-npcs-with-titles-who-can-teach.2973/
    RedBeard likes this.