mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
215 lines
5.9 KiB
Plaintext
215 lines
5.9 KiB
Plaintext
include ai.ai;
|
|
include library.ai_lib;
|
|
include library.create;
|
|
include ai.ai_combat;
|
|
|
|
trigger OnInitialize()
|
|
{
|
|
spawnEveryone(self);
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void spawnEveryone(obj_id self)
|
|
{
|
|
debugSpeakMsg (self, "Spawning Everyone");
|
|
spawnCelebs(self);
|
|
return;
|
|
}
|
|
|
|
void spawnCelebs(obj_id self)
|
|
{
|
|
spawnHan(self);
|
|
spawnChewie(self);
|
|
spawnNien(self);
|
|
spawnPadawanTrialsNpc(self);
|
|
|
|
spawnGamblor(self);
|
|
spawnRetired(self);
|
|
spawnEngineer(self);
|
|
/* spawnProtector(self);
|
|
spawnRancorTamer(self);
|
|
spawnRanger(self);
|
|
spawnSentinel(self);
|
|
spawnSentry(self);
|
|
spawnSpellWeaver(self);
|
|
spawnStalker(self);*/
|
|
|
|
}
|
|
|
|
obj_id spawnHan(obj_id self)
|
|
{
|
|
obj_id room = getCellId (self, "private_room2");
|
|
location hanLoc = new location (-30.20f, -0.57f, 7.24f, "lok", room);
|
|
obj_id han = create.staticObject ("han_solo", hanLoc );
|
|
setObjVar (self, "cantinaInhabitants.han", han);
|
|
setYaw (han, 45f);
|
|
setObjVar (han, "cantina", self);
|
|
return han;
|
|
}
|
|
|
|
obj_id spawnChewie(obj_id self)
|
|
{
|
|
obj_id room = getCellId (self, "private_room2");
|
|
location chewieLoc = new location (-28.48f, -0.57f, 5.87f, "lok", room);
|
|
obj_id chewie = create.staticObject ("chewbacca", chewieLoc );
|
|
setObjVar (self, "cantinaInhabitants.chewie", chewie);
|
|
setYaw (chewie, 12f);
|
|
setObjVar (chewie, "cantina", self);
|
|
return chewie;
|
|
}
|
|
|
|
obj_id spawnPadawanTrialsNpc(obj_id self)
|
|
{
|
|
obj_id room = getCellId (self, "stage");
|
|
location npcLoc = new location (-13.19f, -0.89f, -20.28f, "lok", room);
|
|
obj_id npc = create.object("noren_krast", npcLoc );
|
|
ai_lib.setDefaultCalmMood (npc, "npc_sitting_chair");
|
|
setYaw (npc, 12f);
|
|
setInvulnerable(npc, true);
|
|
setCreatureStatic(npc, true);
|
|
setName(npc, "Vixur Webb (a musician)");
|
|
|
|
attachScript(npc, "conversation.padawan_old_musician_03");
|
|
|
|
setObjVar (self, "cantinaInhabitants.padawanTrialsNpc", npc);
|
|
setObjVar (npc, "cantina", self);
|
|
return npc;
|
|
}
|
|
|
|
obj_id spawnNien(obj_id self)
|
|
{
|
|
obj_id room = getCellId (self, "alcove5");
|
|
location nienLoc = new location (-12.12f, -0.89f, 23.08f, "lok", room);
|
|
obj_id nien = create.staticObject ("nien_nunb", nienLoc );
|
|
setObjVar (self, "cantinaInhabitants.nien", nien);
|
|
setAnimationMood (nien, "npc_sitting_chair");
|
|
setYaw (nien, 80f);
|
|
setObjVar (nien, "cantina", self);
|
|
return nien;
|
|
}
|
|
|
|
obj_id spawnGamblor(obj_id self)
|
|
{
|
|
obj_id room = getCellId (self, "alcove2");
|
|
location gamblorLoc = new location (12.82f, -0.89f, 21.49f, "lok", room);
|
|
obj_id gamblor = create.staticObject ("commoner", gamblorLoc );
|
|
attachScript (gamblor, "theme_park.nym.nym_contact");
|
|
setObjVar (self, "cantinaInhabitants.gamblor", gamblor);
|
|
setAnimationMood (gamblor, "npc_sitting_chair");
|
|
setYaw (gamblor, 89f);
|
|
setObjVar (gamblor, "cantina", self);
|
|
return gamblor;
|
|
}
|
|
|
|
obj_id spawnEngineer(obj_id self)
|
|
{
|
|
obj_id room = getCellId (self, "alcove3");
|
|
location engineerLoc = new location (11.63f, -0.89f, -16.56f, "lok", room);
|
|
obj_id engineer = create.staticObject ("nym_themepark_choster_cantina", engineerLoc );
|
|
//attachScript (engineer, "theme_park.nym.pirate_engineer");
|
|
setObjVar (self, "cantinaInhabitants.engineer", engineer);
|
|
setYaw (engineer, -83f);
|
|
setObjVar (engineer, "cantina", self);
|
|
return engineer;
|
|
}
|
|
|
|
obj_id spawnRetired(obj_id self)
|
|
{
|
|
obj_id room = getCellId (self, "back_hallway");
|
|
location initiateLoc = new location (-36.21f, 0.11f, -13.93f, "lok", room);
|
|
obj_id retired = create.staticObject ("nym_themepark_sergeant_moore_cantina", initiateLoc );
|
|
//attachScript (retired, "theme_park.nym.imperial_bribe");
|
|
setObjVar (self, "cantinaInhabitants.retired", retired);
|
|
setYaw (retired, 87f);
|
|
setObjVar (retired, "cantina", self);
|
|
return retired;
|
|
}
|
|
|
|
|
|
trigger OnHearSpeech (obj_id speaker, string text)
|
|
{
|
|
if (!hasObjVar (speaker, "gm"))
|
|
{
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
if (text == "celebs")
|
|
{
|
|
spawnCelebs(self);
|
|
}
|
|
|
|
|
|
if (text == "kill celebs")
|
|
{
|
|
killCelebs(self);
|
|
}
|
|
|
|
if (text == "kill all")
|
|
{
|
|
killAll(self);
|
|
}
|
|
|
|
if (text == "padawanTrials")
|
|
{
|
|
spawnPadawanTrialsNpc(self);
|
|
}
|
|
|
|
if ( text == "killPadawan" )
|
|
{
|
|
obj_id npc = getObjIdObjVar(self, "cantinaInhabitants.padawanTrialsNpc");
|
|
if ( isIdValid(npc) )
|
|
{
|
|
destroyObject(npc);
|
|
}
|
|
}
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
/*messageHandler doGating ()
|
|
{
|
|
obj_id lobby = getCellId (self, "lobby");
|
|
|
|
attachScript (lobby, "theme_park.gating.imperial.lobby_block");
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}*/
|
|
|
|
void killAll(obj_id self)
|
|
{
|
|
killCelebs(self);
|
|
return;
|
|
}
|
|
|
|
void killCelebs(obj_id self)
|
|
{
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.han" ));
|
|
removeObjVar (self, "cantinaInhabitants.han");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.chewie" ));
|
|
removeObjVar (self, "cantinaInhabitants.chewie");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.nien" ));
|
|
removeObjVar (self, "cantinaInhabitants.nien");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.gamblor" ));
|
|
removeObjVar (self, "cantinaInhabitants.gamblor");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.engineer" ));
|
|
removeObjVar (self, "cantinaInhabitants.engineer");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.retired" ));
|
|
removeObjVar (self, "cantinaInhabitants.retired");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.protector" ));
|
|
removeObjVar (self, "cantinaInhabitants.protector");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.rancortamer" ));
|
|
removeObjVar (self, "cantinaInhabitants.rancortamer");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.ranger" ));
|
|
removeObjVar (self, "cantinaInhabitants.ranger");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.sentinel" ));
|
|
removeObjVar (self, "cantinaInhabitants.sentinel");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.sentry" ));
|
|
removeObjVar (self, "cantinaInhabitants.sentry");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.spellweaver" ));
|
|
removeObjVar (self, "cantinaInhabitants.spellweaver");
|
|
destroyObject(getObjIdObjVar( self, "cantinaInhabitants.stalker" ));
|
|
removeObjVar (self, "cantinaInhabitants.stalker");
|
|
return;
|
|
}
|
|
|