/********************************************************************** * Copyright (c)2000-2002 Sony Online Entertainment Inc. * All Rights Reserved * * Title: structure_rollup.script * Description: script to rollup a structure, placing all the contents in a player's inventory * @author $Author:$ * @version $Revision:$ **********************************************************************/ /***** INCLUDES ********************************************************/ include library.utils; include library.player_structure; include library.city; include library.prose; include library.trace; include library.vendor_lib; /***** TRIGGERS ********************************************************/ trigger OnDoStructureRollup(obj_id player, boolean warnOnly) { // Get the structure name and location string structName = player_structure.getStructureName(self); if(structName.length() < 1) { structName = "Structure"; } location where = getLocation(self); if (warnOnly) { string_id subject = new string_id("player_structure", "structure_purge_warning_subject"); string_id body = new string_id("player_structure", "structure_purge_warning_body"); prose_package pp = new prose_package (); prose.setStringId(pp, body); prose.setTO(pp, getPlayerFullName(player)); string body_oob = chatMakePersistentMessageOutOfBandBody(null, pp); string subject_str = "@" + subject.toString(); body_oob = chatAppendPersistentMessageWaypointData (body_oob, where.area, where.x, where.z, null, structName ); string[] admins = player_structure.getAdminListNames(self); for (int i = 0; i < admins.length; ++i) { chatSendPersistentMessage( "Galactic Housing Authority", admins[i], subject_str, null, body_oob ); } if ( city.isInCity( self ) ) { int cityId = city.getStructureCityId( self ); if (cityId != 0) { obj_id mayor = cityGetLeader( cityId ); if (mayor != obj_id.NULL_ID) { chatSendPersistentMessage( "Galactic Housing Authority", mayor, subject_str, null, body_oob ); } } } // rename the structure obj_id nameTarget = self; if ( player_structure.isBuilding(nameTarget) ) { obj_id sign = getObjIdObjVar(nameTarget, player_structure.VAR_SIGN_ID); if ( isIdValid(sign) ) nameTarget = sign; } string abandoned = " \\#FF0000\\(Abandoned)"; setName(nameTarget, structName + abandoned); if ( nameTarget != self ) { setObjVar(self, player_structure.VAR_SIGN_NAME, structName + abandoned); } } else { if (player_structure.isBuilding(self)) { // eject all players from house obj_id[] players = player_structure.getPlayersInBuilding(self); if (players != null) { for (int i = 0; i < players.length; i++) { expelFromBuilding(players[i]); } } // Destroy vendors inside this structure. string[] cells = getCellNames(self); if( cells != null) { for(int i = 0; i < cells.length; i++) { obj_id cellid = getCellId(self, cells[i]); obj_id contents[] = getContents(cellid); if(contents != null) { for(int j=0; j