Files
dsrc/sku.0/sys.server/compiled/game/script/systems/city/senate_controller.script
T
2013-09-10 23:17:15 -07:00

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;
}