merged a big patch from belal, unstable on anything but windows 40d16

develop
Petr Mrázek 2009-11-07 21:05:10 +00:00
parent 41475d1918
commit a7bf3595b7
8 changed files with 666 additions and 41 deletions

@ -649,12 +649,98 @@ uint32_t DFHackAPIImpl::InitReadCreatures()
creature_flags2_offset = offset_descriptor->getOffset("creature_flags2"); creature_flags2_offset = offset_descriptor->getOffset("creature_flags2");
creature_first_name_offset = offset_descriptor->getOffset("first_name"); creature_first_name_offset = offset_descriptor->getOffset("first_name");
creature_nick_name_offset = offset_descriptor->getOffset("nick_name"); creature_nick_name_offset = offset_descriptor->getOffset("nick_name");
creature_last_name_offset = offset_descriptor->getOffset("last_name");
creature_custom_profession_offset = offset_descriptor->getOffset("custom_profession");
creature_profession_offset = offset_descriptor->getOffset("creature_profession");
creature_sex_offset = offset_descriptor->getOffset("sex");
creature_id_offset = offset_descriptor->getOffset("id");
creature_squad_name_offset = offset_descriptor->getOffset("squad_name");
creature_squad_leader_id_offset = offset_descriptor->getOffset("squad_leader_id");
creature_money_offset = offset_descriptor->getOffset("money");
creature_current_job_offset = offset_descriptor->getOffset("current_job");
creature_current_job_id_offset = offset_descriptor->getOffset("current_job_id");
creature_strength_offset = offset_descriptor->getOffset("strength");
creature_agility_offset = offset_descriptor->getOffset("agility");
creature_toughness_offset = offset_descriptor->getOffset("toughness");
creature_skills_offset = offset_descriptor->getOffset("skills");
creature_labors_offset = offset_descriptor->getOffset("labors");
creature_happiness_offset = offset_descriptor->getOffset("happiness");
creature_traits_offset = offset_descriptor->getOffset("traits");
assert(creatures && creature_pos_offset && creature_type_offset && assert(creatures && creature_pos_offset && creature_type_offset &&
creature_flags1_offset && creature_flags2_offset && creature_nick_name_offset); creature_flags1_offset && creature_flags2_offset && creature_nick_name_offset
&& creature_custom_profession_offset
&& creature_profession_offset
&& creature_sex_offset
&& creature_id_offset
&& creature_squad_name_offset
&& creature_squad_leader_id_offset
&& creature_money_offset
&& creature_current_job_offset
&& creature_strength_offset
&& creature_agility_offset
&& creature_toughness_offset
&& creature_skills_offset
&& creature_labors_offset
&& creature_happiness_offset
&& creature_traits_offset
);
p_cre = new DfVector(dm->readVector(creatures, 4)); p_cre = new DfVector(dm->readVector(creatures, 4));
InitReadNameTables();
return p_cre->getSize(); return p_cre->getSize();
} }
//This code was mostly adapted fromh dwarftherapist by chmod
string DFHackAPIImpl::getLastName(const uint32_t &index, bool use_generic)
{
string out;
uint32_t wordIndex;
for (int i = 0; i<7;i++)
{
MreadDWord(index+i*4, wordIndex);
if(wordIndex == 0xFFFFFFFF)
{
break;
}
if(use_generic)
{
uint32_t genericPtr;
p_generic->read(wordIndex,(uint8_t *)&genericPtr);
out.append(dm->readSTLString(genericPtr));
}
else
{
uint32_t transPtr;
p_dwarf_names->read(wordIndex,(uint8_t *)&transPtr);
out.append(dm->readSTLString(transPtr));
}
}
return out;
}
string DFHackAPIImpl::getProfession(const uint32_t &index)
{
string profession;
uint8_t profId = MreadByte(index);
profession = offset_descriptor->getProfession(profId);
return profession;
}
string DFHackAPIImpl::getJob(const uint32_t &index)
{
string job;
uint32_t jobIdAddr = MreadDWord(index);
if(jobIdAddr != 0)
{
uint8_t jobId = MreadByte(jobIdAddr+creature_current_job_id_offset);
job = offset_descriptor->getJob(jobId);
}
else
{
job ="No Job";
}
return job;
}
bool DFHackAPIImpl::ReadCreature(const uint32_t &index, t_creature & furball) bool DFHackAPIImpl::ReadCreature(const uint32_t &index, t_creature & furball)
{ {
@ -664,21 +750,70 @@ bool DFHackAPIImpl::ReadCreature(const uint32_t &index, t_creature & furball)
p_cre->read(index,(uint8_t *)&temp); p_cre->read(index,(uint8_t *)&temp);
//read creature from memory //read creature from memory
Mread(temp + creature_pos_offset, 3 * sizeof(uint16_t), (uint8_t *) &(furball.x)); // xyz really Mread(temp + creature_pos_offset, 3 * sizeof(uint16_t), (uint8_t *) &(furball.x)); // xyz really
Mread(temp + creature_type_offset, sizeof(uint32_t), (uint8_t *) &furball.type); MreadDWord(temp + creature_type_offset, furball.type);
Mread(temp + creature_flags1_offset, sizeof(uint32_t), (uint8_t *) &furball.flags1); MreadDWord(temp + creature_flags1_offset, furball.flags1.whole);
Mread(temp + creature_flags2_offset, sizeof(uint32_t), (uint8_t *) &furball.flags2); MreadDWord(temp + creature_flags2_offset, furball.flags2.whole);
// names. // names
furball.first_name = dm->readSTLString(temp+creature_first_name_offset); furball.first_name = dm->readSTLString(temp+creature_first_name_offset);
furball.nick_name = dm->readSTLString(temp+creature_nick_name_offset); furball.nick_name = dm->readSTLString(temp+creature_nick_name_offset);
furball.trans_name = getLastName(temp+creature_last_name_offset);
furball.generic_name = getLastName(temp+creature_last_name_offset,true);
furball.custom_profession = dm->readSTLString(temp+creature_custom_profession_offset);
furball.profession = getProfession(temp+creature_profession_offset);
furball.current_job = getJob(temp+creature_current_job_offset);
MreadDWord(temp + creature_happiness_offset, furball.happiness);
MreadDWord(temp + creature_id_offset, furball.id);
MreadDWord(temp + creature_agility_offset, furball.agility);
MreadDWord(temp + creature_strength_offset, furball.strength);
MreadDWord(temp + creature_toughness_offset, furball.toughness);
MreadDWord(temp + creature_money_offset, furball.money);
MreadDWord(temp + creature_squad_leader_id_offset, furball.squad_leader_id);
MreadByte(temp + creature_sex_offset, furball.sex);
return true; return true;
} }
void DFHackAPIImpl::InitReadNameTables()
{
int genericAddress = offset_descriptor->getAddress("language_vector");
int transAddress = offset_descriptor->getAddress("translation_vector");
int word_table_offset = offset_descriptor->getOffset("word_table");
p_generic = new DfVector(dm->readVector(genericAddress, 4));
p_trans = new DfVector(dm->readVector(transAddress, 4));
uint32_t dwarf_entry = 0;
for(uint32_t i = 0; i < p_trans->getSize();i++)
{
uint32_t namePtr;
p_trans->read(i,(uint8_t *)&namePtr);
string raceName = dm->readSTLString(namePtr);
if(raceName == "DWARF")
{
dwarf_entry = namePtr;
}
}
dwarf_lang_table_offset = dwarf_entry + word_table_offset-4;
p_dwarf_names = new DfVector(dm->readVector(dwarf_lang_table_offset,4));
nameTablesInited = true;
}
void DFHackAPIImpl::FinishReadNameTables()
{
delete p_trans;
delete p_generic;
p_trans=p_generic=NULL;
nameTablesInited=false;
}
void DFHackAPIImpl::FinishReadCreatures() void DFHackAPIImpl::FinishReadCreatures()
{ {
delete p_cre; delete p_cre;
p_cre = NULL; p_cre = NULL;
creaturesInited = false; creaturesInited = false;
FinishReadNameTables();
} }
bool DFHackAPIImpl::Attach() bool DFHackAPIImpl::Attach()

