mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-07-31 00:15:54 -04:00
722 lines
22 KiB
Plaintext
722 lines
22 KiB
Plaintext
include library.utils;
|
|
include library.ai_lib;
|
|
include library.create;
|
|
include library.chat;
|
|
|
|
const float THIRTY_SIX_HOURS = 60 * 60 * 36; //**** April Fool's Only
|
|
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
string setting = getConfigSetting("EventTeam", "aprilfools");
|
|
|
|
if(setting == null || setting == "" || setting != "true")
|
|
return SCRIPT_CONTINUE;
|
|
|
|
|
|
// APRIL FOOL's ONLY
|
|
if(!hasObjVar(self, "aprilfools.invasion_run_time") )
|
|
{
|
|
float rightNow = getGameTime();
|
|
float invasionRunTime = rightNow + THIRTY_SIX_HOURS;
|
|
setObjVar(self, "aprilfools.invasion_run_time", invasionRunTime);
|
|
}
|
|
// APRIL FOOL's ONLY
|
|
|
|
float minInvasionTime = 2700.0f;
|
|
float timeChunkSize = 900.0f;
|
|
int numTimeChunk = 9;
|
|
|
|
// float minInvasionTime = 60.0f; //TEMP
|
|
// float timeChunkSize = 30.0f; //TEMP
|
|
// int numTimeChunk = 3; //TEMP
|
|
|
|
|
|
float rightNow = getGameTime();
|
|
|
|
float nextInvasionTime = ( rand(1, numTimeChunk) * timeChunkSize ) + minInvasionTime + rightNow;
|
|
|
|
setObjVar(self, "aprilfools.next_invasion_time", nextInvasionTime);
|
|
setObjVar(self, "aprilfools.invasion_active", 0);
|
|
|
|
messageTo(self, "invasionTimerPing", null, 30, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler invasionTimerPing()
|
|
{
|
|
float rightNow = getGameTime();
|
|
float nextInvasionTime = getFloatObjVar(self, "aprilfools.next_invasion_time");
|
|
int invasionActive = getIntObjVar(self, "aprilfools.invasion_active");
|
|
|
|
// APRIL FOOL's ONLY
|
|
float invasionRunTime = getFloatObjVar(self, "aprilfools.invasion_run_time");
|
|
|
|
if(rightNow > invasionRunTime)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
// APRIL FOOL's ONLY
|
|
|
|
if(invasionActive == 1)
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(rightNow > nextInvasionTime && invasionActive == 0)
|
|
{
|
|
|
|
int coinFlip = rand(1, 2);
|
|
|
|
if(coinFlip == 1)
|
|
messageTo(self, "startRobberyEvent", null, 1, false);
|
|
|
|
if(coinFlip == 2)
|
|
messageTo(self, "startBartenderEvent", null, 1, false);
|
|
|
|
setObjVar(self, "aprilfools.invasion_active", 1);
|
|
announceStatusToPlayers(self, "cantina_zone_emote");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
else
|
|
{
|
|
messageTo(self, "invasionTimerPing", null, 900, false); //******** SHOULD BE 15 MINUTES ON FINAL
|
|
// messageTo(self, "invasionTimerPing", null, 30, false); //******** SHOULD BE 15 MINUTES ON FINAL
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void announceStatusToPlayers(obj_id self, string messageId)
|
|
{
|
|
obj_id[] objPlayers = getPlayerCreaturesInRange(self, 64.0f);
|
|
|
|
if (objPlayers != null && objPlayers.length>0)
|
|
{
|
|
for(int i = 0; i < objPlayers.length; i++)
|
|
{
|
|
sendSystemMessage(objPlayers[i], new string_id("aprilfools", messageId));
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/**************** Robbery Event Start *****************************/
|
|
|
|
messageHandler startRobberyEvent()
|
|
{
|
|
location ewok1Start = getLocation(self);
|
|
location ewok2Start = getLocation(self);
|
|
location ewok3Start = getLocation(self);
|
|
location ewok4Start = getLocation(self);
|
|
location foil1Start = getLocation(self);
|
|
|
|
obj_id cantinaCell = getCellId(self, "cantina");
|
|
obj_id foyerCell = getCellId(self, "foyer1");
|
|
|
|
ewok1Start.x = 47.0f;
|
|
ewok2Start.x = 46.0f;
|
|
ewok3Start.x = 45.0f;
|
|
ewok4Start.x = 44.0f;
|
|
ewok1Start.z = 0.0f;
|
|
ewok2Start.z = 0.0f;
|
|
ewok3Start.z = 0.0f;
|
|
ewok4Start.z = 0.0f;
|
|
ewok1Start.cell = foyerCell;
|
|
ewok2Start.cell = foyerCell;
|
|
ewok3Start.cell = foyerCell;
|
|
ewok4Start.cell = foyerCell;
|
|
foil1Start.x = 18.0f;
|
|
foil1Start.z = 0.0f;
|
|
foil1Start.cell = cantinaCell;
|
|
|
|
obj_id ewok1 = create.object("panshee_worker", ewok1Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok1, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok1);
|
|
setInvulnerable(ewok1, true);
|
|
setObjVar(ewok1, "aprilfools.actor_role", "ewok1");
|
|
attachScript(ewok1, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok1, "aprilfools.cantina", self);
|
|
|
|
obj_id ewok2 = create.object("panshee_worker", ewok2Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok2, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok2);
|
|
setInvulnerable(ewok2, true);
|
|
setObjVar(ewok2, "aprilfools.actor_role", "ewok2");
|
|
attachScript(ewok2, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok2, "aprilfools.cantina", self);
|
|
|
|
obj_id ewok3 = create.object("panshee_worker", ewok3Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok3, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok3);
|
|
setInvulnerable(ewok3, true);
|
|
setObjVar(ewok3, "aprilfools.actor_role", "ewok3");
|
|
attachScript(ewok3, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok3, "aprilfools.cantina", self);
|
|
|
|
obj_id ewok4 = create.object("panshee_worker", ewok4Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok4, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok4);
|
|
setInvulnerable(ewok4, true);
|
|
setObjVar(ewok4, "aprilfools.actor_role", "ewok4");
|
|
attachScript(ewok4, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok4, "aprilfools.cantina", self);
|
|
|
|
obj_id foil1 = create.object("noble", foil1Start);
|
|
ai_lib.setDefaultCalmBehavior(foil1, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(foil1);
|
|
setInvulnerable(foil1, true);
|
|
setObjVar(foil1, "aprilfools.actor_role", "foil1");
|
|
attachScript(foil1, "event.aprilfools.cantina_actor");
|
|
setObjVar(foil1, "aprilfools.cantina", self);
|
|
|
|
|
|
setObjVar(self, "aprilfools.ewok1", ewok1);
|
|
setObjVar(self, "aprilfools.ewok2", ewok2);
|
|
setObjVar(self, "aprilfools.ewok3", ewok3);
|
|
setObjVar(self, "aprilfools.ewok4", ewok4);
|
|
setObjVar(self, "aprilfools.foil1", foil1);
|
|
|
|
// dictionary params = new dictionary();
|
|
int position = 0;
|
|
params.put("position", position);
|
|
|
|
messageTo(ewok1, "moveToMainActorPosition", params, 10, false);
|
|
messageTo(ewok2, "moveToMainActorPosition", params, 10, false);
|
|
messageTo(ewok3, "moveToMainActorPosition", params, 10, false);
|
|
messageTo(ewok4, "moveToMainActorPosition", params, 10, false);
|
|
messageTo(foil1, "moveToMainActorPosition", params, 10, false);
|
|
|
|
messageTo(self, "robberyEventSegment1", null, 25, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment1()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
obj_id ewok2 = getObjIdObjVar(self, "aprilfools.ewok2");
|
|
obj_id ewok3 = getObjIdObjVar(self, "aprilfools.ewok3");
|
|
obj_id ewok4 = getObjIdObjVar(self, "aprilfools.ewok4");
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
|
|
messageTo(ewok1, "faceSouth", null, 1, false);
|
|
messageTo(ewok2, "faceEast", null, 1, false);
|
|
messageTo(ewok3, "faceWest", null, 1, false);
|
|
messageTo(ewok4, "faceNorth", null, 1, false);
|
|
messageTo(foil1, "faceNorth", null, 1, false);
|
|
|
|
// params.put("myLine", "ewok1_1");
|
|
// params.put("myMood", "curious");
|
|
|
|
// messageTo(ewok1, "sayYourLine", null, 6, false);
|
|
|
|
string_id myLine = new string_id("aprilfools", "ewok1_1");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_CURIOUS, myLine);
|
|
messageTo(self, "robberyEventSegment2", null, 8, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment2()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
string_id myLine = new string_id("aprilfools", "foil1_2");
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_CONDESCENDING, myLine);
|
|
messageTo(self, "robberyEventSegment3", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment3()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
string_id myLine = new string_id("aprilfools", "ewok1_3");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_HUNGRY, myLine);
|
|
messageTo(self, "robberyEventSegment4", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment4()
|
|
{
|
|
obj_id ewok2 = getObjIdObjVar(self, "aprilfools.ewok2");
|
|
string_id myLine = new string_id("aprilfools", "ewok2_4");
|
|
chat.chat(ewok2, chat.CHAT_SAY, chat.MOOD_GLOOMY, myLine);
|
|
messageTo(self, "robberyEventSegment5", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment5()
|
|
{
|
|
obj_id ewok3 = getObjIdObjVar(self, "aprilfools.ewok3");
|
|
string_id myLine = new string_id("aprilfools", "ewok3_5");
|
|
chat.chat(ewok3, chat.CHAT_SAY, chat.MOOD_FRUSTRATED, myLine);
|
|
messageTo(self, "robberyEventSegment6", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment6()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
string_id myLine = new string_id("aprilfools", "foil1_6");
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_ANGRY, myLine);
|
|
messageTo(self, "robberyEventSegment7", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment7()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
string_id myLine = new string_id("aprilfools", "ewok1_7");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_HOPEFUL, myLine);
|
|
messageTo(self, "robberyEventSegment8", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment8()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
string_id myLine = new string_id("aprilfools", "foil1_8");
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_PUZZLED, myLine);
|
|
messageTo(self, "robberyEventSegment9", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment9()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
string_id myLine = new string_id("aprilfools", "ewok1_9");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_HAPPY, myLine);
|
|
messageTo(self, "robberyEventSegment10", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventSegment10()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
obj_id ewok2 = getObjIdObjVar(self, "aprilfools.ewok2");
|
|
obj_id ewok3 = getObjIdObjVar(self, "aprilfools.ewok3");
|
|
obj_id ewok4 = getObjIdObjVar(self, "aprilfools.ewok4");
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
|
|
string_id ewok1Line = new string_id("aprilfools", "ewok1_10");
|
|
string_id ewok3Line = new string_id("aprilfools", "ewok3_10");
|
|
string_id foil1Line = new string_id("aprilfools", "foil1_10");
|
|
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_PANICKED, ewok1Line);
|
|
chat.chat(ewok3, chat.CHAT_SAY, chat.MOOD_PANICKED, ewok3Line);
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_ENRAGED, foil1Line);
|
|
|
|
int cycle = 2;
|
|
setObjVar(self, "aprilfools.robbery_cycle", cycle);
|
|
int position = cycle;
|
|
params.put("position", position);
|
|
|
|
messageTo(ewok1, "becomeVulnerable", null, 1, false);
|
|
|
|
messageTo(ewok1, "moveToMainActorPosition", params, 1, false);
|
|
messageTo(foil1, "moveToMainActorPosition", params, 2, false);
|
|
messageTo(ewok2, "moveToRandomLocation", null, 1, false);
|
|
messageTo(ewok3, "moveToRandomLocation", null, 1, false);
|
|
messageTo(ewok4, "moveToRandomLocation", null, 1, false);
|
|
|
|
messageTo(self, "robberyEventCycle", null, 10, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler robberyEventCycle()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
obj_id ewok2 = getObjIdObjVar(self, "aprilfools.ewok2");
|
|
obj_id ewok3 = getObjIdObjVar(self, "aprilfools.ewok3");
|
|
obj_id ewok4 = getObjIdObjVar(self, "aprilfools.ewok4");
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
|
|
int cycle = getIntObjVar(self, "aprilfools.robbery_cycle");
|
|
|
|
if(!isIdValid(ewok1) )
|
|
cycle = 999;
|
|
|
|
if(cycle == 999) // Event end condition
|
|
{
|
|
messageTo(self, "concludeRobberyEvent", null, 1, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(cycle == 5)
|
|
{
|
|
cycle = 1;
|
|
}
|
|
|
|
int position = cycle;
|
|
params.put("position", position);
|
|
|
|
messageTo(ewok1, "moveToMainActorPosition", params, 1, false);
|
|
messageTo(foil1, "moveToMainActorPosition", params, 2, false);
|
|
messageTo(ewok2, "moveToRandomLocation", null, 1, false);
|
|
messageTo(ewok3, "moveToRandomLocation", null, 1, false);
|
|
messageTo(ewok4, "moveToRandomLocation", null, 1, false);
|
|
|
|
int randEwokPhrase = rand(1, 7);
|
|
int randFoilPhrase = rand(1, 7);
|
|
|
|
string_id ewok1Line = new string_id("aprilfools", "ewok1_rand_" + randEwokPhrase);
|
|
string_id foil1Line = new string_id("aprilfools", "foil1_rand_" + randFoilPhrase);
|
|
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_PANICKED, ewok1Line);
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_ENRAGED, foil1Line);
|
|
|
|
cycle++;
|
|
setObjVar(self, "aprilfools.robbery_cycle", cycle);
|
|
messageTo(self, "robberyEventCycle", null, 16, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler concludeRobberyEvent()
|
|
{
|
|
setObjVar(self, "aprilfools.invasion_active", 0); // ***** ADDED
|
|
|
|
obj_id ewok2 = getObjIdObjVar(self, "aprilfools.ewok2");
|
|
obj_id ewok3 = getObjIdObjVar(self, "aprilfools.ewok3");
|
|
obj_id ewok4 = getObjIdObjVar(self, "aprilfools.ewok4");
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
|
|
setObjVar(self, "aprilfools.robbery_cycle", 999);
|
|
string_id ewokLine = new string_id("aprilfools", "ewok3_10");
|
|
string_id foilLine = new string_id("aprilfools", "foil1_finally");
|
|
|
|
messageTo(ewok2, "runAwayAndPoof", null, 1, false);
|
|
chat.chat(ewok2, chat.CHAT_SAY, chat.MOOD_PANICKED, ewokLine);
|
|
messageTo(ewok3, "runAwayAndPoof", null, 1, false);
|
|
chat.chat(ewok3, chat.CHAT_SAY, chat.MOOD_PANICKED, ewokLine);
|
|
messageTo(ewok4, "runAwayAndPoof", null, 1, false);
|
|
chat.chat(ewok4, chat.CHAT_SAY, chat.MOOD_PANICKED, ewokLine);
|
|
messageTo(foil1, "goDie", null, 60, false);
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_ANNOYED, foilLine);
|
|
|
|
|
|
float minInvasionTime = 2700.0f;
|
|
float timeChunkSize = 900.0f;
|
|
int numTimeChunk = 9;
|
|
|
|
// float minInvasionTime = 60.0f; //TEMP
|
|
// float timeChunkSize = 30.0f; //TEMP
|
|
// int numTimeChunk = 3; //TEMP
|
|
|
|
|
|
float rightNow = getGameTime();
|
|
float nextInvasionTime = ( rand(1, numTimeChunk) * timeChunkSize ) + minInvasionTime + rightNow;
|
|
setObjVar(self, "aprilfools.next_invasion_time", nextInvasionTime);
|
|
messageTo(self, "invasionTimerPing", null, 2700, false); //********* SHOULD BE 45 MINUTES ON FINAL
|
|
// messageTo(self, "invasionTimerPing", null, 30, false); //********* TESTING
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
/*************** Robbery Event End *************************/
|
|
|
|
/*************** Bartender Event Start ********************/
|
|
|
|
messageHandler startBartenderEvent()
|
|
{
|
|
location ewok1Start = getLocation(self);
|
|
location ewok2Start = getLocation(self);
|
|
location ewok3Start = getLocation(self);
|
|
location ewok4Start = getLocation(self);
|
|
location foil1Start = getLocation(self);
|
|
|
|
obj_id cantinaCell = getCellId(self, "cantina");
|
|
obj_id foyerCell = getCellId(self, "foyer1");
|
|
|
|
ewok1Start.x = 47.0f;
|
|
ewok2Start.x = 46.0f;
|
|
ewok3Start.x = 45.0f;
|
|
ewok4Start.x = 44.0f;
|
|
ewok1Start.z = 0.0f;
|
|
ewok2Start.z = 0.0f;
|
|
ewok3Start.z = 0.0f;
|
|
ewok4Start.z = 0.0f;
|
|
ewok1Start.cell = foyerCell;
|
|
ewok2Start.cell = foyerCell;
|
|
ewok3Start.cell = foyerCell;
|
|
ewok4Start.cell = foyerCell;
|
|
foil1Start.x = 8.4f;
|
|
foil1Start.z = 0.4f;
|
|
foil1Start.cell = cantinaCell;
|
|
|
|
obj_id ewok1 = create.object("panshee_worker", ewok1Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok1, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok1);
|
|
setInvulnerable(ewok1, true);
|
|
setObjVar(ewok1, "aprilfools.actor_role", "ewok1");
|
|
attachScript(ewok1, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok1, "aprilfools.cantina", self);
|
|
|
|
obj_id ewok2 = create.object("panshee_worker", ewok2Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok2, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok2);
|
|
setInvulnerable(ewok2, true);
|
|
setObjVar(ewok2, "aprilfools.actor_role", "ewok2");
|
|
attachScript(ewok2, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok2, "aprilfools.cantina", self);
|
|
|
|
obj_id ewok3 = create.object("panshee_worker", ewok3Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok3, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok3);
|
|
setInvulnerable(ewok3, true);
|
|
setObjVar(ewok3, "aprilfools.actor_role", "ewok3");
|
|
attachScript(ewok3, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok3, "aprilfools.cantina", self);
|
|
|
|
obj_id ewok4 = create.object("panshee_worker", ewok4Start);
|
|
ai_lib.setDefaultCalmBehavior(ewok4, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(ewok4);
|
|
setInvulnerable(ewok4, true);
|
|
setObjVar(ewok4, "aprilfools.actor_role", "ewok4");
|
|
attachScript(ewok4, "event.aprilfools.cantina_actor");
|
|
setObjVar(ewok4, "aprilfools.cantina", self);
|
|
|
|
obj_id foil1 = create.object("noble", foil1Start);
|
|
ai_lib.setDefaultCalmBehavior(foil1, ai_lib.BEHAVIOR_SENTINEL );
|
|
stop(foil1);
|
|
setInvulnerable(foil1, true);
|
|
setObjVar(foil1, "aprilfools.actor_role", "foil1");
|
|
attachScript(foil1, "event.aprilfools.cantina_actor");
|
|
setObjVar(foil1, "aprilfools.cantina", self);
|
|
string bartenderName = utils.packStringId(new string_id("aprilfools", "bartender_name") );
|
|
setName(foil1, bartenderName);
|
|
|
|
setObjVar(self, "aprilfools.ewok1", ewok1);
|
|
setObjVar(self, "aprilfools.ewok2", ewok2);
|
|
setObjVar(self, "aprilfools.ewok3", ewok3);
|
|
setObjVar(self, "aprilfools.ewok4", ewok4);
|
|
setObjVar(self, "aprilfools.foil1", foil1);
|
|
|
|
// dictionary params = new dictionary();
|
|
int position = 5;
|
|
params.put("position", position);
|
|
|
|
messageTo(ewok1, "moveToMainActorPosition", params, 10, false);
|
|
messageTo(foil1, "moveToMainActorPosition", params, 10, false);
|
|
messageTo(self, "moveAllExtrasToRandomLocation", null, 1, false);
|
|
messageTo(self, "bartenderEventSegment1", null, 25, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler moveAllExtrasToRandomLocation()
|
|
{
|
|
obj_id ewok2 = getObjIdObjVar(self, "aprilfools.ewok2");
|
|
obj_id ewok3 = getObjIdObjVar(self, "aprilfools.ewok3");
|
|
obj_id ewok4 = getObjIdObjVar(self, "aprilfools.ewok4");
|
|
messageTo(ewok2, "moveToRandomLocation", null, 10, false);
|
|
messageTo(ewok3, "moveToRandomLocation", null, 10, false);
|
|
messageTo(ewok4, "moveToRandomLocation", null, 10, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment1()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
|
|
messageTo(foil1, "faceNorth", null, 1, false);
|
|
messageTo(ewok1, "faceSouth", null, 1, false);
|
|
|
|
string_id myLine = new string_id("aprilfools", "bar_line_1");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_CURIOUS, myLine);
|
|
messageTo(self, "bartenderEventSegment2", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment2()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_2");
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_CONFUSED, myLine);
|
|
messageTo(self, "bartenderEventSegment3", null, 6, false);
|
|
messageTo(self, "moveAllExtrasToRandomLocation", null, 1, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment3()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_3");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_CONFUSED, myLine);
|
|
messageTo(self, "bartenderEventSegment4", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment4()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_4");
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_ENCOURAGING, myLine);
|
|
messageTo(self, "bartenderEventSegment5", null, 6, false);
|
|
messageTo(self, "moveAllExtrasToRandomLocation", null, 1, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment5()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_5");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_CONFIDENT, myLine);
|
|
messageTo(self, "bartenderEventSegment6", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment6()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_6");
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_RESPECTFUL, myLine);
|
|
messageTo(self, "bartenderEventSegment7", null, 6, false);
|
|
messageTo(self, "moveAllExtrasToRandomLocation", null, 1, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment7()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_7");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_THANKFUL, myLine);
|
|
messageTo(self, "bartenderEventSegment8", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment8()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_8");
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_DISGUSTED, myLine);
|
|
messageTo(self, "bartenderEventSegment9", null, 6, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment9()
|
|
{
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
string_id myLine = new string_id("aprilfools", "bar_line_9");
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_WORRIED, myLine);
|
|
messageTo(self, "bartenderEventSegment10", null, 6, false);
|
|
messageTo(self, "moveAllExtrasToRandomLocation", null, 1, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventSegment10()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
|
|
string_id ewokLine = new string_id("aprilfools", "bar_line_10");
|
|
string_id foilLine = new string_id("aprilfools", "bar_line_11");
|
|
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_SCORNFUL, ewokLine);
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_ANGRY, foilLine);
|
|
|
|
int cycle = 2;
|
|
setObjVar(self, "aprilfools.robbery_cycle", cycle);
|
|
int position = cycle;
|
|
params.put("position", position);
|
|
|
|
messageTo(ewok1, "becomeVulnerable", null, 1, false);
|
|
|
|
messageTo(ewok1, "moveToMainActorPosition", params, 1, false);
|
|
messageTo(foil1, "moveToMainActorPosition", params, 2, false);
|
|
messageTo(self, "moveAllExtrasToRandomLocation", null, 1, false);
|
|
messageTo(self, "bartenderEventCycle", null, 10, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
messageHandler bartenderEventCycle()
|
|
{
|
|
obj_id ewok1 = getObjIdObjVar(self, "aprilfools.ewok1");
|
|
obj_id foil1 = getObjIdObjVar(self, "aprilfools.foil1");
|
|
|
|
int cycle = getIntObjVar(self, "aprilfools.robbery_cycle");
|
|
|
|
if(!isIdValid(ewok1) )
|
|
cycle = 999;
|
|
|
|
if(cycle == 999) // Event end condition
|
|
{
|
|
messageTo(self, "concludeRobberyEvent", null, 1, false);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if(cycle == 5)
|
|
{
|
|
cycle = 1;
|
|
}
|
|
|
|
int position = cycle;
|
|
params.put("position", position);
|
|
|
|
messageTo(ewok1, "moveToMainActorPosition", params, 1, false);
|
|
messageTo(foil1, "moveToMainActorPosition", params, 2, false);
|
|
messageTo(self, "moveAllExtrasToRandomLocation", null, 1, false);
|
|
|
|
int randEwokPhrase = rand(1, 7);
|
|
int randFoilPhrase = rand(1, 7);
|
|
|
|
string_id ewok1Line = new string_id("aprilfools", "ewok1_rand_" + randEwokPhrase);
|
|
string_id foil1Line = new string_id("aprilfools", "bar_foil1_rand_" + randFoilPhrase);
|
|
|
|
chat.chat(ewok1, chat.CHAT_SAY, chat.MOOD_PANICKED, ewok1Line);
|
|
chat.chat(foil1, chat.CHAT_SAY, chat.MOOD_ENRAGED, foil1Line);
|
|
|
|
cycle++;
|
|
setObjVar(self, "aprilfools.robbery_cycle", cycle);
|
|
messageTo(self, "bartenderEventCycle", null, 16, false);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
/************ End Bartender Event *******************/
|
|
|
|
trigger OnHearSpeech(obj_id objSpeaker, string strText) // Added for testing
|
|
{
|
|
|
|
if(isGod(objSpeaker))
|
|
{
|
|
if(strText.equals("forcecantinaevent") )
|
|
{
|
|
int coinFlip = rand(1, 2);
|
|
|
|
if(coinFlip == 1)
|
|
messageTo(self, "startRobberyEvent", null, 1, false);
|
|
|
|
if(coinFlip == 2)
|
|
messageTo(self, "startBartenderEvent", null, 1, false);
|
|
|
|
setObjVar(self, "aprilfools.invasion_active", 1);
|
|
announceStatusToPlayers(self, "cantina_zone_emote");
|
|
}
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
} |