Build BaseClass from its class rune and compare every field
Adds BaseClass(RuneTemplate): attributes from rune_attr_adj, health/mana/stamina from rune_health/mana/stamina, token = SBStringHash(rune_sub_type), description from rune_dsc. Skills, powers and effects still load from the DB by rune id (tasks 2.8, 2.9, 2.10). The static_rune_baseclass comparator now checks every field against a JSON-built BaseClass. Offline parity (scripts/p21.py, 4 rows vs the CLASS runes with rune_is_standard_character_creation = 2500-2503): 0 differences except description, which is '' in the DB and the class blurb in rune_dsc. Nothing reads BaseClass.getDescription(). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0283f85e87
commit
5acd3492ed
2 files changed
+44
-3
No files matched your search
@@ -10,7 +10,10 @@
|
||||
package engine.objects;
|
||||
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.mbEnums;
|
||||
import engine.net.ByteBufferWriter;
|
||||
import engine.parsers.objects.RuneTemplate;
|
||||
import engine.util.Hasher;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
@@ -104,6 +107,28 @@ public class BaseClass extends AbstractGameObject {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Rune Template Constructor
|
||||
*/
|
||||
public BaseClass(RuneTemplate rune) {
|
||||
super(rune.template_id);
|
||||
|
||||
this.name = rune.obj_name;
|
||||
this.description = rune.rune_dsc;
|
||||
this.strMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Strength, 0).byteValue();
|
||||
this.dexMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Dexterity, 0).byteValue();
|
||||
this.conMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Constitution, 0).byteValue();
|
||||
this.intMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Intelligence, 0).byteValue();
|
||||
this.spiMod = rune.rune_attr_adj.getOrDefault(mbEnums.AttributeType.Spirit, 0).byteValue();
|
||||
this.token = Hasher.SBStringHash(rune.rune_sub_type);
|
||||
this.healthMod = rune.rune_health;
|
||||
this.manaMod = rune.rune_mana;
|
||||
this.staminaMod = rune.rune_stamina;
|
||||
this.skillsGranted = DbManager.SkillReqQueries.GET_REQS_FOR_RUNE(this.getObjectUUID());
|
||||
this.powersGranted = PowerReq.getPowerReqsForRune(this.getObjectUUID());
|
||||
this.effectsList = (DbManager.MobBaseQueries.GET_RUNEBASE_EFFECTS(this.getObjectUUID()));
|
||||
}
|
||||
|
||||
public static void LoadAllBaseClasses() {
|
||||
DbManager.BaseClassQueries.GET_ALL_BASE_CLASSES();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user