Add biz/house game script classes
This commit is contained in:
@@ -77,6 +77,8 @@ function initClassTable() {
|
|||||||
this.createBusinessBlips = false;
|
this.createBusinessBlips = false;
|
||||||
this.createHouseBlips = false;
|
this.createHouseBlips = false;
|
||||||
|
|
||||||
|
this.introMusicURL = "";
|
||||||
|
|
||||||
this.pauseSavingToDatabase = false;
|
this.pauseSavingToDatabase = false;
|
||||||
|
|
||||||
if(dbAssoc) {
|
if(dbAssoc) {
|
||||||
@@ -530,6 +532,7 @@ function initClassTable() {
|
|||||||
this.business = 0;
|
this.business = 0;
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.index = -1;
|
this.index = -1;
|
||||||
|
this.businessIndex = -1;
|
||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
|
|
||||||
this.position = toVector3(0.0, 0.0, 0.0);
|
this.position = toVector3(0.0, 0.0, 0.0);
|
||||||
@@ -537,12 +540,11 @@ function initClassTable() {
|
|||||||
this.dimension = 0;
|
this.dimension = 0;
|
||||||
|
|
||||||
if(dbAssoc) {
|
if(dbAssoc) {
|
||||||
this.databaseId = toInteger(dbAssoc("biz_loc_id"));
|
this.databaseId = toInteger(dbAssoc["biz_loc_id"]);
|
||||||
this.name = toString(dbAssoc("biz_loc_name"));
|
this.name = toString(dbAssoc["biz_loc_name"]);
|
||||||
this.type = toInteger(dbAssoc("biz_loc_type"));
|
this.type = toInteger(dbAssoc["biz_loc_type"]);
|
||||||
this.business = toInteger(dbAssoc("biz_loc_biz"));
|
this.business = toInteger(dbAssoc["biz_loc_biz"]);
|
||||||
this.enabled = intToBool(toInteger(dbAssoc("biz_loc_enabled")));
|
this.enabled = intToBool(toInteger(dbAssoc["biz_loc_enabled"]));
|
||||||
this.index = -1;
|
|
||||||
|
|
||||||
this.position = toVector3(toFloat(dbAssoc["biz_loc_pos_x"]), toFloat(dbAssoc["biz_loc_pos_y"]), toFloat(dbAssoc["biz_loc_pos_z"]));
|
this.position = toVector3(toFloat(dbAssoc["biz_loc_pos_x"]), toFloat(dbAssoc["biz_loc_pos_y"]), toFloat(dbAssoc["biz_loc_pos_z"]));
|
||||||
this.interior = toInteger(dbAssoc["biz_loc_int"]);
|
this.interior = toInteger(dbAssoc["biz_loc_int"]);
|
||||||
@@ -550,6 +552,25 @@ function initClassTable() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/** @class businessGameScriptData Representing a business's game scripts. Multiple can be used for a single business. Used for things like bar and club NPCs and other actions */
|
||||||
|
businessGameScriptData: class {
|
||||||
|
constructor(dbAssoc) {
|
||||||
|
this.databaseId = 0;
|
||||||
|
this.name = "";
|
||||||
|
this.business = 0;
|
||||||
|
this.enabled = false;
|
||||||
|
this.index = -1;
|
||||||
|
this.businessIndex = -1;
|
||||||
|
this.needsSaved = false;
|
||||||
|
|
||||||
|
if(dbAssoc) {
|
||||||
|
this.databaseId = toInteger(dbAssoc["biz_script_id"]);
|
||||||
|
this.name = toString(dbAssoc["biz_script_name"]);
|
||||||
|
this.state = toInteger(dbAssoc["biz_script_state"]);
|
||||||
|
this.business = toInteger(dbAssoc["biz_script_biz"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
/** @class houseData Representing a house's data. Loaded and saved in the database */
|
/** @class houseData Representing a house's data. Loaded and saved in the database */
|
||||||
houseData: class {
|
houseData: class {
|
||||||
constructor(dbAssoc) {
|
constructor(dbAssoc) {
|
||||||
@@ -622,6 +643,7 @@ function initClassTable() {
|
|||||||
this.house = 0;
|
this.house = 0;
|
||||||
this.enabled = false;
|
this.enabled = false;
|
||||||
this.index = -1;
|
this.index = -1;
|
||||||
|
this.houseIndex = -1;
|
||||||
this.needsSaved = false;
|
this.needsSaved = false;
|
||||||
|
|
||||||
this.position = toVector3(0.0, 0.0, 0.0);
|
this.position = toVector3(0.0, 0.0, 0.0);
|
||||||
@@ -629,11 +651,11 @@ function initClassTable() {
|
|||||||
this.dimension = 0;
|
this.dimension = 0;
|
||||||
|
|
||||||
if(dbAssoc) {
|
if(dbAssoc) {
|
||||||
this.databaseId = toInteger(dbAssoc("house_loc_id"));
|
this.databaseId = toInteger(dbAssoc["house_loc_id"]);
|
||||||
this.name = toString(dbAssoc("house_loc_name"));
|
this.name = toString(dbAssoc["house_loc_name"]);
|
||||||
this.type = toInteger(dbAssoc("house_loc_type"));
|
this.type = toInteger(dbAssoc["house_loc_type"]);
|
||||||
this.house = toInteger(dbAssoc("house_loc_house"));
|
this.house = toInteger(dbAssoc["house_loc_house"]);
|
||||||
this.enabled = intToBool(toInteger(dbAssoc("house_loc_enabled")));
|
this.enabled = intToBool(toInteger(dbAssoc["house_loc_enabled"]));
|
||||||
this.index = -1;
|
this.index = -1;
|
||||||
|
|
||||||
this.position = toVector3(toFloat(dbAssoc["house_loc_pos_x"]), toFloat(dbAssoc["house_loc_pos_y"]), toFloat(dbAssoc["house_loc_pos_z"]));
|
this.position = toVector3(toFloat(dbAssoc["house_loc_pos_x"]), toFloat(dbAssoc["house_loc_pos_y"]), toFloat(dbAssoc["house_loc_pos_z"]));
|
||||||
@@ -642,6 +664,25 @@ function initClassTable() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
/** @class houseGameScriptData Representing a house's game scripts. Multiple can be used for a single house. */
|
||||||
|
houseGameScriptData: class {
|
||||||
|
constructor(dbAssoc) {
|
||||||
|
this.databaseId = 0;
|
||||||
|
this.name = "";
|
||||||
|
this.business = 0;
|
||||||
|
this.state = false;
|
||||||
|
this.index = -1;
|
||||||
|
this.houseIndex = -1;
|
||||||
|
this.needsSaved = false;
|
||||||
|
|
||||||
|
if(dbAssoc) {
|
||||||
|
this.databaseId = toInteger(dbAssoc["house_script_id"]);
|
||||||
|
this.name = toString(dbAssoc["house_script_name"]);
|
||||||
|
this.state = toInteger(dbAssoc["house_script_state"]);
|
||||||
|
this.business = toInteger(dbAssoc["house_script_biz"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
/** @class clanData Representing a clan's data. Loaded and saved in the database */
|
/** @class clanData Representing a clan's data. Loaded and saved in the database */
|
||||||
clanData: class {
|
clanData: class {
|
||||||
constructor(dbAssoc) {
|
constructor(dbAssoc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user