Formula

CommonFun.calcNpcDropBaseExp

function CommonFun.calcNpcDropBaseExp(damage, deltalv, npctype, npczone, maxhp, exp, extrabuff, membercount, layer, mapid, stype, killer, dailyextra, star)
  if maxhp <= damage then
    damage = maxhp
  end
  local extra = CommonFun.getExpExtra(npczone, npctype, stype, mapid)
  local reduce = CommonFun.getExpReduceValue(deltalv, star)
  if membercount == 0 then
    membercount = 1
  end
  if npctype == 5 then
    local e1 = (0.2 * killer + 0.8 * damage / maxhp) * exp * ((membercount - 1) * 0.1 + 1) / membercount * reduce
    if e1 <= 1 then
      e1 = 1
    end
    local e2 = e1 * CommonFun.getDailyRatio(dailyextra)
    local result = e2 * (1 + extra)
    if result <= 0 then
      result = 1
    end
    return result
  end
  local e3 = damage / maxhp * exp * ((membercount - 1) * 0.1 + 1) / membercount * reduce
  if e3 <= 1 then
    e3 = 1
  end
  local e4 = e3 * CommonFun.getDailyRatio(dailyextra)
  local result = e4 * (1 + extra)
  if result <= 1 then
    result = 1
  end
  return result
end