@ -194,6 +194,26 @@ private:
uint32_t creature_flags2_offset; uint32_t creature_flags2_offset;
uint32_t creature_first_name_offset; uint32_t creature_first_name_offset;
uint32_t creature_nick_name_offset; uint32_t creature_nick_name_offset;
uint32_t creature_last_name_offset;
uint32_t creature_custom_profession_offset;
uint32_t creature_profession_offset;
uint32_t creature_sex_offset;
uint32_t creature_id_offset;
uint32_t creature_squad_name_offset;
uint32_t creature_squad_leader_id_offset;
uint32_t creature_money_offset;
uint32_t creature_current_job_offset;
uint32_t creature_current_job_id_offset;
uint32_t creature_strength_offset;
uint32_t creature_agility_offset;
uint32_t creature_toughness_offset;
uint32_t creature_skills_offset;
uint32_t creature_labors_offset;
uint32_t creature_happiness_offset;
uint32_t creature_traits_offset;
uint32_t dwarf_lang_table_offset;
ProcessManager* pm; ProcessManager* pm;
Process* p; Process* p;
@ -206,12 +226,19 @@ private:
bool buildingsInited; bool buildingsInited;
bool vegetationInited; bool vegetationInited;
bool creaturesInited; bool creaturesInited;
bool nameTablesInited;
uint32_t tree_offset; uint32_t tree_offset;
DfVector *p_cre; DfVector *p_cre;
DfVector *p_cons; DfVector *p_cons;
DfVector *p_bld; DfVector *p_bld;
DfVector *p_veg; DfVector *p_veg;
DfVector *p_trans;
DfVector *p_generic;
DfVector *p_dwarf_names;
public: public:
DFHackAPIImpl(const string path_to_xml); DFHackAPIImpl(const string path_to_xml);
@ -312,6 +339,12 @@ public:
bool ReadCreature(const uint32_t &index, t_creature & furball); bool ReadCreature(const uint32_t &index, t_creature & furball);
void FinishReadCreatures(); void FinishReadCreatures();
void InitReadNameTables();
void FinishReadNameTables();
string getLastName(const uint32_t &index, bool use_generic=false);
string getProfession(const uint32_t &index);
string getJob(const uint32_t &index);
void ReadRaw (const uint32_t &offset, const uint32_t &size, uint8_t *target); void ReadRaw (const uint32_t &offset, const uint32_t &size, uint8_t *target);
}; };

