RATDOG/_module/nss/cavein_retex.nss

52 lines
914 B
Plaintext
Raw Normal View History

void main()
{
//:: Get the placeable object that triggers the script.
object oPlaceable = OBJECT_SELF;
string sTexture;
//:: Check if a custom local variable has been set to indicate that the script has run.
int bHasRun = GetLocalInt(oPlaceable, "HasRun");
if (!bHasRun)
{
switch (d4(1))
{
case 1:
{
sTexture = "tdm01_rock01";
break;
}
case 2:
{
sTexture = "tdm01_rock02";
break;
}
case 3:
{
sTexture = "tdm01_rock03";
break;
}
case 4:
{
sTexture = "tdm01_rock04";
break;
}
}
ReplaceObjectTexture(oPlaceable, "tx_rough_006g", sTexture);
//:: Set the local variable to indicate that the script has run.
SetLocalInt(oPlaceable, "HasRun", 1);
//:: Removed HB script from event to save resources
SetEventScript(oPlaceable, EVENT_SCRIPT_PLACEABLE_ON_HEARTBEAT, "");
}
}