This package adds stat calculation support to plugins (and provides the plugin CalcStat-Expressions, so users can make stat queries and calculations themselves).
Calculation examples are:
1) all what is needed for Rating to Percentage (or vice versa) calculations
2) item stat calculations based on item level
3) skill/effect stat calculations based on player level
4) virtue stat calculations based on rank, including required xp
I created CalcStat initially for my LotroPlan spreadsheet, but I've expanded it and made it more flexible, so it can be used in many other types of applications, like Lotro plugins, websites and scripts.
An example of a plugin is
StatWatch and of a website application is
LOTRO forum topic /
LOTRO Ratings Calculator. CalcStat is also being used at
Lotro-Wiki.
Developer information:
The included VisualBasic script compiles statdata.csv which results in the CalcStat.lua file (option 2) with the major calculation function (other output formats like StarBasic/VBA, VB-script, PHP, JavaScript, Java and Python are also available). Statdata.csv contains currently ~3700 entries (an entry is one stat calculation segment). You can most conveniently view the .csv with a spreadsheet application.
The download contains standard the percentage calculations only version for plugins which can be included in a plugin by importing "Giseldah.CalcStat".
An Apps Script Library is available for use in Google Sheets with Script ID: 1AWxeK788k4nMhwzr2ZSvnvdnIIyIBe366nNkAPuBdkjNSL_HI AA5CM_m
Code:
version 1.0.1:
- fixed a bug in Roman number decoding for LI titles.
version 1.0.2:
- fixed a bug in Roman number decoding for LI titles reprisal. :o
- added comments to the calculation function support file CalcSsup.lua
version 1.0.3:
- implemented a binary search tree for the stats lookup. tree height/depth is 10 at the moment (max capacity 2^10-1=1023 stats).
version 1.0.4:
- added more comments to statdata.csv
- some stats were added or changed(made current with BR U23.2p2) see post below.
version 1.0.5:
- added TpenArmour, TpenResist and TpenBPE with the new penetration calculations. N=tier, so like CalcStat("TpenArmour",120,3) for Tier 3.
- added T2penArmour which is the same as the old T2penMit stat (reused in the game). Other old stats T2penResist etc are also still available. Old pen stats are used in older instances (instances without T3).
version 1.0.6:
added some basics like:
- all character class base stat tables
- hope/dread percentages
- stat tome main values: CalcStat("TomeMain",nil,"XVIII")
- stat tome total values (adds up all up to rank): CalcStat("TomeTotal",nil,"XX")
new calculation type 'D'(ata lookup table) for values of which I can't find a good formula fit for :rolleyes:
version 1.0.7:
- added virtue stats. Like some other stats, virtue stats come in 3 strengths - L(ow), M(edium) and H(igh). Example: CalcStat("VirtMoraleH",20)
version 1.0.8:
- added new virtue system stats. example: CalcStat("VirtCompassion",60,"PhyMit") gives Physical Mitigation Rating rank 60 Compassion or CalcStat("VirtZeal",49,"VPTacMas") gives Virtue Passive Tactical Mastery Rating rank 49 Zeal.
- VRnkToILvl: virtue rank to item level mapping
version 1.0.9:
- VRnkCap: virtue rank overall cap (60)
- VRnkLvlCap: virtue rank character level based cap
- VirtRnkCost: virtue xp cost single rank
- VirtRnkCostTot: total virtue xp cost to reach rank from 0
version 1.0.10:
24.2 captain stat changes
- Blade-brother: CptBladeCritDef, CptBladePhyMas, CptBladeTacMas
- Shield-brother: CptShieldCritDef, CptShieldPhyMas, CptShieldTacMas
- Song-brother: CptSongCritDef, CptSongPhyMas, CptSongTacMas
- IDOME: CptIDOMEMain, CptIDOMEVitality
- Cry of Vengeance: CptCoVMain, CptCoVVitality, CptCoVPhyMit, CptCoVAttDurP
- Tactic: Relentless Attack: CptRelentlessCritHit, CptRelentlessPhyMas, CptRelentlessTacMas
- Tactic: On Guard: CptOnGuardParry
- Defending: CptDefendingArmour
version 1.0.11:
solves an issue with finding stats which have digits in the statname
version 1.0.12:
Changes (based on Bullroarer Update 24.3 - Preview #1):
- adjusted percentage/rating calculations for levels 1-99, because of new roundings in cap rating progressions, which caused percentages for Light & Medium mitigations to be slightly higher than before.
- adjusted percentage/rating calculation for levels 101-104, because I detected a bump in cap rating progressions at levels 101 & 102 (lvl101=1.1*lvl100, lvl102=oddity like lvl76).
- added 25% extra bonus percentage to Partial Evade Mitigation at Level 1 (PartEvadeMitPBonus)
version 1.0.13 (became 1.0.14 by mistake):
In this version I've implemented a standard progression (StdProg) from which most most of the stats are now calculated more or less directly. This is in preparation for stat changes (and so standard/normal progression change) which next expansion will bring with a level cap change, item level changes etc. No real changes in percentage calculation, except under the hood things like mentioned. Some stats changes:
- Battle & Warding lore scrolls stats.
- Max morale and power scroll Morale.
- Stats scaling by character level as used on Shield of the Hammerhand, High-Elf earrings and racial traits.
version 1.0.14b:
Contains changes for U25 preview #3 on BR. Not to be used on live servers.
version 1.0.15:
Contains all updates for U25.
version 1.1.0:
Added class and race data, like main stat contributions and race traits.
Changed the way virtue stats are arranged.
The compiler can now output various versions for efficiency: "Full" and "Percentage calculations only".
version 1.1.1:
Fixed Minstrel Enduring Morale Trait (MINENDMORALE) and renamed _Version to -Version
version 1.1.2:
Fixes AwardLvlToILvl.
This version includes the support files for all 3 script types (Lua-script/StarBasic/VB-script).
version 1.2.0:
CalcStat is now a global library, which can be imported by plugins with: import "Giseldah.CalcStat"
Includes support for plugin compendium.
version 1.2.1:
U25.1 changes:
- Beorning/Champion stat contributions.
- ICMR/NCMR progression change (more in line with vitality now).
version 1.3.0:
- U25.1.1: Vitality fix Stout-axe racial trait.
- Fixed a bug in @ScaleArmour calculation.
- Major update of compiler to make it more flexible.
- All CalcStat functionality now in one file.
- Added PHP-script compile option for use of CalcStat on websites.
version 1.3.1:
Adds JavaScript as compile option (and some example html).
version 1.3.2:
- Fixed a possible bug for Lua-script.
- Script option 1 should now be VBA/MS Office compatible (untested).
version 1.3.3:
- Fixed some bugs for JavaScript.
- Slightly expanded "Percentage calculations only" set with class information stats CanBlock and ArmourType.
- New stat LevelCap (130).
version 1.4a254p1:
Contains a lot of changes for U25.4 preview #1 on BR. Not to be used on live servers.
version 1.4:
This version contains all updates for U25.4. All stats were checked during the beta time and a large part also with final 'live' client.
version 1.4.1:
Solves a bug which caused old trait/skill stats to scale to above lvl130.
version 1.4.2:
Adds stats LvlExpCost (amount of xp needed for single level from previous level) and LvlExpCostTot (total amount of xp needed to reach level). These stats are not capped by level cap. They are included in percentage-only set for TitanBar-plugin.
version 1.5.0:
- Contains a lot of new stats which are related to Trait trees (skills/bonuses/passives). See examples for a list.
- Added a new stats set named "Trait trees stats" in the compiler. This is an optimized set for using these kind of stats only.
version 1.5.1:
Adds stat SkillPowerCost. This stat gives the skill power usage value for a character level L, based on a basevalue N (power increase at low levels) such as (typically) 0.5, 1, 1.5, 2 etc.
version 1.5.2:
Adds stats LvlBonusPhyDmg, LvlBonusTacDmg and LvlBonusHeals for skill output calculations.
version 1.5.3:
- Renamed LvlBonusHeals to LvlBonusMorRes (morale restoration skills).
- Added LvlBonusPowRes (typical N=0.5,1,2.5,5) for power restoration skills.
- Added LvlBonusRuneofRes: Rune of Restoration Level Bonus
version 1.5.4:
Fixes a bug in LvlBonusMorRes, so values above lvl115 show up again.
version 1.5.8:
- LI title stat changes up to BR U28.3p1
- Might stat bug (in-game) on items implementation
- MP buffs adjustments U28.2
version 1.5.9:
- fixes LI title stat TitPhyMas
- CalcStat can now be loaded as a plugin and provides a command line calculation option. This is not required if only used as a library.
version 1.6.0:
Main new functionality in this version is CalcStat support for Lotro-Wiki! To that end, the compiler has now an extra output script option for Lua which is supported by MediaWiki in combination with the Scribunto extension.
Other:
- reworked Audacity and Battlefield Promotion buffs in separate creep and freep stats.
- added Burglar Reveal Weakness & Guardian's Ward stats.
version 1.7.0:
CalcStat can now run in MS Excel (select VBA output in the compiler) and a new output option for Java has been added.
New stats WpnDPS and WpnDmgMin/WpnDmgMax for non-LI weapons.
A lot of stats for calculating sell values of items have been added, but you need to know the right code (item defined).
version 1.8.0b6:
This is a beta version with support for U31. A lot of stats have changed. Not all stats have been updated yet, but most are fine now like:
- rating percentages
- normalized stats (includes virtues)
version 1.8.0:
Adds the following updates to the beta:
- weapon dps calculations
- item level tables dropped/awarded items
version 1.8.1:
Contains some changes introduced in U33 (and more):
- Tactical Mastery/Physical Mastery/Critical Rating stats are consistent again
- Some armour calculations were fixed
- Minstrel Enduring Morale
No changes in percentage calculations.
version 1.9:
Various stat changes for U34. Does not change percentage calculations.
version 2.0:
This version introduces a new loadable plugin. The command line for basic CalcStat has been removed and you can now use
CalcStat Expressions in a window.
Also adds new Stat tome values and probably stuff that I forgot.
version 2.0.1:
A full version with all stats is now included as well (compiler option 1: Full version), so always all stats are available within CalcStat Expressions.
version 2.0.2:
Expressions: adds scroll bars to text boxes and displays help text correctly from the top.
CalcStat: contains a fix for perk stats.
version 2.1:
Incorporates many changes for U35.
version 2.1.3:
Bugfix for LinFmod Lua version.
Added stat CombatBaseTacHPSNoClass which provides the HPS number for classes without HPS on the class item. Also, some other skill calculation related stats.
Extended the number of possible variables in Expressions to 1000.
version 2.2:
Contains changes for U37.
Adds Python as compiler output script option.
version 2.2.1:
Contains changes for U37.0.1:
Outgoing Healing Rating, Burglar stat contributions.
version 2.2.2:
Contains changes for U37.1:
Physical DPS values, some legacy stat changes.
Added an effect/traits informational file.
version 2.2.3:
Contains changes for U37.2:
Mariner- new base stats & class main stat derivations.
Updated U37 Tactical DPS & HPS stats (basis for skill damage/healing calculations).
version 2.3:
Contains changes for U38:
Level cap increase to 150/549, new class main stat derivations, etc.
version 2.3.1:
Contains changes for U38.1:
Creep stats updates. Warden Resistance rating contribution from Will.
version 2.3.2:
Contains changes for U39:
Some creep stats and item level progression updates.
TPenArmour,L,1 now returns the mitigation rating penetration value as used in Depths of Mâkhda Khorbo Tier 1. TPen stats are now like T1=0.5 T2=1 T3=2.
version 2.3.3:
CalcStat Expressions: new functions Choose (like in spreadsheets) and While (loop) and revised escape characters support. See
https://lotro-wiki.com/wiki/Module:CalcStat/doc for details.
version 2.4:
Contains changes for U41:
Item stats changes around point ilvl50 and from ilvl451 towards ilvl499. This affects also virtue stats (item stat based).
Adeventurer awarded item levels changed.