84 lines
2.5 KiB
Plaintext
84 lines
2.5 KiB
Plaintext
|
//:: at_dm_attack1.nss
|
||
|
//::
|
||
|
//:: Spawns the Dung Monster (ra_dungmonster01) from the Commode conversation.
|
||
|
//::
|
||
|
//::
|
||
|
|
||
|
|
||
|
void main()
|
||
|
{
|
||
|
//:: Declare major variables
|
||
|
object oPlaceable = OBJECT_SELF;
|
||
|
|
||
|
//:: Check if the Dung Monster is already active
|
||
|
int DungMonsterActive = GetLocalInt(GetModule(), "DungMonsterActive");
|
||
|
|
||
|
//:: If it's not already active, spawn the Dung Monster
|
||
|
if (DungMonsterActive == 0)
|
||
|
{
|
||
|
object oCreature = GetObjectByTag("ra_dungmonster01");
|
||
|
|
||
|
// Check if the monster already exists
|
||
|
if (!GetIsObjectValid(oCreature))
|
||
|
{
|
||
|
// If it doesn't exist, spawn it
|
||
|
oCreature = CreateObject(OBJECT_TYPE_CREATURE, "ra_dungmonster01", GetLocation(oPlaceable));
|
||
|
|
||
|
// Get the nearest player to the placeable
|
||
|
object oNearestPlayer = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oPlaceable);
|
||
|
|
||
|
// If we found a player, make the creature attack them
|
||
|
if (GetIsObjectValid(oCreature) && GetIsObjectValid(oNearestPlayer))
|
||
|
{
|
||
|
AssignCommand(oCreature, ActionAttack(oNearestPlayer));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
// Set the Dung Monster as active in the module
|
||
|
SetLocalInt(GetModule(), "DungMonsterActive", 1);
|
||
|
}
|
||
|
|
||
|
//:: Clear the plot flag on the commode
|
||
|
SetPlotFlag(oPlaceable, FALSE);
|
||
|
|
||
|
//:: Destroy the commode
|
||
|
DestroyObject(oPlaceable, 0.0f);
|
||
|
|
||
|
//:: Spawn the latrine hole
|
||
|
object oHole = CreateObject(OBJECT_TYPE_PLACEABLE, "ra_plc_dm_hole", GetLocation(oPlaceable));
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/* void main()
|
||
|
{
|
||
|
//:: Declare major variables
|
||
|
object oPlaceable = OBJECT_SELF;
|
||
|
|
||
|
//:: Spawn the Dung Monster
|
||
|
object oCreature = CreateObject(OBJECT_TYPE_CREATURE, "ra_dungmonster01", GetLocation(oPlaceable));
|
||
|
|
||
|
//:: Get the nearest player to the placeable
|
||
|
object oNearestPlayer = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, oPlaceable);
|
||
|
|
||
|
//:: If we found a player, make the creature attack them
|
||
|
GetIsObjectValid(oCreature) && GetIsObjectValid(oNearestPlayer))
|
||
|
{
|
||
|
AssignCommand(oCreature, ActionAttack(oNearestPlayer));
|
||
|
}
|
||
|
|
||
|
//:: Clear the plot flag on the commode
|
||
|
SetPlotFlag(oPlaceable, FALSE);
|
||
|
|
||
|
//:: Set a var on the module to show the Dung Monster is active
|
||
|
SetLocalInt(GetModule(), "DungMonsterActive", TRUE);
|
||
|
|
||
|
//:: Destroy the commode
|
||
|
DestroyObject(oPlaceable, 0.0f);
|
||
|
|
||
|
//:: Spawn the latrene hole
|
||
|
object oHole = CreateObject(OBJECT_TYPE_PLACEABLE, "ra_plc_dm_hole", GetLocation(oPlaceable));
|
||
|
|
||
|
} */
|