You’ll call that method from whatever class needs to know if you passed a skill check. Say you’re chopping down that Yew tree, and you need to know “did that work, or not?”, then you’ll call the player’s SkillStore.SkillCheck(Skill.TreeCutting, 60);
You’ll really be more like replacing it…
If you’re heart is set on getting a cease and desist letter from Jagex (kidding, mostly), then you could add a method GetCombatLevel() to the SkillStore, which calculates the level based on the skills…
Back when I used to play (we’re talking 20 years ago!), the Combat level was calculated differently than it is now. It was a formula involving the Melee, Ranged, and Magic, but I don’t recall exactly what it was… it may have been as simple as (Melee + Ranged + Magic) / 3.
What was tricky about this was in PVP, if you went up against a guy who was level 30, it could be a well rounded character with 30 in each, or it could be a character with level 90 Melee and the rest low, in which case, It’s been very nice knowing you…
In any event, just put in a GetCombatLevel() in the SkillStore that performs the appropriate calculation.
You’re still not going to get away from things like Equipment conditions, because instead, you’ll be checking conditions against the Combat Level, or perhaps simply a bow might check condition against the Ranged Skill. All you’re doing is removing the standard “Experience” from the equation. In SkillStore, you’ll need to have an IPredicateEvaluator that can check a skill, and check the overall Combat or Player level.
My concern here is that this should be well understood by now… you’re diving deep into a complicated system, and without literally cloning your project (ain’t gonna happen), my ability to help will be limited as the skills get added, as I won’ t have time to get back up to speed every time.
Oh, delete that. In fact, you’ll have to, because otherwise, your character will be an AMAZING blacksmith at level 1. That was simply for testing the experience formula I had implemented. The first go round used n! (a multiplication of all numbers under the given level) rather than a summation of all the numbers under a given level, and it blew past int32.MaxValue somewhere in the mid 80s…
Yes, that’s it exactly.