Add wpak cfg reader and PowerActions.cfg loader

New engine.parsers.wpak importer (replaces engine.wpak, which stays unused).
WpakFileReader tokenizes cfg lines (quotes, '#'/'*' comments, trailing '#')
and builds XxxBEGIN/XxxEND blocks; every error names file:line.

PowerActionParser loads PowerActions.cfg into PowerActionTemplate._powerActions,
keyed by action id, at world boot. Header layouts per action type come from
the client's ArcPowerAction*_ParseHeader functions: the trailing 0/1 on
ApplyEffect and friends is the aggressive flag, not a level. effect_ids holds
the action -> effect map needed by Task 2.10b. Three ids (PRE-235..237)
repeat identically; the later entry wins, as in the client. No consumers change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MagicBotandClaude Opus 5.5 committed 2026-10-22 11:08:09 -04:00
1 parent 76dcdc0f72
commit 6c820940d3
7 files changed
+711

No files matched your search

+10
View File
@@ -39,6 +39,8 @@ import engine.parsers.cache.RuneParser;
import engine.parsers.objects.DeedTemplate;
import engine.parsers.objects.ItemTemplate;
import engine.parsers.objects.RuneTemplate;
import engine.parsers.objects.wpak.PowerActionTemplate;
import engine.parsers.wpak.PowerActionParser;
import engine.powers.RunePowerEntry;
import engine.powers.RuneSkillAdjustEntry;
import engine.server.MBServerStatics;
@@ -334,6 +336,14 @@ public class WorldServer {
Logger.info("Indexing Cache Templates");
CObjectIndex.build();
Logger.info("Loading Power Actions");
PowerActionTemplate._powerActions = PowerActionParser.parsePowerActionsFile();
if (PowerActionTemplate._powerActions == null || PowerActionTemplate._powerActions.isEmpty()) {
Logger.error("ABORT! Power actions failed to load!");
exit(1);
}
Logger.info("Loading PromotionClasses");
PromotionClass.LoadAllPromotions();