mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-13 22:01:04 -04:00
48 lines
1.1 KiB
Plaintext
48 lines
1.1 KiB
Plaintext
// Weather Control script
|
|
// by Cinco Barnes 11-30-2002
|
|
|
|
trigger OnAttach()
|
|
{
|
|
debugSpeakMsg(self, "Weather Test Script Attached");
|
|
debugSpeakMsg(self, "Commands: clear, mild, heavy, severe");
|
|
setObjVar(self, "weatherIndex", 0);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnHearSpeech(obj_id speaker, string text)
|
|
{
|
|
if (text == "0" || text == "clear")
|
|
{
|
|
debugSpeakMsg(self, "Clear Weather");
|
|
setWeatherData(0, 0.01f, 0.01f);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (text == "1" || text == "mild")
|
|
{
|
|
debugSpeakMsg(self, "Mild Weather");
|
|
setWeatherData(1, 0.02f, 0.02f);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (text == "2" || text == "heavy")
|
|
{
|
|
debugSpeakMsg(self, "Heavy Weather");
|
|
setWeatherData(2, 0.52f, 0.52f);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
if (text == "3" || text == "severe")
|
|
{
|
|
debugSpeakMsg(self, "Severe Weather");
|
|
setWeatherData(3, 0.95f, 0.95f);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
trigger OnDetach()
|
|
{
|
|
// Reset to clear weather regardless of state
|
|
debugSpeakMsg(self, "Detaching weather script. Resetting weather.");
|
|
setWeatherData (0, 0.0f, 0.0f);
|
|
return SCRIPT_CONTINUE;
|
|
} |