generated from Jaysyn/ModuleTemplate
32 lines
930 B
Plaintext
32 lines
930 B
Plaintext
#include "nw_i0_generic"
|
|
void main()
|
|
{
|
|
string sText;
|
|
object oSpawn;
|
|
object oTarget;
|
|
object oMaster;
|
|
oMaster = GetObjectByTag("TheMaster");
|
|
location lTarget;
|
|
lTarget = GetLocation(OBJECT_SELF);
|
|
int nRandom = d12(1);
|
|
if (nRandom == 1){
|
|
sText = "skeleton001";}
|
|
else if (nRandom == 2){
|
|
sText = "nw_zombie01";}
|
|
else if (nRandom == 3){
|
|
sText = "nw_ghoul";}
|
|
else if (nRandom == 4){
|
|
sText = "nw_zombie01";}
|
|
|
|
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
|
|
if (GetIsObjectValid(oPC) == TRUE && GetDistanceToObject(oPC) < 25.0 && nRandom <6)
|
|
{
|
|
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, sText, lTarget, TRUE);
|
|
oTarget = oSpawn;
|
|
SetIsTemporaryEnemy(oPC, oTarget);
|
|
AssignCommand(oTarget, ActionAttack(oPC));
|
|
AssignCommand(oTarget, DetermineCombatRound(oPC));
|
|
ActionCastSpellAtObject (SPELL_NEGATIVE_ENERGY_RAY, oMaster, TRUE, 5, TRUE);
|
|
}
|
|
}
|