@ -109,6 +109,8 @@ memory_info::memory_info(const memory_info &old)
classes = old.classes; classes = old.classes;
classsubtypes = old.classsubtypes; classsubtypes = old.classsubtypes;
classindex = old.classindex; classindex = old.classindex;
professions = old.professions;
jobs = old.jobs;
} }
@ -156,6 +158,24 @@ void memory_info::setString (string key, string value)
strings[key] = value; strings[key] = value;
} }
void memory_info::setProfession (string key, string value)
{
uint32_t keyInt = strtol(key.c_str(), NULL, 10);
if(professions.size() <= keyInt){
professions.resize(keyInt+1);
}
professions[keyInt] = value;
}
void memory_info::setJob (string key, string value)
{
uint32_t keyInt = strtol(key.c_str(), NULL, 10);
if(jobs.size() <= keyInt){
jobs.resize(keyInt+1);
}
jobs[keyInt] = value;
}
// FIXME: next three methods should use some kind of custom container so it doesn't have to search so much. // FIXME: next three methods should use some kind of custom container so it doesn't have to search so much.
void memory_info::setClass (const char * name, const char * vtable) void memory_info::setClass (const char * name, const char * vtable)
@ -369,6 +389,27 @@ uint32_t memory_info::getHexValue (string key)
return 0; return 0;
} }
// Get Profession
string memory_info::getProfession (uint32_t key)
{
if(professions.size() > key)
{
return professions[key];
}
else{
return string("");
}
}
// Get Job
string memory_info::getJob (uint32_t key)
{
if(jobs.size() > key){
return jobs[key];
}
return string("Job Does Not Exist");
}
// Reset everything // Reset everything
void memory_info::flush() void memory_info::flush()

@ -63,6 +63,8 @@ public:
uint32_t getAddress (string); uint32_t getAddress (string);
uint32_t getHexValue (string); uint32_t getHexValue (string);
string getString (string); string getString (string);
string getProfession(uint32_t);
string getJob(uint32_t);
void setVersion(const char *); void setVersion(const char *);
void setVersion(string); void setVersion(string);
@ -87,6 +89,9 @@ public:
void setHexValue (string, string); void setHexValue (string, string);
void setString (string, string); void setString (string, string);
void setProfession(string, string);
void setJob(string, string);
void RebaseVTable(int32_t offset); void RebaseVTable(int32_t offset);
void setClass (const char * name, const char * vtable); void setClass (const char * name, const char * vtable);
uint32_t setMultiClass (const char * name, const char * vtable, const char * typeoffset); uint32_t setMultiClass (const char * name, const char * vtable, const char * typeoffset);
@ -103,6 +108,10 @@ private:
map <string, uint32_t> offsets; map <string, uint32_t> offsets;
map <string, uint32_t> hexvals; map <string, uint32_t> hexvals;
map <string, string> strings; map <string, string> strings;
vector<string> professions;
vector<string> jobs;
vector<t_class> classes; vector<t_class> classes;
vector<vector<t_type> > classsubtypes; vector<vector<t_type> > classsubtypes;
int32_t base; int32_t base;

