Quantcast
VGInterface.com
Search Downloads


Go Back   LoTROInterface > LotRO Libraries

Category: LotRO LibrariesCalcStat
Interface Information
Download
How do I install this? (FAQ)
Name: CalcStat   Updated less than 3 days ago!   Popular!
Author:
Date: 02-16-2020 07:11 PM
Size: 48.10 Kb
Version: 1.4a254p1
Rate File: 5 out of 5 with 2 votes  
Pictures
Click to enlarge 

Views: 0
Size: 173.60 Kb
Dimensions: 1488 x 781
Simplicity in it's use and flexibility because of a stat definition table.
 
Click to enlarge 

Views: 0
Size: 59.46 Kb
Dimensions: 1248 x 809
PHP script for calculations on websites.
 
Click to enlarge 

Views: 0
Size: 24.07 Kb
Dimensions: 400 x 400
Available compiler options.
 
Click to enlarge 

Views: 0
Size: 10.41 Kb
Dimensions: 609 x 372
JavaScript test output
 
Description
This package contains the type of functions which are also used in my spreadsheet LotroPlan for most of the calculations like calculating rating percentages from ratings, item stats from item levels (armour values for instance), LI title stats from I,II,III etc.

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 and JavaScript are also available). Statdata.csv contains currently ~2200 entries (an entry is one stat calculation segment). You can most conveniently view the .csv with a spreadsheet application.

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.
- 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

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.
Archive List (Old Versions)
File Name
Version
Size
Author
Date
1.3.3
78.05 Kb
Giseldah
01-26-2020 02:04 PM
1.3.2
47.86 Kb
Giseldah
01-02-2020 10:36 AM
1.3.1
48.62 Kb
Giseldah
12-21-2019 10:54 AM
1.3.0
47.29 Kb
Giseldah
12-19-2019 10:09 PM
1.2.1
45.67 Kb
Giseldah
12-13-2019 01:29 PM
1.2.0
45.17 Kb
Giseldah
12-09-2019 08:11 AM
1.1.2
37.94 Kb
Giseldah
12-09-2019 04:34 AM
1.1.1
32.68 Kb
Giseldah
11-20-2019 02:23 AM
1.1.0
32.69 Kb
Giseldah
11-18-2019 07:27 AM
1.0.15
29.84 Kb
Giseldah
11-09-2019 04:40 AM
1.0.14b
29.63 Kb
Giseldah
11-01-2019 02:48 AM
1.0.14
29.24 Kb
Giseldah
10-13-2019 12:53 PM
1.0.12
29.90 Kb
Giseldah
09-21-2019 08:50 AM
1.0.11
29.88 Kb
Giseldah
08-24-2019 01:22 AM
1.0.10
29.89 Kb
Giseldah
08-05-2019 09:42 AM
1.0.9
29.57 Kb
Giseldah
06-16-2019 07:25 AM
1.0.8
29.40 Kb
Giseldah
06-15-2019 08:05 AM
1.0.7
32.70 Kb
Giseldah
12-18-2018 03:02 PM
1.0.6
31.97 Kb
Giseldah
12-16-2018 11:00 AM
1.0.5
23.16 Kb
Giseldah
12-14-2018 06:07 AM
1.0.4
21.18 Kb
Giseldah
12-07-2018 09:04 AM
1.0.3
18.16 Kb
Giseldah
12-05-2018 10:20 AM
1.0.2
16.98 Kb
Giseldah
12-03-2018 04:52 AM
1.0.1
15.48 Kb
Giseldah
12-02-2018 04:33 PM
1.0
15.52 Kb
Giseldah
12-02-2018 01:36 PM
File Statistics
User Rating:
5 out of 5 with 2 votes
Downloads: 2692
Views: 13141
Favorites: 4
Uploaded By:
 
Last Modified: N/A

View Pictures. Download Now! Post A Comment


Post A Reply
Author Comments Comment Options
Unread 12-02-2018, 03:58 PM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
Some usage examples

Just a few of the many calculations:

Tactical Offence Damage percentage (+0.0002 to make it like in the character window) =
CalcStat("TacDmgPRatP",PlayerLevel,Rating)+0.0002

Resistance percentage from rating including T2 penetration =
CalcStat("ResistPRatP",PlayerLevel,Rating+CalcStat ("T2PenResist",MobLevel))+0.0002

Full Evade percentage cap =
CalcStat("EvadePRatPCap",PlayerLevel)

Required Evade rating for percentage =
CalcStat("EvadePPRat",PlayerLevel,Percentage)

Mithrin Vitality essence value (ilvl 372) =
CalcStat("Vitality",372)

Armour value for ilvl 380 medium head gear purple =
CalcStat("Armour",380,"MHP")

Captain's In Defence of Middle-Earth main stats buff =
CalcStat("CptIDOMEMain",PlayerLevel)

Critical Defence on item =
CalcStat("CritDef",ilvl,points)

Knowledge of Eldar Days III LI title Tactical Mastery Rating =
CalcStat("TitTacMas",nil,"III")

Last edited by Giseldah : 12-02-2018 at 04:30 PM.
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-07-2018, 09:19 AM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
Changes

These stats were changed:

