Classes problem
Posted: Mon Jun 30, 2014 8:01 am
I'm using Core 099 and I'm having some problem with classes
The system is designed to work with 8-skill classes and the max level is achieved when every skill in the class has a value of 150
I want to change the system to achieve the max level when every skill has a value of 100 but following the same-adjusted rules
Original
level 1 - 75 in each skill
level 2 - 90 in each skill...
New
level 1 - 50 in each skill
level 2 - 60 in each skill...
It seems to follow a 1.5 ratio but here goes the problem
I've added another class which does have 12 skills instead of 8 and the system fails saying my level is never higher than 1, even with 100 in every skill
Here is the code I'm using (original) for quick reference
thanks for any help
The system is designed to work with 8-skill classes and the max level is achieved when every skill in the class has a value of 150
I want to change the system to achieve the max level when every skill has a value of 100 but following the same-adjusted rules
Original
level 1 - 75 in each skill
level 2 - 90 in each skill...
New
level 1 - 50 in each skill
level 2 - 60 in each skill...
It seems to follow a 1.5 ratio but here goes the problem
I've added another class which does have 12 skills instead of 8 and the system fails saying my level is never higher than 1, even with 100 in every skill
Here is the code I'm using (original) for quick reference
Code: Select all
Elem Settings
{
BonusLevel 0.20
EachMustRepresent 5.0 //7.5
RepresentLevelMod 1
AverageSkill 50 //75
AverageLevelMod 10 //15
AveragePPSkills 90
AveragePPMod 20
}
function IsFromThatClasse( mobile, classe_skills )
var classe := 0,
total := 0,
number := len( classe_skills ),
level := 0;
foreach i in AP_ListAttributesByType( "skill" ) //foreach skill
var amount := AP_GetSkill( mobile, i ); //get 'i' skill from 'mobile', same as RunUO's mobile.Skills[i].Base
total += amount;
if( i in classe_skills ) //if the skill is present on the class definition
classe += amount;
endif
SleepMS(5); //Why should we wait? POL thing...
endforeach
//if else statments does not have braces, they end with else-endif, the same for foreach-endforeach
if( classe < settings.AverageSkill * number ) //anything that start with settings.* refer to the table above
return 0;
elseif( classe_skills == GetClasseSkills( PP ) ) //GetClasseSkills(x) return the skill array, better check if the specified class is PowerPlayer
var average := classe / SKILLID__HIGHEST, // SKILLID__HIGHEST 48(Remove trap) or 49(Necromancy) ?
raise_average := 0;
while( average >= ( settings.AveragePPSkills + raise_average ))
level += 1;
raise_average += settings.AveragePPMod;
SleepMS(5);
endwhile
return level;
elseif( classe < CInt( total * number * settings.EachMustRepresent * 0.01 )) //CInt(x) convert x to int
return 0;
else
level := 1;
var represent := settings.EachMustRepresent + settings.RepresentLevelMod,
percent := CDbl( total * number * represent * 0.01 ),
average_t := CDbl(( settings.AverageSkill + settings.AverageLevelMod ) * number );
while(( classe >= average_t ) && ( classe >= percent ))
level += 1;
represent := CDbl( represent + settings.RepresentLevelMod ); //CDbl(x) >> convert x to double
percent := CDbl( total * number * represent * 0.01 );
average_t := CDbl( average_t + settings.AverageLevelMod * number );
SleepMS(5);
endwhile
return level;
endif
endFunction