Initial commit. Updated release archive.

This commit is contained in:
Jaysyn904
2024-06-20 15:47:42 -04:00
parent d14b20cb85
commit e49d03aa23
6897 changed files with 6107848 additions and 0 deletions

View File

@@ -0,0 +1,34 @@
//Spawns a random villager at the nearest waypoint to the PC. (Which should be inside the house the PC just entered.)
//50% of the time a mid a level 7 villager is spawned
//35% a level 5 villager
//and 15% a level 10 villager
void main()
{
int randomnum = d20(1);
object o_pc = GetEnteringObject();
int do_once = GetLocalInt(GetArea(o_pc), "i_spawnonce");
location l_pc = GetLocation(o_pc);
object o_spawnat = GetNearestObjectToLocation(OBJECT_TYPE_WAYPOINT, l_pc);
location l_spawnat = GetLocation(o_spawnat);
if (do_once != 1)
{
if (randomnum < 11)
{
CreateObject(OBJECT_TYPE_CREATURE, "aylatownsman_mid", l_spawnat, FALSE);
SetLocalInt(GetArea(o_pc), "i_spawnonce", 1);
}
else
{
if (randomnum <18)
{
CreateObject(OBJECT_TYPE_CREATURE, "aylatownsman_low", l_spawnat, FALSE);
SetLocalInt(GetArea(o_pc), "i_spawnonce", 1);
}
else
{
CreateObject(OBJECT_TYPE_CREATURE, "aylatownsman_hi", l_spawnat, FALSE);
SetLocalInt(GetArea(o_pc), "i_spawnonce", 1);
}
}
}
}