mr:zombie_mob
Table of Contents
Zombie Mob - Code References
Java Classes
- Mob.java - Base mob class
- MobFactory.java - Factory for creating mobs from JSON configuration
- CustomMobAi.java - AI for JSON-configured mobs
JSON Configuration
Mob configuration in mobsDesc/Zombie.json:
{
"name" : "Zombie_Name",
"name_objective": "Zombie_Name_Objective",
"description" : "Zombie_Desc",
"gender" : "Zombie_Gender",
"attackSkill" : 10,
"defenseSkill" : 10,
"dmgMin" : 3,
"dmgMax" : 10,
"dr" : 10,
"str" : 13,
"ht" : 33,
"exp" : 6,
"maxLvl" : 15,
"baseSpeed" : 1,
"attackDelay" : 1,
"viewDistance" : 8,
"walkingType" : "NORMAL",
"spriteDesc" : "spritesDesc/Zombie.json",
"scriptFile" : "scripts/mobs/Zombie",
"lootChance" : 0.02,
"loot" : { "kind": "Gold" },
"undead" : true,
"isHumanoid" : true,
"canBePet" : true,
"friendly" : false,
"fraction" : "DUNGEON"
}
- mobsDesc/Zombie.json - Main mob configuration
- spritesDesc/Zombie.json - Sprite configuration
- Spawn configuration in Bestiary.json:
- necro1: Zombie spawn rate 1.0
- necro2: Zombie spawn rate 1.0 (with ExplodingSkull, EnslavedSoul, DeathKnight, DreadKnight)
- necro3: Zombie spawn rate 2.0 (with ExplodingSkull, EnslavedSoul, DeathKnight, DreadKnight)
String Resources
English string resources:
<string name="Zombie_Name">zombie</string> <string name="Zombie_Name_Objective">zombie</string> <string name="Zombie_Desc">An animated corpse from the necropolis. It has quite a bit of health, and has a chance to poison the hero on hit. Like all undead creatures, it has immunity to many effects.</string> <string name="Zombie_Gender">masculine</string>
String resources available in multiple languages:
- And other localization files
Lua Scripts
- Zombie.lua - Custom attack behavior (poison on hit)
Key Code Fragments
JSON Configuration (mobsDesc/Zombie.json):
{
"name" : "Zombie_Name",
"name_objective": "Zombie_Name_Objective",
"description" : "Zombie_Desc",
"gender" : "Zombie_Gender",
"attackSkill" : 10,
"defenseSkill" : 10,
"dmgMin" : 3,
"dmgMax" : 10,
"dr" : 10,
"str" : 13,
"ht" : 33,
"exp" : 6,
"maxLvl" : 15,
"baseSpeed" : 1,
"attackDelay" : 1,
"viewDistance" : 8,
"walkingType" : "NORMAL",
"spriteDesc" : "spritesDesc/Zombie.json",
"scriptFile" : "scripts/mobs/Zombie",
"lootChance" : 0.02,
"loot" : { "kind": "Gold" },
"undead" : true,
"isHumanoid" : true,
"canBePet" : true,
"friendly" : false,
"fraction" : "DUNGEON"
}
Lua Script (scripts/mobs/Zombie.lua):
local RPD = require "scripts/lib/commonClasses" local mob = require "scripts/lib/mob" return mob.init{ attackProc = function(self, enemy, dmg) -- 1/3 chance to poison; java rolled Random.Int(2,3) which is [2,3) -- i.e. always 2 turns if enemy ~= nil and math.random(3) == 1 then local factor = RPD.CharUtils:durationFactor(enemy) RPD.Buffs.Buff:affect(enemy, "Poison", 2 * factor) end return dmg end }
Related mr: Entities
- Poison (Buff) - Applied by Zombie's attack
- Necromancer (Class) - Related to Necropolis theme
- Skeleton (Mob) - Another undead mob in Necropolis
- Death Knight (Mob) - Another Necropolis mob
- Enslaved Soul (Mob) - Another Necropolis mob
Related Wiki Pages
- Necropolis (Level) - Where Zombies spawn
- Undead (Mechanic) - Zombie type and immunities
mr/zombie_mob.txt · Last modified: by 127.0.0.1

