Files
lakebane/src/engine/objects/NPCRune.java
T
MagicBotandClaude Opus 5.5 64a86152d3 Load rune bases from all non-RACE runes, dropping static_rune_runebase reads
The 315 static_rune_runebase rows are exactly the non-RACE runes, so the loader
selects by rune_type. Removes the server type/subtype columns (no live reader),
the runereq/overwrite path, the GET_RUNEBASE cache-miss query, the runebase
attribute handler, the racerune/baseclassrune loaders and the 111111 checks.
No value changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 12:36:34 -04:00

107 lines
3.3 KiB
Java

// • ▌ ▄ ·. ▄▄▄· ▄▄ • ▪ ▄▄· ▄▄▄▄· ▄▄▄· ▐▄▄▄ ▄▄▄ .
// ·██ ▐███▪▐█ ▀█ ▐█ ▀ ▪██ ▐█ ▌▪▐█ ▀█▪▐█ ▀█ •█▌ ▐█▐▌·
// ▐█ ▌▐▌▐█·▄█▀▀█ ▄█ ▀█▄▐█·██ ▄▄▐█▀▀█▄▄█▀▀█ ▐█▐ ▐▌▐▀▀▀
// ██ ██▌▐█▌▐█ ▪▐▌▐█▄▪▐█▐█▌▐███▌██▄▪▐█▐█ ▪▐▌██▐ █▌▐█▄▄▌
// ▀▀ █▪▀▀▀ ▀ ▀ ·▀▀▀▀ ▀▀▀·▀▀▀ ·▀▀▀▀ ▀ ▀ ▀▀ █▪ ▀▀▀
// Magicbane Emulator Project © 2013 - 2026
// https://www.magicbane.com
package engine.objects;
import engine.gameManager.DbManager;
import org.pmw.tinylog.Logger;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class NPCRune extends AbstractGameObject {
private final RuneBase runeBase;
private final int player;
private final ArrayList<SkillReq> skillsGranted;
private final ArrayList<RuneBaseEffect> effectsGranted;
/**
* No Table ID Constructor
*/
public NPCRune(RuneBase runeBase, int characterID) {
super();
this.runeBase = runeBase;
this.player = characterID;
if (this.runeBase != null)
this.skillsGranted = SkillReq.getSkillReqsForRune(this.runeBase.getObjectUUID());
else
this.skillsGranted = new ArrayList<>();
this.effectsGranted = new ArrayList<>();
}
/**
* Normal Constructor
*/
public NPCRune(RuneBase runeBase, int characterID, int newUUID) {
super(newUUID);
this.runeBase = runeBase;
this.player = characterID;
if (this.runeBase == null)
this.skillsGranted = SkillReq.getSkillReqsForRune(this.runeBase.getObjectUUID());
else
this.skillsGranted = new ArrayList<>();
this.effectsGranted = new ArrayList<>();
}
/**
* ResultSet Constructor
*/
public NPCRune(ResultSet rs) throws SQLException {
super(rs);
this.runeBase = RuneBase.getRuneBase(rs.getInt("RuneBaseID"));
this.player = rs.getInt("NpcID");
if (this.runeBase != null) {
this.skillsGranted = SkillReq.getSkillReqsForRune(this.runeBase.getObjectUUID());
this.effectsGranted = DbManager.RuneBaseEffectQueries.GET_EFFECTS_FOR_RUNEBASE(this.runeBase.getObjectUUID());
} else {
Logger.error("Failed to find RuneBase for NPCRune " + this.getObjectUUID());
this.skillsGranted = new ArrayList<>();
this.effectsGranted = new ArrayList<>();
}
}
/*
* Getters
*/
public RuneBase getRuneBase() {
return this.runeBase;
}
public int getRuneBaseID() {
if (this.runeBase != null)
return this.runeBase.getObjectUUID();
return 0;
}
public int getPlayerID() {
return this.player;
}
public ArrayList<SkillReq> getSkillsGranted() {
return this.skillsGranted;
}
/*
* Serializing
*/
public ArrayList<RuneBaseEffect> getEffectsGranted() {
return this.effectsGranted;
}
@Override
public void updateDatabase() {
}
}