CPTCRITDEF - Captain critical defence rating passive
DWARFENDURVITALITY - Dwarf racial trait skill Dwarf Endurance Vitality
GRDCRITDEF - Guardian critical defence rating passive
GRDPROTECTIONAVOID - Guardian trait skill Protection b/p/e ratings
GRDTENDERIZECRITHIT - Guardian trait Tenderize Critical hit rating
GRDWARDTACTTACMIT - Guardian trait Guardian's Ward Tactics Tactical Mitigation
LMHEARTYDIETMORALE - Lore-master trait Hearty Diet Morale
RACIALMAIN - racial traits main stat
SHIELDBRAWLERBLOCK - Dwarf racial trait Shield-brawler Block rating
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 11-01-2019, 03:20 AM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
Pseudo code in definitions

Some small explanation of the stat data definitions:

Value = CalcStat( string Name, number L, number N | string C )

L(evel) and N(umeral) can be used directly in formulas as can some support functions in combination with C.

To keep definitions shorter, and so more readable, I've developed some pseudocode:

@Name{L}#{N} or @Name{L}#{C}

This is the same as above.

{} is not needed if the passed values are digits or a dot:

@Name130#0.4

Default for N is 1, so only @Name130 is the same as @Name130#1.

@Name130# means that you pass along L=130 and the current context N.

@Name#0.4 means that you pass current context L and N=0.4.

@Name# means that you pass current context L and N.

@Name means that you only pass current context L

No short code for passing C is provided at the moment, other then explicit #{C}.

Examples:
@Block#1.2 - returns 1.2 points of current L (item)Block rating, where L is assumed to be the item level in this case.
@PhyMasT#0.8 - returns 0.8 points of current L (Trait/skill)Physical Mastery rating, where L is assumed to be the character level (see notes).
@CritHit{@LvlToILvl}# - @LvlToILvl assumes current L=character level and translates this to an item level. the resulting item level is then passed as L to @CritHit along with current N and this returns the (item)Critical Rating.

Last edited by Giseldah : 11-01-2019 at 04:12 AM.
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 11-18-2019, 07:38 AM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
New compiler option version selection:

"Percentage calculations only" supports ratings->percentages, percentages->ratings and rating penetration calculations.

Resulting CalcStat function size will become smaller with the reduced number of stats. Search tree depth becomes smaller as well, so stat searches become slightly more efficient.

You can query version type with stat -Version which will return something like "1.1.1f" or "1.1.1p" (string type).

Last edited by Giseldah : 11-20-2019 at 02:18 AM.
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 11-29-2019, 06:37 AM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
"AwardLvlToILvl" (Character Level to Item Level mapping as used for Mathom armour items, scaling leveling items) was changed again for levels > 120 and is incorrect in current version 1.1.1
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-09-2019, 04:37 AM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
readme

Stat definition file statdata.csv:

You can view this comma separated values file with something like a spreadsheet application. Upload it to Google Sheets for example or use LibreOffice Calc, Microsoft Excel etc.

Compilation of statdata.csv:

Execute statdcmp.vbs (double click) to generate the CalcStat script file. This will contain the major calculation function.
Output version "Percentage calculations only" supports ratings<->percentages and rating penetration calculations and will do for all known Lotro plugins at this time.

Installation/use:

Lotro Plugins:
Extract the zip file to your Lotro Plugins directory. After, you should have a directory like "C:\Users\UserName\Documents\The Lord of the Rings Online\Plugins\Giseldah\CalcStat"
Plugins can import this library using the statement: import "Giseldah.CalcStat"
The directory already contains a "Percentage calculations only" version by default, so you don't need to compile statdata.csv if this is all you require.

OpenOffice/LibreOffice:
Compile statdata.csv with StarBasic as output script type. This will generate the CalcStat.bas file with the CalcStat function.
Inside the Calc spreadsheet application, create a new CalcStat macro module, either under "My macros & Dialogs" for use globally in any spreadsheet or create the module in a specific spreadsheet.
Copy the content of the CalcStat.bas file to this new module.

VB-script (Windows):
Compile statdata.csv with VB-script as output script type. This will generate the CalcStat.vbs file with the CalcStat function.
You can include CalcStat.vbs conveniently in a script job by using a WSF file (see https://en.wikipedia.org/wiki/Windows_Script_File).
See the vbs_example directory for an example script.

PHP:
Compile statdata.csv with PHP as output script type. This will generate the calcstat.php file.
You can include this file in your PHP enabled web pages and start using the CalcStat function for your calculations.

javascript:
Compile statdata.csv with JavaScript as output script type. This will generate the calcstat.js file.
You can include this file in your JavaScript enabled web pages and start using the CalcStat function for your calculations.

Last edited by Giseldah : 12-21-2019 at 10:55 AM.
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 12-20-2019, 07:07 AM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
If you have a request for some script type then let me know.
Current system is flexible, but it's not suited for languages with strict type-casted variables.

Last edited by Giseldah : 12-21-2019 at 10:56 AM.
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Unread 01-26-2020, 02:14 PM  
Giseldah
The Wary
 
Giseldah's Avatar
Interface Author - Click to view interfaces

Forum posts: 0
File comments: 18
Uploads: 3
LOTRO Ratings Calculator

The new (beta version 0.99) LOTRO Ratings Calculator is using 1.3.3p JavaScript version of CalcStat.
The proper location for calcstat.js is the js subdirectory in the root of that web-application.
Giseldah is offline Report comment to moderator   Reply With Quote Reply With Quote
Post A Reply

 
Category Jump:
Search this Category:
 

All times are GMT -5. The time now is 10:01 PM.


Our Network
EQInterface | EQ2Interface | Minion | WoWInterface | VGInterface | LoTROInterface | MMOInterface | Swtorui