Advertisement
ulysseh

King of Dragon Pass savegame binary template

Nov 8th, 2012
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 22.40 KB | None | 0 0
  1. BigEndian(); BitfieldRightToLeft();
  2. enum <byte> BOOL { False, True=0xFF};
  3. local int i = 0;
  4.  
  5. ////////////////////////////////////////////////////////////////STR////////////////////////////////////////////////////////////////
  6. typedef struct {
  7. SetForeColor(cPurple);
  8.     short len;
  9. SetForeColor(cDkPurple);
  10.     local int64 pos = FTell();
  11.     if (len) uchar Str[len];
  12. SetForeColor(cNone);
  13. } STR <read=STRread, write=STRwrite>;
  14.  
  15. ////////////////////////////////////////////////////////////////ARRAY////////////////////////////////////////////////////////////////
  16. typedef struct { local int64 pos = FTell();
  17. SetForeColor(cWhite);
  18.     short ct;
  19. SetForeColor(cDkBlue);
  20.     if (ct) short Int[ct] <format=hex>;
  21. SetForeColor(cNone);
  22. } ARRAY <optimize=false, read=ARRAYread>;
  23.  
  24. ////////////////////////////////////////////////////////////////POP////////////////////////////////////////////////////////////////
  25. typedef struct { short Healthy, Absent, Sick, Wounded; } POP <read=POPread>;
  26.  
  27. ////////////////////////////////////////////////////////////////GODS////////////////////////////////////////////////////////////////
  28. typedef struct {    local int64 pos = FTell();
  29.     long :1,                Ancestors   :1, ArganArgar:1,   Barntar     :1, ChalanaArroy:1, Elmal       :1, Ernalda :1, Eurmal  :1,
  30.         Humakt      :1, Issaries    :1, KeroFin     :1, LhankorMhy:1,   Malia               :1, MaranGor:1, Odayla  :1, Orlanth :1,
  31.         TarardRiel:1,   Uralda      :1, Urox            :1, Vinga           :1, WindSpirits :1;
  32. } GODS <read=GODSread>;
  33.  
  34. ////////////////////////////////////////////////////////////////RAID////////////////////////////////////////////////////////////////
  35. typedef struct {
  36.     typedef short CLANIDX <read=CLANIDXread>;
  37.     CLANIDX ClanIdx;
  38.     enum <short> { Cattle=0xFFF7, Battle=0xFFFC } Type <format=hex>;
  39.     typedef short DATE <read=DATEread>;
  40.     DATE Date;
  41.     enum <short> { disengaged, win_caught, loss_stole=0xFFFF } Result <format=hex>;
  42. } RAID <read=RAIDread>;
  43.  
  44. ////////////////////////////////////////////////////////////////BALANCE////////////////////////////////////////////////////////////////
  45. enum <short> BALANCE { War, Balanced, Peace };
  46.  
  47. ////////////////////////////////////////////////////////////////TRAIT////////////////////////////////////////////////////////////////
  48. typedef struct {    local int64 pos = FTell();
  49. // Trait=sure, trait=not sure about the name, _trait=not sure at all
  50.     long AntiAldryami:1, AntiUndead:1,
  51.         _bully:1, //bully? ;war: raid feuding neighbours; diplo: we can survive alone; reorg: the ring needs me; die in rage trifles
  52.         _Courageous:1, //dictatorial, tribute: contest; kallyr: toast; reorg: the ring needs me; die great adventure
  53.         _confident:1, //reorg: I can...; die surprised longevity
  54.         Coward:1, //tribute: avoid contest; trade: fear of ambush; magic: nervous of gods; die lost heart; blackspear search: must give blessing
  55.         _17:1, //forgetful? Illator: reminds...sorry
  56.         critical:1, //die admit enjoy; Einarth: anti-tribe; offend king event?
  57.  
  58.         crybaby:1, //tribute: can't win contest; die foolish worry; Robarth: this is my fault; farm: "we failed our ppl"
  59.         _22:1, //daring?; Einarth: new isn't bad
  60.         _23:1, //cites lore?
  61.         _24:1,
  62.         Matriarchal:1, mindless:1, //say crazy things, proverbial
  63.         Miserly:1, Patriarchal:1,
  64.  
  65.         peaceful:1, //peaceful? skull: trade to foster harmony
  66.         Pious:1, Poet:1, pragmatic:1, //tribute: don't threaten; die no trouble
  67.         ProDragonewt:1, Proverbial:1,
  68.         royal:1, //royal? diplo: gift neighbours to form tribe; trade: less trade, go explore (per omens); tribute: if break vow>disastrous; Einarth: hurry!
  69.         Spendthrift:1,
  70.  
  71.         _scornful:1, //stupid? spiteful? stubborn?;lousy XXX!; tribute: "whatever"
  72.         _42:1, //blackspear search: if bless->all go->forbid
  73.         _43:1, //spiritual?; alliance: worship; magic: build more temple
  74.         told:1, //"told you..."; war: "told you XXX were gonna raid us!"
  75.         _trader:1, //trade: more treasure
  76.         _tribelike:1, //alliance: tribe
  77.         warmonger:1, //die outlive enemy; clan: reorg as war clan; surprise feud event
  78.         _48:1;
  79. //duck attitude? literate? impious? //magic?
  80. } TRAIT <read=TRAITread>;
  81.  
  82. string TRAITread (TRAIT &t) { string s;
  83.     if (t.AntiAldryami) s += "·xA";    if (t.AntiUndead) s += "·xU";
  84.     if (t._bully) s += "·?bul";            if (t._Courageous) s += "·?crg";
  85.     if (t._confident) s += "·cf";      if (t.Coward) s += "·Cw";
  86.     if (t._17) s += "·17";                 if (t.critical) s += "·?crt";
  87.  
  88.     if (t.crybaby) s += "·?cry";       if (t._22) s += "·22";
  89.     if (t._23) s += "·23";                 if (t._24) s += "·24";
  90.     if (t.Matriarchal) s += "·Ma"; if (t.mindless) s += "·Md";
  91.     if (t.Miserly) s += "·Ms";         if (t.Patriarchal) s += "·Pa";
  92.  
  93.     if (t.peaceful) s += "·Pc";            if (t.Pious) s += "·Pi";
  94.     if (t.Poet) s += "·Pt";                    if (t.pragmatic) s += "·Pg";
  95.     if (t.ProDragonewt) s += "·oD";    if (t.Proverbial) s += "·Pv";
  96.     if (t.royal) s += "·R";                    if (t.Spendthrift) s += "·Sp";
  97.  
  98.     if (t._scornful) s += "·?sc";      if (t._42) s += "·42";
  99.     if (t._43) s += "·?tmpl";                  if (t.told) s += "·to";
  100.     if (t._trader) s += "·?trd";       if (t._tribelike) s += "·?trb";
  101.     if (t.warmonger) s += "·W";            if (t._48) s += "·48";
  102.     return s = SubStr(s, 1);
  103. }
  104.  
  105. ////////////////////////////////////////////////////////////////LEADER////////////////////////////////////////////////////////////////
  106. typedef struct {
  107. SetBackColor(cDkGray);
  108.     short Age;
  109. SetBackColor(cLtPurple);
  110.     CLANIDX ClanIdx;
  111.     enum <short> { Male=1, Female } Gender;
  112.     short TurnsUnavailable; //gone from tula or other reasons, cannot work
  113.     BOOL Heroic; //GoodNews "heroic level"
  114.     enum <short> { Home, emissary, explorer=13, caravan=16, enthralled=18, Dead } Location; //enthralled by horsespawn
  115.     STR Name;
  116.     char Picture[12];
  117.     GODS Religion;
  118.     short Seat, Sick;
  119.     typedef struct { SetForeColor(cDkBlue); LittleEndian();
  120.         double Animals, Bargaining, Combat, Custom, Leadership, Magic, Plant;
  121.         BigEndian(); } SKILLS <read=SKILLSread>;
  122.     SKILLS Skills;
  123.     enum <short> { Alive, Dead_tmp1, Dead_tmp2, Dead_perm } State;
  124. SetBackColor(cDkRed);
  125.     TRAIT Trait;
  126. SetBackColor(cLtPurple);
  127.     enum <short> { craft=1, farm, heal, hunter, law, magic, noble, trader, trick, war } Type;
  128.     short Wounded, YearsOnRing;
  129. } LEADER <optimize=false, read=LEADERread, write=LEADERwrite>;
  130.  
  131. ////////////////////////////////////////////////////////////////RITUAL////////////////////////////////////////////////////////////////
  132. typedef struct {
  133.     struct { byte Divinition,           Protection,         SummonsOfEvil,  _,                                  _;                  } Ancestors;
  134.     struct { byte _,                            _,                          _,                          _,                                  _;                  } ArganArgar;
  135.     struct { byte Plowsong,             Vigor,                  _,                          _,                                  _;                  } Barntar;
  136.     struct { byte Curing,                   Healing,                Resurrection,       Hope,                               Mysteries;  } ChalanaArroy;
  137.     struct { byte Horsefriend,      Shield,                 Steadfast,          Sun,                                Mysteries;  } Elmal;
  138.     struct { byte BlessChildren,    BlessCrops,         Preserve,               SwineBlessing,          Mysteries;  } Ernalda;
  139.     struct { byte Bless,                    Curse,                  _,                          _,                                  _;                  } Eurmal;
  140.     struct { byte BattleLuck,           Morale,                 Oath,                       Truesword,                  Mysteries;  } Humakt;
  141.     struct { byte Silvertongue,     Market,                 SpareGrain,         Trading,                        Mysteries;  } Issaries;
  142.     struct { byte MaternalWard,     _,                          _,                          _,                                  _;                  } KeroFin;
  143.     struct { byte Divination,           ClanLore,               LawSpeaker,         Literacy,                       Mysteries;  } LhankorMhy;
  144.     struct { byte Curing,                   CausePlague,        Immunity,               _,                                  _;                  } Malia;
  145.     struct { byte BlastEarth,           Earthblood,         _,                          _,                                  _;                  } MaranGor;
  146.     struct { byte SureShot,             Tracking,               FriendOfYinkin, _,                                  _;                  } Odayla;
  147.     struct { byte Lightning,            Rain,                       Thunderstone,       Woad,                               Mysteries;  } Orlanth;
  148.     struct { byte Watchfulness,     _,                          _,                          _,                                  _;                  } TarardRiel;
  149.     struct { byte CalfBlessing,     MilkBlessing,       _,                          _,                                  Mysteries;  } Uralda;
  150.     struct { byte Berserker,            SenseChaos,         SmiteChaos,         _,                                  _;                  } Urox;
  151.     struct { byte Fyrdwomen,            Pathfinder,         _,                          _,                                  _;                  } Vinga;
  152.     struct { byte _,                            ListeningWind,  SeeingWind,         UnderstandingWind,  _;                  } WindSpirits;
  153. } RITUAL <optimize=false>;
  154.  
  155. //////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
  156. ////////////////////////////////////////////////////////////////HEADER////////////////////////////////////////////////////////////////
  157. //////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
  158. struct {
  159.     char Opal[4];
  160.     byte __, __, __, __, __, __, __, __;
  161.     short Omens, //Omens or seed?
  162.         __;
  163.     enum <short> { Short=1, Long } Length;
  164.     DATE Date;
  165.     short Harvest; //1 to 7
  166. } Header;
  167.  
  168. ////////////////////////////////////////////////////////////////VARS////////////////////////////////////////////////////////////////
  169. local int VarIdx = 0;
  170. struct {
  171. SetForeColor(cWhite);
  172.     short ct;
  173.     typedef struct {
  174.         local int Idx = VarIdx++;
  175. SetForeColor(cBlue);
  176.         enum <short> { Leader=0x7FF2, clan, tribe, treasure, leaders=0x7FFA, clans, tribes, treasures, neg=0xFFFF } Class <format=hex>;
  177. SetForeColor(cGray);
  178.         short Value, Short;
  179.         BOOL Bool;
  180.         STR String;
  181.     } VAR <optimize=false, read=VARread>;
  182.     VAR Var[ct];
  183. } Vars;
  184.  
  185. ////////////////////////////////////////////////////////////////MAP////////////////////////////////////////////////////////////////
  186. SetBackColor(cLtYellow);
  187. struct { struct { BOOL Hex[27]; } Row[32]; } Map;
  188.  
  189. ////////////////////////////////////////////////////////////////TREASURES////////////////////////////////////////////////////////////////
  190. SetBackColor(cNone);
  191. struct {
  192.     short Total;
  193.     i = 1;
  194.     typedef struct {
  195.         local int Idx = i++;
  196.         short Qt;
  197.     } ONSALE <optimize=false, read=ONSALEread, write=ONSALEwrite>;
  198.     ONSALE OnSale[120];
  199. } Treasures;
  200.  
  201. ////////////////////////////////////////////////////////////////ARRAYS////////////////////////////////////////////////////////////////
  202. struct { ARRAY Array[12]; } __arrays; //randomized at gamestart, all empty arrays for Tutorial and Opal
  203.  
  204. ////////////////////////////////////////////////////////////////LEADERNAMES////////////////////////////////////////////////////////////////
  205. struct { i = 0;
  206.     short females;
  207.     typedef struct { local int Idx = i++; short Used; } FEMALE <optimize=false, read=FEMALEread>;
  208.     if (females) FEMALE Female[females];
  209.     short males;
  210.     typedef struct { local int Idx = i++ - females; short Used; } MALE <optimize=false, read=MALEread>;
  211.     if (males) MALE Male[males];
  212. } LeaderNames;
  213.  
  214. ////////////////////////////////////////////////////////////////CLANS////////////////////////////////////////////////////////////////
  215. struct {
  216. SetBackColor(cLtBlue);
  217.     short ct;
  218. SetForeColor(cNone);
  219. ////////////////////////////////////////////////////////////////CLAN A-L////////////////////////////////////////////////////////////////
  220.     typedef struct {
  221. SetBackColor(cLtBlue);
  222.         struct {
  223.             BOOL __Exists;
  224. SetForeColor(cDkGreen);
  225.             short __xAB; //short, alternates 1/0 from the first clan
  226. SetForeColor(cNone);
  227.             short Barley;
  228.             BOOL BasicClan; //True for the starting 26 human clans
  229.             short Cattle;
  230.             typedef struct { enum <short> { low=1, mid, high, pc=0xCDCD } ChiefDaring, ChiefGenerosity, ChiefGuile, ChiefPiety; } CHIEF <read=CHIEFread>;
  231.             CHIEF Chief;
  232.             typedef struct { short Children[15]; } CHILDREN <read=CHILDRENread>;
  233.             CHILDREN Children;
  234.             enum <short> { Player, Orlanthi, Foreigner } ClanClass; //guessed, affects whether borders are displayed on map
  235.             CLANIDX ClanIdx;
  236.             BALANCE ClanType;
  237.             POP Crafters;
  238.             short Cropland;
  239.             enum <short> { possible, failed, joined } TribeForm;
  240.             STR Description;
  241.             POP Farmers;
  242.             short Food;
  243.             struct { short Ditch:1, Hillfort:1, Ramparts:1, StakePerimeter:1, WoodenStockade:1, StoneWall:1, WatchTower:1, ImprovedStoneWall:1; } Fortifications;
  244.             short Goods;
  245.             GODS GreatTemples;
  246.             short Harvest;
  247. SetForeColor(cDkGreen);
  248.             short __xH; //is short
  249. SetForeColor(cNone);
  250.             short Horses;
  251.             POP Housecarls; //Weaponthanes; //Housecarls
  252.             POP Hunters;
  253. SetForeColor(cDkGreen);
  254.             short __xHI[20]; //short
  255. SetForeColor(cNone);
  256.             short InnerPatrol, KingIdx, KingshipReputation;
  257. SetForeColor(cDkGreen);
  258.             short __xKL1; //short
  259.             byte __xKL2[10]; //byte
  260. SetForeColor(cNone);
  261.             struct { RAID LastRaided, LastRaidedBy; } LastRaids;
  262. SetForeColor(cDkGreen);
  263.             short __xL; //LastPeace? 2=marriage alliance, 3=beaten/warned, decreases over time
  264.         } AtoL;
  265.    
  266. ////////////////////////////////////////////////////////////////LEADERS////////////////////////////////////////////////////////////////
  267.         struct { SetBackColor(cNone);
  268.             short ct;
  269.             if (ct) LEADER Leader[ct];
  270.         } Leaders;
  271.    
  272. ////////////////////////////////////////////////////////////////DATA M-R////////////////////////////////////////////////////////////////
  273.         struct {
  274. SetBackColor(cLtAqua);
  275.             short MaranGorEarthblood;
  276.             struct { byte Children, Crops, Diplomacy, Health, Herds, Hunting, Mysteries, Quests, Trade, War, Destiny, Heroism; } Magics;
  277.             enum <short> { Ancestors=1, ArganArgar, Barntar, ChalanaArroy, Elmal, Ernalda, Eurmal, Humakt, Issaries, KeroFin, LhankorMhy, Malia, MaranGor, Odayla, Orlanth, TarardRiel, Uralda, Urox, Vinga, WindSpirits } MainDeity;
  278.             struct { short Clan, Farmer, Warrior; } Mood;
  279.             STR Name;
  280.             POP Nobles;
  281. SetForeColor(cDkGreen);
  282.             short __xNO; //short
  283. SetForeColor(cNone);
  284.             short OuterPatrol, Pasture, Pigs;
  285.             struct { short Farmers, Oxen; } Planted;
  286.             BOOL PlayerHasThralls;
  287.             STR Plural;
  288.             short PowerPointsMagic;
  289.             struct { enum <byte> { disabled=0xFF } Plain, Fancy, Amulets, Gems, Greenware, Iron, Ivory; } Production;
  290.             GODS Protection; //sacrifice to Chalana->toggles Malia
  291.             struct {
  292.                 struct RAIDS {
  293.                     short ct;
  294.                     if (ct) RAID Raid[ct];
  295.                 } Raided;
  296.                 RAIDS RaidedBy;
  297.             } Raids;
  298.             short __VictoryScore; //increase over time?  increase per raid?
  299.         } MtoR;
  300.    
  301. ////////////////////////////////////////////////////////////////RELATIONS////////////////////////////////////////////////////////////////
  302. SetBackColor(cLtYellow);
  303.         struct {
  304.             short ct;
  305.             typedef struct {
  306.                 CLANIDX ClanIdx;
  307.                 short Attitude, __always0, FavorsDueUs, Alliance, Feud;
  308.                 BOOL Trade, Near, Neighbour; //Near=canRaid (N), Neighbour=canSeize
  309.                 short __SlightsTribal,
  310.                     TimesRaidedBy, //negative
  311.                     __, TimesRaided, __, Slights;
  312.                 struct { short __wePayTribute, Cattle, Food, Goods; } Tribute;
  313.                 short __FavorsTribal,
  314.                     __Flag; //changes whether a clan is displayed
  315.             } RELATION <optimize=false, read=RELATIONread, write=RELATIONwrite>;
  316.             if (ct) RELATION Relation[ct];
  317.         } Relations;
  318. SetBackColor(cNone);
  319.    
  320. ////////////////////////////////////////////////////////////////DATA R-W////////////////////////////////////////////////////////////////
  321.     i = 0;
  322.         struct {
  323. SetColor(cNone,cLtAqua);
  324.             short RingMemberIdx[7];
  325.             BOOL RoyalClan;
  326.             short __RoyalJealousy, //=1 upon Einarth Milk-Eyes prophecy, =1/2 upon new npc tribes formation, =0 upon moot for new king
  327.                 Rye;
  328.             struct { RITUAL Sacrifice, Known; } Rituals;
  329.             struct { byte Ancestors, ArganArgar, Barntar, ChalanaArroy, Elmal, Ernalda, Eurmal, Humakt, Issaries, KeroFin, LhankorMhy, Malia, MaranGor, Odayla, Orlanth, TarardRiel, Uralda, Urox, Vinga, WindSpirits; } Sacrificed;
  330.             short Sheep;
  331.             GODS Shrines;
  332.             short __shrine__; //shorts
  333.             short __shrine__; //shorts
  334. SetColor(cNone,cLtGreen);
  335.             RITUAL ShrinePermanent;
  336. SetColor(cNone,cLtAqua);
  337.             GODS Temples;
  338.             POP Thralls;
  339.             BOOL ThrallsOkay;
  340.             struct { i = 1;
  341.                 short ct;
  342.                 typedef struct { local int Idx = i++; short Qt, WearerIdx; } TREASURE <optimize=false, read=TREASUREread, write=TREASUREwrite>;
  343.                 if (ct) TREASURE Treasure[ct];
  344.             } Treasures;
  345.             short TribeIdx,
  346.                 __xTW,
  347.                 Wildlands, Wheat;
  348.         } RtoW;
  349. local int x; local string s;
  350. x = AtoL.__xH;
  351. if (x != 0) { s = SPrintf(s, "%i %s:    xH = %i \n", AtoL.ClanIdx, SubStr(MtoR.Name.Str, 0, MtoR.Name.len), x); Printf("%s", s); }
  352. x = AtoL.__xKL1;
  353. if (x != 0) { s = SPrintf(s, "%i %s:    xKL1 = %i \n", AtoL.ClanIdx, SubStr(MtoR.Name.Str, 0, MtoR.Name.len), x); Printf("%s", s); }
  354. x = AtoL.__xL;
  355. if (x != -1) { s = SPrintf(s, "%i %s:   xL = %i \n", AtoL.ClanIdx, SubStr(MtoR.Name.Str, 0, MtoR.Name.len), x); Printf("%s", s); }
  356. x = MtoR.__xNO;
  357. if (x != 0) { s = SPrintf(s, "%i %s:    xNO = %i \n", AtoL.ClanIdx, SubStr(MtoR.Name.Str, 0, MtoR.Name.len), x); Printf("%s", s); }
  358. x = RtoW.__shrine__[0];
  359. if (x != 0) { s = SPrintf(s, "%i %s:    shrine0 = %i \n", AtoL.ClanIdx, SubStr(MtoR.Name.Str, 0, MtoR.Name.len), x); Printf("%s", s); }
  360. x = RtoW.__shrine__[1];
  361. if (x != 0) { s = SPrintf(s, "%i %s:    shrine1 = %i (%X)\n", AtoL.ClanIdx, SubStr(MtoR.Name.Str, 0, MtoR.Name.len), x, x); Printf("%s", s); }
  362. x = RtoW.__RoyalJealousy;
  363. if (x != 0) { s = SPrintf(s, "%i %s:    RoyalJealousy = %i \n", AtoL.ClanIdx, SubStr(MtoR.Name.Str, 0, MtoR.Name.len), x); Printf("%s", s); }
  364. //local string s = SPrintf(s, "%s = %d\n", MtoR.Name.Str, AtoL.__xBC); Printf("%s",s);
  365.         ARRAY Zones; //display only
  366. ////////////////////////////////////////////////////////////////HISTORY////////////////////////////////////////////////////////////////
  367.         if (AtoL.ClanIdx==1) struct { //all data lengths confirmed
  368. SetBackColor(cNone);
  369.             short GoodsProduced;
  370.             enum <short> { ancestors=1, elmal, urox, odayla, ernalda, orlanth, issaries, lhankormhy, chalanaarroy, uralda } Awakened;
  371. SetForeColor(cDkGreen);
  372.             short __, __; //short
  373. SetForeColor(cNone);
  374.             GODS DeitiesKnown;
  375.             enum <short> { Battle_of_Extinguishing_Field=1, Hundred_Day_Hunt, Jesteds_Settlement, Procession_of_Animals, Harnessed_Oxen, Hidden_Place, Marking_Bone, First_Pot, Clan_Making_Dance } EarliestEvent;
  376.             DATE EmissaryLast, ExploreLast;
  377.             BOOL FirstYear;
  378.             struct { short Ate, Produced, Spoilage; } Food;
  379.             BOOL EarthRaided;
  380. SetForeColor(cDkGreen);
  381.             BOOL __bool, __bool;
  382. SetForeColor(cNone);
  383.             DATE LastHunterAssign, LastCarlShortage;
  384.             enum <short> { needed=1, more, lots, huge } LandClaim;
  385.             DATE __LastMission; //last diplo/trade mission, not sure
  386.             short __YearNow; //short
  387.             enum <short> { merits=1, generous, enemies, friends } TribePolicy;
  388. SetForeColor(cDkGreen);
  389.             short __; //short
  390. SetForeColor(cNone);
  391.             short BabiesBorn;
  392.             BALANCE ClanType;
  393. SetForeColor(cDkGreen);
  394.             short __; //short
  395.             DATE __DateLastTrade; //not sure
  396. SetForeColor(cNone);
  397.             BOOL SeaRaided;
  398.             struct { short Cattle,
  399.                 __food, __goods, //both always 0xCDCD, just guessing from context
  400.                 Horses, Pigs, Population, Sheep; } Resources;
  401. SetForeColor(cDkGreen);
  402.             long __long; //long
  403. SetForeColor(cNone);
  404.             DATE LastHeroQuest;
  405.             struct { BOOL ChalanaArroy, Elmal, Ernalda, Humakt, Issaries, LhankorMhy, StormTribe, Orlanth, Uralda; } HeroQuest;
  406. SetForeColor(cDkGreen);
  407.             BOOL __bool;
  408. SetForeColor(cNone);
  409.             short MarketProfit;
  410. SetForeColor(cDkGreen);
  411.             DATE __GameStart;
  412.             short __; //short
  413. SetForeColor(cNone);
  414.             struct { enum <short> { simple=1, full, deeper=4 } HowBegan, SwordStory, Contests, StormAge, StormTribe, Humakt, Issaries, LhankorMhy, Orlanth, JusticeBringer, ChalanaArroy, GreatDarkness, Elmal, Uralda, Ernalda; } Myth;
  415. //local string s = SPrintf(s, "History= %i, %i", __[0], __[2]); Printf(s);
  416.         } History;
  417.     } CLAN <optimize=false, read=CLANread, write=CLANwrite>;
  418.     if (ct) CLAN Clan[ct] <optimize=false>;
  419. } Clans;
  420. SetBackColor(cNone);
  421.  
  422. //////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
  423. struct {
  424.     short __LunarWar, //=0 gamestart, =2 upon Tarsh Illastor recruit event for Lunar war
  425.         __; //=-1 always
  426. } __shorts;
  427.  
  428. ////////////////////////////////////////////////////////////////CLANNAMES////////////////////////////////////////////////////////////////
  429. struct {
  430.     typedef struct { short Name; } CLANNAME <optimize=false, read=CLANNAMEread>;
  431.     struct {
  432.         short ct;
  433.         if (ct) CLANNAME Clan[ct];
  434.     } ClanName;
  435.  
  436.     short count;
  437.     byte __byte[7];
  438.     STR __array;
  439.     struct {
  440.         short ct;
  441.         if (ct) CLANNAME Clan[ct];
  442.     } ClanPlural;
  443. } ClanNames;
  444.  
  445. ////////////////////////////////////////////////////////////////TRIBES////////////////////////////////////////////////////////////////
  446. SetBackColor(cLtRed);
  447.  
  448. struct {
  449.     short ct;
  450.     typedef struct {
  451.         DATE LastElection;
  452.         BOOL __hasKing;
  453.         STR Name;
  454.         CLANIDX RoyalClanIdx;
  455.         short __short; //always0
  456.         struct {
  457.             local int64 pos = FTell();
  458.             short ct;
  459.             if (ct) struct {
  460.                 CLANIDX ClanIdx;
  461.                 DATE DateJoined;
  462.             } Clan[ct];
  463.         } Tulas;
  464.         short __short; //always0
  465.         VAR Var;
  466.     } TRIBE <optimize=false, read=TRIBEread>;
  467.     TRIBE Tribe[ct];
  468. } Tribes;
  469. SetBackColor(cNone);
  470.  
  471. ////////////////////////////////////////////////////////////////?////////////////////////////////////////////////////////////////
  472. //struct {
  473. typedef struct {
  474. SetBackColor(cLtYellow);
  475.     short __[5]; //tribes related? _x1[0]==-1 until tribe formed
  476. } __SHORT <read=SHORTread>;
  477. __SHORT __short_5;
  478. typedef struct {
  479. SetBackColor(cLtPurple);
  480.     BOOL __[53];
  481. } __BOOL <read=BOOLread>;
  482. __BOOL __bool_53;
  483. //SetBackColor(cNone);
  484. //} _static; //always same value at gamestart (not randomized)
  485.  
  486. ////////////////////////////////////////////////////////////////EVENTS////////////////////////////////////////////////////////////////
  487. SetBackColor(cLtBlue);
  488. struct {
  489. SetForeColor(cWhite);
  490.     short ct;
  491. SetForeColor(cNone);
  492.     typedef struct {
  493.         short EventIdx;
  494.         enum <short> { code, _, explore=0xFFF8, trade=0xFFFA, diplo, raid, event=0xFFFE } Mission <format=hex>;
  495.         short Turns, __, LeaderIdx;
  496.         CLANIDX ClanIdx;
  497.         short __;
  498.         struct {
  499.             short Weaponthane, Weaponthane, Fyrd, Cattle, Horses, Goods, Food;
  500.             enum <short> { Slowly=1, Normally, Quickly } Travel;
  501.             short Treasure;
  502.         } Convoy;
  503.         struct {
  504.             short TargetX, TargetY;
  505.             enum <short> { ask_cattle_route=1, ask_food, ask_info, ask_magic, tribute, gift, alliance, peace } Goal;
  506.             enum <short> { Small=1, Medium, Large, Pathfinder=15328 } Caravan;
  507.         } Objective;
  508.     } QUE <optimize=false, read=QUEread, write=QUEwrite>;
  509.     if (ct) QUE Que[ct];
  510.  
  511.     local int EventIdx = 0;
  512.     typedef struct {
  513.         local int Idx = EventIdx++;
  514.         short Value;
  515.     } EVENT <optimize=false, read=EVENTread>;
  516. SetBackColor(cLtGreen);
  517.     struct { EventIdx = 0; EVENT Event[1579]; } Times; //how many times it happened?
  518. SetBackColor(cLtAqua);
  519.     struct { EventIdx = 0; EVENT Event[1579]; } Years; //upon event, usually set to 0x7FFF, -1 per year
  520.  
  521. } Events;
  522.  
  523. ////////////////////////////////////////////////////////////////ZONES////////////////////////////////////////////////////////////
  524. SetBackColor(cLtYellow);
  525. struct {
  526. SetForeColor(cWhite);
  527.     short ct;
  528. SetForeColor(cNone);
  529.     if (ct) short Owner[ct];
  530. SetColor(cNone,cNone);
  531.     char Opal[4];
  532. } Zones;
  533.  
  534. #include "KoDPinc.bt"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement