User Tools

Site Tools


mr:javelin_item

Javelin Item - Code References

Lua Script

Lua Script Content

local RPD     = require "scripts/lib/commonClasses"
local serpent = require "scripts/lib/serpent"
local weapon  = require "scripts/lib/weapon"
 
return weapon.init{
    family = "missile",
    desc = function()
        return {
            STR       = 15,
            min       = 2,
            max       = 15,
            dly       = 1.0,
            image     = 110,
            randomLo  = 5,
            randomHi  = 15,
            pricePerUnit = 15,
        }
    end,
 
    randomQty = function(self, item, part)
        if part == 0 then return 5 end
        return 15
    end,
    attackProc = function(self, item, attacker, defender, damage)
        RPD.affectBuff(defender, "Cripple", 10)
        return damage
    end,
}

Key Properties from Code

  • Family: missile
  • Strength Required: 15
  • Damage Range: 2-15
  • Stack Quantity: 5-15
  • Price: 15 gold per unit
  • Special Effect: Applies Cripple buff for 10 turns on hit

String Resources

<string name="Javelin_Name">javelin</string>
<string name="Javelin_Info">This length of metal is weighted to keep the spike at its tip foremost as it sails through the air towards its victim</string>
<string name="Javelin_Gender">neuter</string>

JSON Configuration

This entity does not use JSON configuration (implemented in Lua).

Implementation Details

  • Implemented as a Lua scripted weapon using the weapon library
  • Family: “missileâ€� (ranged throwing weapon)
  • Attack proc applies Cripple debuff for 10 turns
  • Random quantity generation: 5-15 units
mr/javelin_item.txt · Last modified: by 127.0.0.1