Elin:Code Analysis/Housing
if (EClass.rnd(5) == 0 && this.policies.IsActive(2810, -1))
{
int num8 = 3 + this.lv + this.Evalue(2206) / 5 + this.Evalue(3702) * 2 + this.Evalue(2202) / 2;
num8 = num8 * (100 + this.Evalue(3702) * 20 + this.Evalue(2206)) / 100;
num8 = num8 * (100 + (int)Mathf.Sqrt((float)this.Evalue(2811)) * 3) / 100;
if (EClass._map.CountGuest() < num8)
{
Chara chara;
if (this.policies.IsActive(2822, -1) && Mathf.Sqrt((float)(this.Evalue(2822) / 2)) + 5f >= (float)EClass.rnd(100))
{
chara = CharaGen.CreateWealthy(this.ContentLV);
EClass._zone.AddCard(chara, EClass._zone.GetSpawnPos(SpawnPosition.Random, 100) ?? EClass._map.GetRandomSurface(false, true, false));
}
else
{
chara = EClass._zone.SpawnMob(null, SpawnSetting.HomeGuest(this.ContentLV));
}
if (chara != null && (chara.id == "nun_mother" || chara.id == "prostitute") && this.policies.IsActive(2710, -1))
{
chara.Destroy();
chara = null;
}
if (chara != null)
{
this.statistics.visitor++;
chara.memberType = FactionMemberType.Guest;
chara.SetInt(34, EClass.world.date.GetRaw(0));
chara.c_allowance = chara.LV * 100;
if (chara.IsWealthy)
{
chara.c_allowance *= 10;
}
if (date.IsRealTime)
{
Msg.Say("guestArrive", chara.Name, null, null, null);
}
else
{
chara.TryAssignBed();
}
}
}
}
So there's a 80% chance if open for business is active, then
num8 = 3 + (I'm guessing land lvl) + (attractiveness / 5) + (If ancient ruin value is active then, it * 2) + publicity / 2
num8 = num8 (from above) * (100 + ancient ruin * 20 + attractiveness) / 100
num8 = num8 (from above) * (100 + integer of the sqrt((of a float of tourist safety) * 3) / 100)
Then if Celeb heaven is on AND the sqrt(Celeb heaven / 2) + 5 is greater than or equal to a random number from 1-100
THEN
wealthy visitors are generated (based on something called content lvl (which may be danger lvl))
add the random visitors somewhere random
Then the next lines check to say if its a mother and if you have the anti mother policy
Then they get an allowance of their character level * 100,
and if they're wealthy its * 1000