Read the Charm/Fear level cap ramp as a float, fix the Track flag tests

levelCapRamp is a float column (e.g. 0.65) but was read with getInt, so the
Charm level cap never grew with trains. Charm caps now add ramp * trains.
FearPowerAction gets the same fix; nothing builds it today.

TrackPowerAction tested (flags & 1024) == 1, which is always false. No
caller reads trackPlayer/trackCorpse, so that part changes nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-26 05:33:29 -04:00
1 parent dee936d8a5
commit b5c3d8c3fd
3 files changed
+8 -8

No files matched your search

@@ -26,12 +26,12 @@ import java.sql.SQLException;
public class CharmPowerAction extends AbstractPowerAction {
private int levelCap;
private int levelCapRamp;
private float levelCapRamp;
public CharmPowerAction(ResultSet rs) throws SQLException {
super(rs);
this.levelCap = rs.getInt("levelCap");
this.levelCapRamp = rs.getInt("levelCapRamp");
this.levelCapRamp = rs.getFloat("levelCapRamp");
}
@Override
@@ -52,7 +52,7 @@ public class CharmPowerAction extends AbstractPowerAction {
return;
//make sure mob isn't too high level
int cap = this.levelCap + (this.levelCapRamp * trains);
int cap = (int) (this.levelCap + (this.levelCapRamp * trains));
if (mob.getLevel() > cap && pb.getToken() != 1577464266)
return;
@@ -27,12 +27,12 @@ import java.sql.SQLException;
public class FearPowerAction extends AbstractPowerAction {
private int levelCap;
private int levelCapRamp;
private float levelCapRamp;
public FearPowerAction(ResultSet rs) throws SQLException {
super(rs);
this.levelCap = rs.getInt("levelCap");
this.levelCapRamp = rs.getInt("levelCapRamp");
this.levelCapRamp = rs.getFloat("levelCapRamp");
}
@Override
@@ -51,7 +51,7 @@ public class FearPowerAction extends AbstractPowerAction {
return;
//make sure mob isn't too high level
int cap = this.levelCap + (this.levelCapRamp * trains);
int cap = (int) (this.levelCap + (this.levelCapRamp * trains));
if (mob.getLevel() > cap || mob.getLevel() > 79)
return;
@@ -42,8 +42,8 @@ public class TrackPowerAction extends AbstractPowerAction {
this.effectID = rs.getString("effectID");
int flags = rs.getInt("flags");
this.trackPlayer = ((flags & 1024) == 1) ? true : false;
this.trackCorpse = ((flags & 2048) == 1) ? true : false;
this.trackPlayer = ((flags & 1024) != 0) ? true : false;
this.trackCorpse = ((flags & 2048) != 0) ? true : false;
String trackFilter = rs.getString("trackFilter");
this.trackAll = trackFilter.equals("All") ? true : false;
this.trackDragon = trackFilter.equals("Dragon") ? true : false;