mirror of
https://github.com/SWG-Source/dsrc.git
synced 2026-08-01 01:15:59 -04:00
62 lines
1.3 KiB
Plaintext
62 lines
1.3 KiB
Plaintext
/**********************************************************************
|
|
* Copyright (c)2000-2002 Sony Online Entertainment Inc.
|
|
* All Rights Reserved
|
|
*
|
|
* Title: senate_controller
|
|
* Description: This script attaches to the Senate on Test Center.
|
|
* @author $Author:$
|
|
* @version $Revision:$
|
|
**********************************************************************/
|
|
|
|
/***** INCLUDES ********************************************************/
|
|
include library.utils;
|
|
|
|
/***** TRIGGERS ********************************************************/
|
|
trigger OnInitialize()
|
|
{
|
|
makeAllCellsPublic(self);
|
|
setCellScripts(self);
|
|
|
|
return SCRIPT_CONTINUE;
|
|
}
|
|
|
|
void makeAllCellsPublic(obj_id senate)
|
|
{
|
|
string[] senateRooms = getCellNames(senate);
|
|
obj_id cellId = null;
|
|
|
|
for(int i = 0; i < senateRooms.length; i++)
|
|
{
|
|
cellId = getCellId(senate, senateRooms[i]);
|
|
|
|
if(!isIdValid(cellId))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
permissionsMakePublic(cellId);
|
|
}
|
|
}
|
|
|
|
// resets all the scripts on the cells for the permission system
|
|
void setCellScripts(obj_id enclave)
|
|
{
|
|
string[] enclaveRooms = getCellNames(enclave);
|
|
obj_id cellId = null;
|
|
|
|
for(int i = 0; i < enclaveRooms.length; i++)
|
|
{
|
|
cellId = getCellId(enclave, enclaveRooms[i]);
|
|
|
|
if(!isIdValid(cellId))
|
|
{
|
|
continue;
|
|
}
|
|
|
|
attachScript(cellId, "systems.city.senate_cell");
|
|
}
|
|
|
|
return;
|
|
}
|
|
|