User Tools

Site Tools


mr:rat_king_mob

Rat King

rat_king_mob - Code References

Java Classes

Entity Properties

  • getEntityKind(): Returns “RatKing” (class name)
  • Type: NPC / Boss mob
  • HP: 30 (ht(30))
  • Base Defense Skill: 20
  • Base Attack Skill: 15
  • Damage: 4-10 (dmgMin=4, dmgMax=10)
  • Damage Reduction: 5 (dr=5)
  • Speed: 2.0 (fast)
  • EXP for Kill: 1
  • Initial State: Sleeping
  • Gender: Male
  • Fraction: Changes from friendly to DUNGEON when angered

Implementation Details

The RatKing class extends NPC and implements unique behavior:

  • Starts in Sleeping state
  • Has an anger counter (starts at 0)
  • Friendly to hero when anger < 2
  • First interaction: Wakes up and says greeting (R.string.RatKing_Info1)
  • Second interaction: Becomes angry, mentions treasure (R.string.RatKing_Info2)
  • Third interaction: Becomes hostile, changes fraction to DUNGEON, summons guards (R.string.RatKing_Info3)
  • On death: Says final words (R.string.RatKing_Died)
  • Automatically collects RatKingCrown item on spawn
  • Immune to buffs while friendly to hero
  • Always resets (reset() returns true)
  • Cannot be damaged by hero while friendly (anger set to 2 instead)

JSON Configuration

This entity does not have separate JSON configuration as it's implemented in Java.

String Resources

<string name="RatKing_Name">rat king</string>
<string name="RatKing_Name_Objective">rat king</string>
<string name="RatKing_Gender">male</string>
<string name="RatKing_Desc">The Rat King is the ruler of all rats in the sewers. He is much larger than the normal rats and wears a tiny crown on his head.</string>
<string name="RatKing_Info1">"What? What? Who dares to disturb my rest?"</string>
<string name="RatKing_Info2">"You must be here for my treasure! No! It\'s mine! All mine!"</string>
<string name="RatKing_Info3">"Guards! Take care of this one!"</string>
<string name="RatKing_Died">"This is impossible! I\'m a king! I can not die!"</string>
<string name="RatKingCrown_Name">rat king crown</string>
<string name="RatKingCrown_Info">A cheap crown of a sewer rat. Though it\'s supposed to symbolize authority and power, it looks quite ridiculous.</string>
<string name="RatKingCrownBuff_Name">Crowned</string>
<string name="RatKingCrownBuff_Info">You are wearing a king rat crown.\n\nAs long as you wear this crown, rats will be friendly to you.\n\nTurns on: Rat King fight.\nTurns off: When you take the crown off or kill the King.</string>

Lua Scripts

This entity is implemented in Java, no Lua script exists

Drops

mr/rat_king_mob.txt · Last modified: by 127.0.0.1