Ok, here's the deal. I have a "sort of" random encounter script that can be modified and put into triggers that you can then paint around where ever you want.
But I think there could be SO much better solutions for that.
This is very good if you want to have your custom monsters only in your encounters, and don't want them to scale (I hate level scaling. There's always the "run away" option, if you spawn an epic monster at level 1
'>)
Folks got anything better than this? :
// Put this script OnEnter.
void main()
{
object oTarget;
object oSpawn;
// Get the creature who triggered this event.
object oPC = GetEnteringObject();
// Only fire for (real) PCs.
if ( !GetIsPC(oPC) || GetIsDMPossessed(oPC) )
return;
// If the local int is exactly 0.
if ( GetLocalInt(OBJECT_SELF, "nIsUsed") == 0 )
{
// Set a local integer.
SetLocalInt(OBJECT_SELF, "nIsUsed", 1);
// Set a local integer.
DelayCommand(1800.0, SetLocalInt(OBJECT_SELF, "nIsUsed", 0));
// Decide what to do based on a die roll.
switch ( d100() )
{
case 100:
{
// Spawn "Epic Monster".
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 96:
case 97:
case 98:
case 99:
{
// Spawn "Great Monster. "
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 88:
case 89:
case 90:
case 91:
case 92:
case 93:
case 94:
case 95:
{
// Spawn Smaller Monster.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 75:
case 76:
case 81:
case 82:
case 83:
case 85:
case 87:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 79:
case 80:
case 84:
case 86:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 71:
case 72:
case 73:
case 74:
case 77:
case 78:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetWaypointByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 66:
case 67:
case 68:
case 69:
case 70:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 58:
case 59:
case 60:
case 61:
case 62:
case 63:
case 64:
case 65:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 50:
case 51:
case 52:
case 53:
case 54:
case 55:
case 56:
case 57:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 48:
case 49:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 35:
case 36:
case 37:
case 38:
case 39:
case 40:
case 41:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 26:
case 27:
case 28:
case 29:
case 30:
case 31:
case 32:
case 33:
case 34:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 17:
case 18:
case 19:
case 20:
case 21:
case 22:
case 23:
case 24:
case 25:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
} break;
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
case 9:
case 10:
case 11:
case 12:
case 13:
case 14:
case 15:
case 16:
{
// Spawn some critters.
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
oTarget = GetNearestObjectByTag("your custom waypoint tag here");
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "ResRef", GetLocation(oTarget));
}
}
}
}
Basicly, you should be able to make every case spawn something, and those cases that I have set to spawn, can contain more than 1 - 3 different waypoints (All must have unique tag) This is something simple that I like in my module, but I'm looking for something more complicated than this. Anyone feel free to share ideas, or if you are looking for a simple random encounter script, feel free to grab this if you like it.
Modifié par JerrodAmolyan, 10 juillet 2013 - 09:10 .