|
|
|
@ -359,7 +359,10 @@ int32_t Creatures::ReadCreatureInBox (int32_t index, t_creature & furball,
|
|
|
|
|
|
|
|
|
|
bool Creatures::WriteLabors(const uint32_t index, uint8_t labors[NUM_CREATURE_LABORS])
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started) return false;
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
|
|
|
|
|
@ -374,8 +377,9 @@ bool Creatures::WriteLabors(const uint32_t index, uint8_t labors[NUM_CREATURE_LA
|
|
|
|
|
bool Creatures::WriteHappiness(const uint32_t index, const uint32_t happinessValue)
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
|
p->writeDWord (temp + d->creatures.happiness_offset, happinessValue);
|
|
|
|
@ -387,8 +391,9 @@ bool Creatures::WriteFlags(const uint32_t index,
|
|
|
|
|
const uint32_t flags2)
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
|
p->writeDWord (temp + d->creatures.flags1_offset, flags1);
|
|
|
|
@ -399,14 +404,18 @@ bool Creatures::WriteFlags(const uint32_t index,
|
|
|
|
|
bool Creatures::WriteSkills(const uint32_t index, const t_soul &soul)
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
|
uint32_t souloff = p->readDWord(temp + d->creatures.default_soul_offset);
|
|
|
|
|
|
|
|
|
|
if(!souloff)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DfVector<uint32_t> skills(p, souloff + d->creatures.soul_skills_vector_offset);
|
|
|
|
|
|
|
|
|
@ -423,14 +432,18 @@ bool Creatures::WriteSkills(const uint32_t index, const t_soul &soul)
|
|
|
|
|
bool Creatures::WriteAttributes(const uint32_t index, const t_creature &creature)
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
|
uint32_t souloff = p->readDWord(temp + d->creatures.default_soul_offset);
|
|
|
|
|
|
|
|
|
|
if(!souloff)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// physical attributes
|
|
|
|
|
p->write(temp + d->creatures.physical_offset,
|
|
|
|
@ -448,7 +461,9 @@ bool Creatures::WriteAttributes(const uint32_t index, const t_creature &creature
|
|
|
|
|
bool Creatures::WriteSex(const uint32_t index, const uint8_t sex)
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
@ -458,14 +473,18 @@ bool Creatures::WriteSex(const uint32_t index, const uint8_t sex)
|
|
|
|
|
bool Creatures::WriteTraits(const uint32_t index, const t_soul &soul)
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
|
uint32_t souloff = p->readDWord(temp + d->creatures.default_soul_offset);
|
|
|
|
|
|
|
|
|
|
if(!souloff)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
p->write(souloff + d->creatures.soul_traits_offset,
|
|
|
|
|
sizeof (uint16_t) * NUM_CREATURE_TRAITS,
|
|
|
|
@ -477,7 +496,9 @@ bool Creatures::WriteTraits(const uint32_t index, const t_soul &soul)
|
|
|
|
|
bool Creatures::WriteMood(const uint32_t index, const uint16_t mood)
|
|
|
|
|
{
|
|
|
|
|
if(!d->Started)
|
|
|
|
|
{
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint32_t temp = d->p_cre->at (index);
|
|
|
|
|
Process * p = d->owner;
|
|
|
|
|