@ -437,6 +437,14 @@ void ProcessManager::ParseEntry (TiXmlElement* entry, memory_info& mem, map <str
{ {
mem.setString(name, value); mem.setString(name, value);
} }
else if (type == "Profession")
{
mem.setProfession(value,name);
}
else if (type == "Job")
{
mem.setJob(value,name);
}
else else
{ {
cerr << "Unknown MemInfo type: " << type << endl; cerr << "Unknown MemInfo type: " << type << endl;

@ -390,8 +390,21 @@ struct t_creature
t_creaturflags2 flags2; t_creaturflags2 flags2;
string first_name; string first_name;
string nick_name; string nick_name;
string last_name;
string trans_name;
string generic_name;
string profession;
string custom_profession;
string current_job;
uint32_t happiness;
uint32_t id;
uint32_t agility;
uint32_t strength;
uint32_t toughness;
uint32_t money;
uint32_t squad_leader_id;
uint8_t sex;
}; };
// TODO: research this further? consult DF hacker wizards? // TODO: research this further? consult DF hacker wizards?
union t_designation union t_designation
{ {

@ -35,6 +35,328 @@
<Offset name="occupancy">0x0664</Offset> <Offset name="occupancy">0x0664</Offset>
</Entry>--> </Entry>-->
<Entry version="meta-40d" os="all" id="meta-40d">
<Profession can_assign_labors="true" is_military="false" name="Miner">0</Profession>
<Profession can_assign_labors="true" is_military="false" name="Woodworker">1</Profession>
<Profession can_assign_labors="true" is_military="false" name="Carpenter">2</Profession>
<Profession can_assign_labors="true" is_military="false" name="Bowyer">3</Profession>
<Profession can_assign_labors="true" is_military="false" name="Woodcutter">4</Profession>
<Profession can_assign_labors="true" is_military="false" name="Stoneworker">5</Profession>
<Profession can_assign_labors="true" is_military="false" name="Engraver">6</Profession>
<Profession can_assign_labors="true" is_military="false" name="Mason">7</Profession>
<Profession can_assign_labors="true" is_military="false" name="Ranger">8</Profession>
<Profession can_assign_labors="true" is_military="false" name="Animal Caretaker">9</Profession>
<Profession can_assign_labors="true" is_military="false" name="Animal Trainer">10</Profession>
<Profession can_assign_labors="true" is_military="false" name="Hunter">11</Profession>
<Profession can_assign_labors="true" is_military="false" name="Trapper">12</Profession>
<Profession can_assign_labors="true" is_military="false" name="Animal Dissector">13</Profession>
<Profession can_assign_labors="true" is_military="false" name="Metalsmith">14</Profession>
<Profession can_assign_labors="true" is_military="false" name="Furnace Operator">15</Profession>
<Profession can_assign_labors="true" is_military="false" name="Weaponsmith">16</Profession>
<Profession can_assign_labors="true" is_military="false" name="Armorer">17</Profession>
<Profession can_assign_labors="true" is_military="false" name="Blacksmith">18</Profession>
<Profession can_assign_labors="true" is_military="false" name="Metalcrafter">19</Profession>
<Profession can_assign_labors="true" is_military="false" name="Jeweler">20</Profession>
<Profession can_assign_labors="true" is_military="false" name="Gem Cutter">21</Profession>
<Profession can_assign_labors="true" is_military="false" name="Gem Setter">22</Profession>
<Profession can_assign_labors="true" is_military="false" name="Craftsdwarf">23</Profession>
<Profession can_assign_labors="true" is_military="false" name="Woodcrafter">24</Profession>
<Profession can_assign_labors="true" is_military="false" name="Stonecrafter">25</Profession>
<Profession can_assign_labors="true" is_military="false" name="Leatherworker">26</Profession>
<Profession can_assign_labors="true" is_military="false" name="Bone Carver">27</Profession>
<Profession can_assign_labors="true" is_military="false" name="Weaver">28</Profession>
<Profession can_assign_labors="true" is_military="false" name="Clothier">29</Profession>
<Profession can_assign_labors="true" is_military="false" name="Glassmaker">30</Profession>
<Profession can_assign_labors="true" is_military="false" name="Strand Extractor">31</Profession>
<Profession can_assign_labors="false" female_name="Queen" is_military="false" name="King">32</Profession>
<Profession can_assign_labors="false" female_name="Queen Consort" is_military="false" name="King Consort">33</Profession>
<Profession can_assign_labors="true" is_military="false" name="Fishery Worker">34</Profession>
<Profession can_assign_labors="true" is_military="false" name="Fisherdwarf">35</Profession>
<Profession can_assign_labors="true" is_military="false" name="Fish Dissector">36</Profession>
<Profession can_assign_labors="true" is_military="false" name="Fish Cleaner">37</Profession>
<Profession can_assign_labors="true" is_military="false" name="Farmer">38</Profession>
<Profession can_assign_labors="true" is_military="false" name="Cheese Maker">39</Profession>
<Profession can_assign_labors="true" is_military="false" name="Milker">40</Profession>
<Profession can_assign_labors="true" is_military="false" name="Cook">41</Profession>
<Profession can_assign_labors="true" is_military="false" name="Thresher">42</Profession>
<Profession can_assign_labors="true" is_military="false" name="Miller">43</Profession>
<Profession can_assign_labors="true" is_military="false" name="Butcher">44</Profession>
<Profession can_assign_labors="true" is_military="false" name="Tanner">45</Profession>
<Profession can_assign_labors="true" is_military="false" name="Dyer">46</Profession>
<Profession can_assign_labors="true" is_military="false" name="Planter">47</Profession>
<Profession can_assign_labors="true" is_military="false" name="Herbalist">48</Profession>
<Profession can_assign_labors="true" is_military="false" name="Brewer">49</Profession>
<Profession can_assign_labors="true" is_military="false" name="Soap Maker">50</Profession>
<Profession can_assign_labors="true" is_military="false" name="Potash Maker">51</Profession>
<Profession can_assign_labors="true" is_military="false" name="Lye Maker">52</Profession>
<Profession can_assign_labors="true" is_military="false" name="Wood Burner">53</Profession>
<Profession can_assign_labors="true" is_military="false" name="Engineer">54</Profession>
<Profession can_assign_labors="true" is_military="false" name="Mechanic">55</Profession>
<Profession can_assign_labors="true" is_military="false" name="Siege Engineer">56</Profession>
<Profession can_assign_labors="true" is_military="false" name="Siege Operator">57</Profession>
<Profession can_assign_labors="true" is_military="false" name="Pump Operator">58</Profession>
<Profession can_assign_labors="true" is_military="false" name="Clerk">59</Profession>
<Profession can_assign_labors="true" is_military="false" name="Administrator">60</Profession>
<Profession can_assign_labors="true" is_military="false" name="Trader">61</Profession>
<Profession can_assign_labors="true" is_military="false" name="Architect">62</Profession>
<Profession can_assign_labors="true" is_military="false" name="Alchemist">63</Profession>
<Profession can_assign_labors="false" is_military="false" name="Tax Collector">64</Profession>
<Profession can_assign_labors="false" is_military="false" name="Hammerer">65</Profession>
<Profession can_assign_labors="false" female_name="Baroness" is_military="false" name="Baron">66</Profession>
<Profession can_assign_labors="false" female_name="Countess" is_military="false" name="Count">67</Profession>
<Profession can_assign_labors="false" female_name="Duchess" is_military="false" name="Duke">68</Profession>
<Profession can_assign_labors="false" female_name="Baroness Consort" is_military="false" name="Baron Consort">69</Profession>
<Profession can_assign_labors="false" female_name="Countess Consort" is_military="false" name="Count Consort">70</Profession>
<Profession can_assign_labors="false" female_name="Duchess Consort" is_military="false" name="Duke Consort">71</Profession>
<Profession can_assign_labors="false" is_military="false" name="Philosopher">72</Profession>
<Profession can_assign_labors="false" is_military="false" name="Advisor">73</Profession>
<Profession can_assign_labors="false" is_military="false" name="Dungeon Master">74</Profession>
<Profession can_assign_labors="false" is_military="false" name="Merchant">75</Profession>
<Profession can_assign_labors="false" is_military="false" name="Diplomat">76</Profession>
<Profession can_assign_labors="false" is_military="false" name="Guild Representative">77</Profession>
<Profession can_assign_labors="false" is_military="false" name="Merchant Baroness">78</Profession>
<Profession can_assign_labors="false" is_military="false" name="Merchant Princess">79</Profession>
<Profession can_assign_labors="false" is_military="false" name="Outpost Liaison">80</Profession>
<Profession can_assign_labors="false" is_military="false" name="Druid">81</Profession>
<Profession can_assign_labors="false" is_military="true" name="Champion">82</Profession>
<Profession can_assign_labors="true" is_military="true" name="Hammerdwarf">83</Profession>
<Profession can_assign_labors="false" is_military="true" name="Hammer Lord">84</Profession>
<Profession can_assign_labors="true" is_military="true" name="Speardwarf">85</Profession>
<Profession can_assign_labors="false" is_military="true" name="Spearmaster">86</Profession>
<Profession can_assign_labors="true" is_military="true" name="Marksdwarf">87</Profession>
<Profession can_assign_labors="false" is_military="true" name="Elite Crossbowdwarf">88</Profession>
<Profession can_assign_labors="true" is_military="true" name="Wrestler">89</Profession>
<Profession can_assign_labors="false" is_military="true" name="Elite Wrestler">90</Profession>
<Profession can_assign_labors="true" is_military="true" name="Axedwarf">91</Profession>
<Profession can_assign_labors="false" is_military="true" name="Axe Lord">92</Profession>
<Profession can_assign_labors="true" is_military="true" name="Swordsdwarf">93</Profession>
<Profession can_assign_labors="false" is_military="true" name="Swordmaster">94</Profession>
<Profession can_assign_labors="true" is_military="true" name="Macedwarf">95</Profession>
<Profession can_assign_labors="false" is_military="true" name="Mace Lord">96</Profession>
<Profession can_assign_labors="true" is_military="true" name="Pikedwarf">97</Profession>
<Profession can_assign_labors="false" is_military="true" name="Pikemaster">98</Profession>
<Profession can_assign_labors="false" is_military="true" name="Bowdwarf">99</Profession>
<Profession can_assign_labors="false" is_military="true" name="Elite Bowdwarf">100</Profession>
<Profession can_assign_labors="false" is_military="true" name="Blowgunner">101</Profession>
<Profession can_assign_labors="false" is_military="true" name="Elite Bowgunner">102</Profession>
<Profession can_assign_labors="true" is_military="true" name="Recruit">103</Profession>
<Profession can_assign_labors="false" is_military="false" name="?Hunting creature?">104</Profession>
<Profession name= "?War creature?" can_assign_labors="false" is_military="false">105</Profession>
<Profession name="?Master thief?" can_assign_labors="false" is_military="false">106</Profession>
<Profession name="?Thief?" can_assign_labors="false" is_military="false">107</Profession>
<Profession can_assign_labors="true" is_military="false" name="Peasant">108</Profession>
<Profession can_assign_labors="false" is_military="false" name="Child">109</Profession>
<Profession can_assign_labors="false" is_military="false" name="Baby">110</Profession>
<Profession can_assign_labors="false" is_military="false" name="Drunk">111</Profession>
<Profession can_assign_labors="false" is_military="false" name="Lasher">112</Profession>
<Profession can_assign_labors="false" is_military="false" name="Master Lasher">113</Profession>
<Job name="Carve Fortification">0</Job>
<Job name="Detail Wall">1</Job>
<Job name="Detail Floor">2</Job>
<Job name="Dig">3</Job>
<Job name="Carve Upward Staircase">4</Job>
<Job name="Carve Downward Staircase">5</Job>
<Job name="Carve Up/Down Staircase">6</Job>
<Job name="Carve Ramp">7</Job>
<Job name="Dig Channel">8</Job>
<Job name="Fell Tree">9</Job>
<Job name="Gather Plants">10</Job>
<Job name="Remove Construction">11</Job>
<Job name="Collect Webs">12</Job>
<Job name="Bring Item to Depot">13</Job>
<Job name="Bring Item to Shop">14</Job>
<Job name="Eat">15</Job>
<Job name="Get Provisions">16</Job>
<Job name="Drink">17</Job>
<Job name="Drink">18</Job>
<Job name="Fill Waterskin">19</Job>
<Job name="Sleep">20</Job>
<Job name="Collect Sand">21</Job>
<Job name="Fish">22</Job>
<Job name="Hunt">23</Job>
<Job name="Hunt for Small Creature">24</Job>
<Job name="Kidnap">25</Job>
<Job name="Beat Criminal">26</Job>
<Job name="Starting Fist Fight">27</Job>
<Job name="Collect Taxes">28</Job>
<Job name="Guard Tax Collector">29</Job>
<Job name="Catch Live Land Animal">30</Job>
<Job name="Catch Live Fish">31</Job>
<Job name="Return Kill">32</Job>
<Job name="Check Chest">33</Job>
<Job name="Store Owned Item">34</Job>
<Job name="Place Item in Tomb">35</Job>
<Job name="Store Item in Stockpile">36</Job>
<Job name="Store Item in Bag">37</Job>
<Job name="Store Item in Chest">38</Job>
<Job name="Store Item in Cabinet">39</Job>
<Job name="Store Weapon">40</Job>
<Job name="Store Armor">41</Job>
<Job name="Store Item in Barrel">42</Job>
<Job name="Store Item in Bin">43</Job>
<Job name="Seek Artifact">44</Job>
<Job name="Seek Infant">45</Job>
<Job name="Attend Party">46</Job>
<Job name="Shooting at Archery Range">47</Job>
<Job name="Sparring in Barracks">48</Job>
<Job name="Go Shopping A">49</Job>
<Job name="Go Shopping B">50</Job>
<Job name="Clean">51</Job>
<Job name="Rest">52</Job>
<Job name="Pickup Equipment">53</Job>
<Job name="Dump Item">54</Job>
<Job name="Strange Mood Crafter">55</Job>
<Job name="Strange Mood Jeweller">56</Job>
<Job name="Strange Mood C">57</Job>
<Job name="Strange Mood Metal">58</Job>
<Job name="Strange Mood E">59</Job>
<Job name="Strange Mood F">60</Job>
<Job name="Strange Mood Carpenter">61</Job>
<Job name="Strange Mood Mason">62</Job>
<Job name="Strange Mood Bowyer">63</Job>
<Job name="Strange Mood Tanner">64</Job>
<Job name="Strange Mood Weaver">65</Job>
<Job name="Strange Mood Glassmaker">66</Job>
<Job name="Strange Mood Mechanics">67</Job>
<Job name="Construct Building">68</Job>
<Job name="Construct Door">69</Job>
<Job name="Construct Floodgate">70</Job>
<Job name="Construct Bed">71</Job>
<Job name="Construct Chair">72</Job>
<Job name="Construct Coffin">73</Job>
<Job name="Construct Table">74</Job>
<Job name="Construct Chest">75</Job>
<Job name="Construct Bin">76</Job>
<Job name="Construct Armor Stand">77</Job>
<Job name="Construct Weapon Rack">78</Job>
<Job name="Construct Cabinet">79</Job>
<Job name="Construct Statue">80</Job>
<Job name="Construct XXX">81</Job>
<Job name="Make Raw XXX">82</Job>
<Job name="Make crafts">83</Job>
<Job name="Mint stuff">84</Job>
<Job name="Cut XX A">85</Job>
<Job name="Cut XX B">86</Job>
<Job name="Encrust">87</Job>
<Job name="?">88</Job>
<Job name="Destroy Building">89</Job>
<Job name="Smelt Ore">90</Job>
<Job name="Smelt">91</Job>
<Job name="Melt a Metal Object">92</Job>
<Job name="Extract Metal Strands">93</Job>
<Job name="Tan a Hide">94</Job>
<Job name="Plant Seeds">95</Job>
<Job name="Harvest Plants">96</Job>
<Job name="Train Hunting Animal">97</Job>
<Job name="Train War Animal">98</Job>
<Job name="Forge/Make DDD ">99</Job>
<Job name="Forge Anvil">100</Job>
<Job name="Construct Catapult Parts">101</Job>
<Job name="Construct Ballista Parts">102</Job>
<Job name="Forge/Make A">103</Job>
<Job name="Forge/Make B">104</Job>
<Job name="Forge/Make C">105</Job>
<Job name="Stud With XX">106</Job>
<Job name="Butcher an Animal">107</Job>
<Job name="Prepare a Raw Fish">108</Job>
<Job name="Mill Plants">109</Job>
<Job name="Bait Trap">110</Job>
<Job name="Milk Creature">111</Job>
<Job name="Make Cheese">112</Job>
<Job name="Process Plants">113</Job>
<Job name="Process Plants (Bag)">114</Job>
<Job name="Process Plants (Vial)">115</Job>
<Job name="Process Plants (Barrel)">116</Job>
<Job name="Prepare Meal">117</Job>
<Job name="Weave Thread">118</Job>
<Job name="Forge/Make D">119</Job>
<Job name="Forge/Make E">120</Job>
<Job name="Forge/Make F">121</Job>
<Job name="Forge Cage">122</Job>
<Job name="Forge Rope">123</Job>
<Job name="Forge Flask">124</Job>
<Job name="Forge Goblet">125</Job>
<Job name="Forge Instrument">126</Job>
<Job name="Forge Toy">127</Job>
<Job name="Forge Animal Trap">128</Job>
<Job name="Forge Barrel">129</Job>
<Job name="Forge Bucket">130</Job>
<Job name="Forge Window">131</Job>
<Job name="Make Totem">132</Job>
<Job name="Forge/Make G">133</Job>
<Job name="Decorate With Bone">134</Job>
<Job name="Make Backpack">135</Job>
<Job name="Make Quiver">136</Job>
<Job name="Forge Ballista Arrow Head">137</Job>
<Job name="Assemble">138</Job>
<Job name="Load Catapult">139</Job>
<Job name="Load Ballista">140</Job>
<Job name="Fire Catapult">141</Job>
<Job name="Fire Ballista">142</Job>
<Job name="Construct Mechanisms">143</Job>
<Job name="Forge/Make H">144</Job>
<Job name="Load Cage Trap">145</Job>
<Job name="Load Stone Trap">146</Job>
<Job name="Load Weapon Trap">147</Job>
<Job name="Clean Trap">148</Job>
<Job name="Cast Spell">149</Job>
<Job name="Link a Building to Trigger">150</Job>
<Job name="Pull the Lever">151</Job>
<Job name="Brew Drink">152</Job>
<Job name="?">153</Job>
<Job name="Extract from Plants">154</Job>
<Job name="Extract from Raw Fish">155</Job>
<Job name="Extract from Land Animal">156</Job>
<Job name="Tame a Small Animal">157</Job>
<Job name="Tame Large Animal">158</Job>
<Job name="Chain Animal">159</Job>
<Job name="Unchain Animal">160</Job>
<Job name="Unchain Pet">161</Job>
<Job name="Releasing Large Creature">162</Job>
<Job name="Releasing Pet">163</Job>
<Job name="Releasing Small Creature">164</Job>
<Job name="Handling Small Creature">165</Job>
<Job name="Handling Large Creature">166</Job>
<Job name="Large Creature Caging">167</Job>
<Job name="Small Creature Caging">168</Job>
<Job name="Recover Wounded">169</Job>
<Job name="Drain Aquarium">170</Job>
<Job name="Fill Aquarium">171</Job>
<Job name="Fill Pond">172</Job>
<Job name="Give Water A">173</Job>
<Job name="Give Food A">174</Job>
<Job name="Give Water B">175</Job>
<Job name="Give Food B">176</Job>
<Job name="Recover Pet">177</Job>
<Job name="Pit/Pond Large Animal">178</Job>
<Job name="Pit/Pond Small Animal">179</Job>
<Job name="Slaughter Animal">180</Job>
<Job name="Make Charcoal">181</Job>
<Job name="Make Ash">182</Job>
<Job name="Make Lye">183</Job>
<Job name="Make Potash From Lye">184</Job>
<Job name="Make Pearlash">185</Job>
<Job name="Render Fat">186</Job>
<Job name="Make Soap">187</Job>
<Job name="Fertilize Field">188</Job>
<Job name="Make Potash From Ash">189</Job>
<Job name="Dye Thread">190</Job>
<Job name="Dye Cloth">191</Job>
<Job name="Sew Image">192</Job>
<Job name="Forge Tube">193</Job>
<Job name="Operate Pump">194</Job>
<Job name="Manage Work Orders">195</Job>
<Job name="Update Stockpile Records">196</Job>
<Job name="Trade at Depot">197</Job>
<Job name="Construct Hatch Cover">198</Job>
<Job name="Construct Grate">199</Job>
<Job name="Remove Stairs/Ramps">200</Job>
<Job name="Construct Quern">201</Job>
<Job name="Construct Millstone">202</Job>
</Entry>
.,:rsr, .,:rsr,
:2;,;r2A@@5 :2;,;r2A@@5
@2::s5A#@@@ @r. . @2::s5A#@@@ @r. .
@ -55,7 +377,7 @@
and and
W I N E W I N E
<Entry version="v0.28.181.40d" os="windows" id="40dwin"> <Entry version="v0.28.181.40d" os="windows" id="40dwin" base="meta-40d">
<!-- identification --> <!-- identification -->
<HexValue name="pe_timestamp">0x48C330DF</HexValue> <HexValue name="pe_timestamp">0x48C330DF</HexValue>
<String name="md5">2c686c26307dcccd7c36cc79737ebe4f</String> <String name="md5">2c686c26307dcccd7c36cc79737ebe4f</String>
@ -93,6 +415,24 @@
<Offset name="creature_type">0x8C</Offset> <Offset name="creature_type">0x8C</Offset>
<Offset name="creature_flags1">0xE4</Offset> <Offset name="creature_flags1">0xE4</Offset>
<Offset name="creature_flags2">0xE8</Offset> <Offset name="creature_flags2">0xE8</Offset>
<Offset name="custom_profession">0x6c</Offset>
<Offset name="profession">0x88</Offset>
<Offset name="race">0x8C</Offset>
<Offset name="flags1">0xFC</Offset>
<Offset name="flags2">0x100</Offset>
<Offset name="sex">0x10A</Offset>
<Offset name="id">0x10C</Offset>
<Offset name="squad_name">0x1D8</Offset>
<Offset name="squad_leader_id">0x268</Offset>
<Offset name="money">0x2F8</Offset>
<Offset name="current_job">0x314</Offset>
<Offset name="strength">0x4f0</Offset>
<Offset name="agility">0x4f4</Offset>
<Offset name="toughness">0x4f8</Offset>
<Offset name="skills">0x504</Offset>
<Offset name="labors">0x544</Offset>
<Offset name="happiness">0x610</Offset>
<Offset name="traits">0x700</Offset>
<!-- tree and shrub offsets --> <!-- tree and shrub offsets -->
<Offset name="tree_desc_offset">0x70</Offset> <Offset name="tree_desc_offset">0x70</Offset>
@ -310,6 +650,7 @@
<Address name="matgloss">0x015FCE3C</Address> <Address name="matgloss">0x015FCE3C</Address>
<!-- door: 0x8db5e4 --> <!-- door: 0x8db5e4 -->
<VTable rebase="-0xDC00" /> <VTable rebase="-0xDC00" />
</Entry> </Entry>
<Entry version="v0.28.181.40d13" os="windows" id="40d13win" base="40d12win" rebase="0x5090"> <Entry version="v0.28.181.40d13" os="windows" id="40d13win" base="40d12win" rebase="0x5090">
<!-- identification --> <!-- identification -->
@ -341,6 +682,12 @@
<String name="md5">59ab29021aca9f3c66b1ab102fb3ceea</String> <String name="md5">59ab29021aca9f3c66b1ab102fb3ceea</String>
<!-- map_data = 0x01601D84 --> <!-- map_data = 0x01601D84 -->
<!-- door: 0x8e15d4, no VTable rebase needed --> <!-- door: 0x8e15d4, no VTable rebase needed -->
<!-- translation tables -->
<Address name="translation_vector">0x01604134</Address>
<Address name="language_vector">0x01604104</Address>
<Offset name="last_name">0x38</Offset>
<Offset name="word_table">0x58</Offset>
<Offset name="current_job_id">0x08</Offset>
</Entry> </Entry>
.-"""-. .-"""-.
@ -363,7 +710,7 @@
`"--...,+"""" `._,.-' `"--...,+"""" `._,.-'
<Entry version="v0.28.181.40d9" os="linux" id="40d9lin"> <Entry version="v0.28.181.40d9" os="linux" id="40d9lin" base="meta-40d">
<!-- identification --> <!-- identification -->
<String name="md5">992afd73855e787860277f53d18afcbb</String> <String name="md5">992afd73855e787860277f53d18afcbb</String>
@ -382,6 +729,7 @@
<!-- creature offsets --> <!-- creature offsets -->
<Offset name="first_name">0x00</Offset> <Offset name="first_name">0x00</Offset>
<Offset name="nick_name">0x04</Offset> <Offset name="nick_name">0x04</Offset>
<Offset name="last_name">0x38</Offset>
<Offset name="creature_position">0x4C</Offset> <Offset name="creature_position">0x4C</Offset>
<Offset name="creature_type">0x44</Offset> <Offset name="creature_type">0x44</Offset>
<Offset name="creature_flags1">0x90</Offset> <Offset name="creature_flags1">0x90</Offset>
@ -578,6 +926,7 @@
<!-- map_data = 0x8F9ABDC --> <!-- map_data = 0x8F9ABDC -->
<!--<class vtable="0x086c78c8" name="door"/>--> <!--<class vtable="0x086c78c8" name="door"/>-->
</Entry> </Entry>
</MemoryDescriptors> </MemoryDescriptors>
<!-- Windows logo by M$, spiderweb by jgs --> <!-- Windows logo by M$, spiderweb by jgs -->
</DFExtractor> </DFExtractor>

@ -57,10 +57,47 @@ int main (void)
cout << ", nick name: " << temp.nick_name; cout << ", nick name: " << temp.nick_name;
addendl = true; addendl = true;
} }
if(!temp.trans_name.empty()){
cout << ", trans name: " << temp.trans_name;
addendl =true;
}
if(!temp.generic_name.empty()){
cout << ", generic name: " << temp.generic_name;
addendl=true;
}
if(addendl) if(addendl)
{ {
cout << endl; cout << endl;
addendl = false;
} }
if(!temp.profession.empty()){
cout << "profession: " << temp.profession;
addendl = false;
}
if(!temp.custom_profession.empty()){
cout << ", custom profession: " << temp.custom_profession;
addendl = false;
}
if(!temp.current_job.empty()){
cout << ", current job: " << temp.current_job;
addendl = false;
}
if(addendl)
{
cout << endl;
addendl = false;
}
cout << "happiness: " << temp.happiness << ", strength: " << temp.strength << ", agility: "
<< temp.agility << ", toughness: " << temp.toughness << ", money: " << temp.money;
cout << ", sex";
if(temp.sex == 0){
cout << ", Female";
}
else{
cout <<", Male";
}
cout << endl;
/* /*
* FLAGS 1 * FLAGS 1
*/ */