Files
dsrc/sku.0/sys.server/compiled/game/script/theme_park/poi/base.script
T

474 lines
12 KiB
Plaintext

/* This is the base script which all POI content scripts
* must inherit.
* --------------------------------------------------*/
/* Each POI template must specify the following objvar:
*
* poi.script - the name of the content script.
* - Used by poi.launch to start the main
* - content script.
*
* And may specify the following obvars:
*
* poi.difficulty - the difficulty rating of the poi
* poi.faction - the faction type of the poi, if any
* poi.factionValue - the faction value of completing the poi
* poi.objective - used where a single poi script can
* have multiple objectives.
* --------------------------------------------------*/
include library.poi;
include ai.ai_combat;
//completion status:
const int POI_INCOMPLETE = poi.POI_INCOMPLETE;
const int POI_SUCCESS = poi.POI_SUCCESS;
const int POI_FAIL = poi.POI_FAIL;
//objvars:
const string POI_STRING_LIST = poi.POI_STRING_LIST;
const string POI_STRING_LIST_INDEXNAME = poi.POI_STRING_LIST_INDEXNAME;
const string POI_CREDIT_LIST = poi.POI_CREDIT_LIST;
const string POI_DENY_LIST = poi.POI_DENY_LIST;
const string POI_DESTROY_MESSAGE = poi.POI_DESTROY_MESSAGE;
const string POI_DESTROY_MESSAGE_DELAY = poi.POI_DESTROY_MESSAGE_DELAY;
const string POI_BASE_OBJECT = poi.POI_BASE_OBJECT;
const string POI_NO_MESSAGE_ON_DESTROY = poi.POI_NO_MESSAGE_ON_DESTROY;
const string POI_COMPLETED = poi.POI_COMPLETED;
//Objvars placed on the main POI object from template data:
const string POI_DIFFICULTY = poi.POI_DIFFICULTY;
const string POI_FACTION = poi.POI_FACTION;
const string POI_FACTION_VALUE = poi.POI_FACTION_VALUE;
const string POI_OBJECTIVE = poi.POI_OBJECTIVE;
//scripts:
const string POI_OBJECT_SCRIPT = poi.POI_OBJECT_SCRIPT;
/* Use this function to create POI elements:
* --------------------------------------------------*/
obj_id poiCreateObject( obj_id poiObject, string template, float x, float z )
{
return poi.createObject(poiObject, template, x, z);
}
obj_id poiCreateObject( obj_id poiObject, string template, float x, float z, int level )
{
return poi.createObject(poiObject, template, x, z, level);
}
obj_id poiCreateObject( string template, float x, float z )
{
return poi.createObject(template, x, z);
}
obj_id poiCreateObject( string template, float x, float z, int level )
{
return poi.createObject(template, x, z, level);
}
obj_id poiCreateObject( obj_id poiObject, string name, string template, float x, float z )
{
return poi.createObject(poiObject, name, template, x, z);
}
obj_id poiCreateObject( obj_id poiObject, string name, string template, float x, float z, int level )
{
return poi.createObject(poiObject, name, template, x, z, level);
}
obj_id poiCreateObject(obj_id poiObject, string strName, location locCenter)
{
return poi.createObject(poiObject, strName, locCenter);
}
obj_id poiCreateObject(obj_id poiObject, string strName, location locCenter, int level)
{
return poi.createObject(poiObject, strName, locCenter, level);
}
obj_id poiCreateObject( string name, string template, float x, float z )
{
return poi.createObject(name, template, x, z);
}
obj_id poiCreateObject( string name, string template, float x, float z, int level )
{
return poi.createObject(name, template, x, z, level);
}
obj_id poiCreateNpc( obj_id poiObject, string type, float x, float z )
{
return poi.createNpc(poiObject, type, x, z);
}
obj_id poiCreateNpc( obj_id poiObject, string type, float x, float z, int level )
{
return poi.createNpc(poiObject, type, x, z, level);
}
obj_id poiCreateNpc( string type, float x, float z )
{
return poi.createNpc(type, x, z);
}
obj_id poiCreateNpc( string type, float x, float z, int level )
{
return poi.createNpc(type, x, z, level);
}
obj_id poiCreateNpc( obj_id poiObject, string ident, string type, float x, float z )
{
return poi.createNpc(poiObject, ident, type, x, z);
}
obj_id poiCreateNpc( obj_id poiObject, string ident, string type, float x, float z, int level )
{
return poi.createNpc(poiObject, ident, type, x, z, level);
}
obj_id poiCreateNpc( string ident, string type, float x, float z )
{
return poi.createNpc(ident, type, x, z);
}
obj_id poiCreateNpc( string ident, string type, float x, float z, int level )
{
return poi.createNpc(ident, type, x, z, level);
}
obj_id poiFindObject( obj_id poiObject, string name )
{
return poi.findObject(poiObject, name);
}
obj_id poiFindObject( string name )
{
return poi.findObject(name);
}
string poiFindObjectName( obj_id poiObject )
{
return poi.findObjectName(poiObject);
}
string poiFindObjectName()
{
return poi.findObjectName();
}
/* Use this function to cause the object to emit a message to the main POI
* script when the object is destroyed
* --------------------------------------------------*/
void poiSetDestroyMessage( obj_id poiObject, string name, string messageHandlerName, int delay)
{
poi.setDestroyMessage(poiObject, name, messageHandlerName, delay);
}
void poiSetDestroyMessage( obj_id poiObject, string name, string messageHandlerName)
{
poi.setDestroyMessage(poiObject, name, messageHandlerName);
}
void poiSetDestroyMessage( string name, string messageHandlerName, int delay )
{
poi.setDestroyMessage(name, messageHandlerName, delay);
}
void poiSetDestroyMessage( string name, string messageHandlerName )
{
poi.setDestroyMessage(name, messageHandlerName);
}
void poiSetDestroyMessage( obj_id poiObject, string messageHandlerName, int delay )
{
poi.setDestroyMessage(poiObject, messageHandlerName, delay);
}
void poiSetDestroyMessage( obj_id poiObject, string messageHandlerName )
{
poi.setDestroyMessage(poiObject, messageHandlerName);
}
void poiSetDestroyMessage( string messageHandlerName, int delay )
{
poi.setDestroyMessage(messageHandlerName, delay);
}
void poiSetDestroyMessage( string messageHandlerName )
{
poi.setDestroyMessage(messageHandlerName);
}
/* These functions are used to Grant, Remove and Deny credit for poi completion:
* --------------------------------------------------*/
void poiGrantCredit( obj_id poiObject, obj_id player )
{
poi.grantCredit(poiObject, player);
}
void poiGrantCredit( obj_id player )
{
poi.grantCredit(player);
}
void poiRemoveCredit( obj_id poiObject, obj_id player )
{
poi.removeCredit(poiObject, player);
}
void poiRemoveCredit( obj_id player )
{
poi.removeCredit(player);
}
void poiDenyCredit( obj_id poiObject, obj_id player )
{
poi.denyCredit(poiObject, player);
}
void poiDenyCredit( obj_id player )
{
poi.denyCredit(player);
}
boolean poiIsGrantedCredit( obj_id poiObject, obj_id player )
{
return poi.isGrantedCredit(poiObject, player);
}
boolean poiIsGrantedCredit( obj_id player )
{
return poi.isGrantedCredit(player);
}
boolean poiIsGrantedCredit( obj_id poiBaseObject, string objVarName )
{
return poi.isGrantedCredit(poiBaseObject, objVarName);
}
boolean poiIsDeniedCredit( obj_id poiObject, obj_id player )
{
return poi.isDeniedCredit(poiObject, player);
}
boolean poiIsDeniedCredit( obj_id player )
{
return poi.isDeniedCredit(player);
}
boolean poiIsDeniedCredit( obj_id poiBaseObject, string objVarName )
{
return poi.isDeniedCredit(poiBaseObject, objVarName);
}
/* These functions are used internally to maintain a string index of POI elements
* --------------------------------------------------*/
void poiAddToStringList( obj_id element, string name )
{
poi.addToStringList(element, name);
}
void poiAddToStringList( string name )
{
poi.addToStringList(name);
}
void poiRemoveFromStringList( obj_id element )
{
poi.removeFromStringList(element);
}
void poiRemoveFromStringList()
{
poi.removeFromStringList();
}
void poiRemoveFromStringList( obj_id poiObject, string name )
{
poi.removeFromStringList(poiObject, name);
}
void poiRemoveFromStringList( string name )
{
poi.removeFromStringList(name);
}
/* These functions are used internally to maintain a list of POI elements
* --------------------------------------------------*/
void poiAddToMasterList( obj_id poiBaseObject, obj_id elementToAdd )
{
poi.addToMasterList(poiBaseObject, elementToAdd);
}
/* this function is used internally to remove objects from the
* string and master lists.
* --------------------------------------------------*/
void poiRemoveFromMasterList( obj_id poiBaseObject, obj_id elementToRemove )
{
poi.removeFromMasterList(poiBaseObject, elementToRemove);
}
boolean poiIsInMasterList( obj_id poiBaseObject, obj_id element )
{
return poi.isInMasterList(poiBaseObject, element);
}
/* This function is mostly used internally to find the poi
* base object
* --------------------------------------------------*/
obj_id poiGetBaseObject( obj_id poiObject )
{
return poi.getBaseObject(poiObject);
}
obj_id poiGetBaseObject()
{
return poi.getBaseObject();
}
/* This function is used internally. It is called when the
* base object is destroyed
* --------------------------------------------------*/
void poiBaseObjectDestroyed( obj_id poiBaseObject )
{
poi.baseObjectDestroyed(poiBaseObject);
}
/* This function is used internally when a POI element is destroyed
* --------------------------------------------------*/
void poiObjectDestroyed( obj_id element )
{
poi.objectDestroyed(element);
}
/* These functions are used to retrieve data from
* objvars placed on the main POI object from template:
* --------------------------------------------------*/
string poiGetDifficulty( obj_id poiObject )
{
return poi.getDifficulty(poiObject);
}
string poiGetDifficulty()
{
return poi.getDifficulty();
}
int poiGetIntDifficulty()
{
return poi.getIntDifficulty();
}
string poiGetFaction( obj_id poiObject )
{
return poi.getFaction(poiObject);
}
string poiGetFaction()
{
return poi.getFaction();
}
float poiGetFactionValue( obj_id poiObject )
{
return poi.getFactionValue(poiObject);
}
float poiGetFactionValue()
{
return poi.getFactionValue();
}
string poiGetObjective( obj_id poiObject )
{
return poi.getObjective(poiObject);
}
string poiGetObjective()
{
return poi.getObjective();
}
/* These functions can be used to override the faction-info:
* --------------------------------------------------*/
void poiSetFaction( obj_id poiObject, string faction )
{
poi.setFaction(poiObject, faction);
}
void poiSetFaction( string faction )
{
poi.setFaction(faction);
}
void poiSetFactionValue( obj_id poiObject, float factionValue )
{
poi.setFactionValue(poiObject, factionValue);
}
void poiSetFactionValue( float factionValue )
{
poi.setFactionValue(factionValue);
}
/* This function flags a POI as "complete", cleans it up, and credits the winners.
* --------------------------------------------------*/
void poiComplete( obj_id poiObject, int status )
{
poi.complete(poiObject, status);
}
void poiComplete( int status )
{
poi.complete(status);
}
void poiComplete( obj_id poiObject )
{
poi.complete(poiObject);
}
void poiComplete()
{
poi.complete();
}
//Never call this: It's called by poiComplete()
void poiAwardFactionStanding( obj_id poiBaseObject )
{
poi.awardFactionStanding(poiBaseObject);
}
//never call this:
void poiSendMissionStatus( obj_id poiBaseObject, int status )
{
poi.sendMissionStatus(poiBaseObject, status);
}
/* Never call this function directly. It's invoked by the poi_object
* script when the base object is removed from the world.
*
* All items told to destroy themselves, all POI data is reset
* and the POI will recreate itself from scratch when it
* re-initializes.
*
* --------------------------------------------------*/
void poiBaseObjectRemovedFromWorld( obj_id poiBaseObject )
{
poi.baseObjectRemovedFromWorld(poiBaseObject);
}
boolean poiIsCompleted( obj_id poiObject )
{
return poi.isComplete(poiObject);
}
boolean poiIsCompleted()
{
return poi.isComplete();
}