User Tools

Site Tools


mr:servant_npc

Servant NPC - Code References

Java Classes

This entity is implemented via JSON configuration and Lua script, no Java class exists.

JSON Configuration

  • ServantNPC.json - Mob configuration file
  • Location: `RemixedDungeon/src/main/assets/mobsDesc/ServantNPC.json`
  • Properties:
    1. `friendly`: true (non-hostile NPC)
    2. `movable`: true (can move around)
    3. `aiState`: “Passive” (passive AI behavior)
    4. `fraction`: “NEUTRAL” (neutral faction)
    5. `immortal`: true (cannot be killed)
    6. `spriteDesc`: “spritesDesc/ServantNPC.json” (sprite configuration)
    7. `scriptFile`: “scripts/npc/Servant” (Lua behavior script)

JSON Configuration (Sprite)

Level Configuration

  • Inn_2021_03.json - Level configuration where ServantNPC spawns
  • Location: `RemixedDungeon/src/main/assets/levelsDesc/Inn_2021_03.json`
  • Spawn: Line 27, `“kind”:“ServantNPC”`

String Resources

  • English (`values/strings_all.xml`):
    1. `ServantNPC_Name` (line 1964): “inn servant”
    2. `ServantNPC_Name_Objective` (line 1965): “inn servant”
    3. `ServantNPC_Gender` (line 1966): “feminine”
    4. `ServantNPC_Desc` (line 1967): “A very busy inn servant.”
  • Russian (`values-ru/strings_all.xml`):
    1. `ServantNPC_Name`: “служанка”
    2. `ServantNPC_Name_Objective`: “служанку”
    3. `ServantNPC_Gender`: “feminine”
    4. `ServantNPC_Desc`: “Очень занятая служанка в таверне.”

Lua Scripts

  • Servant.lua - NPC behavior script
  • Location: `RemixedDungeon/src/main/assets/scripts/npc/Servant.lua`
  • Behavior: Uses `mob.init()` with `interact` and `act` functions
  • Interactions: Says random phrases from `InnServant_Phrase_1` to `InnServant_Phrase_4`
  • AI: Moves randomly using `MoveOrder` state, avoids other ServantNPCs

Additional References

mr/servant_npc.txt · Last modified: by 127.0.0.1