#include "custom_set_lib" struct perceivedEvent { int isValid; object lastPerceived; int lastPerceptionHeard; int lastPerceptionInaudible; int lastPerceptionSeen; int lastPerceptionVanished; }; struct disturbedEvent { int isValid; object lastDisturbed; object inventoryDisturbItem; int inventoryDisturbType; }; struct attackedEvent { int isValid; object lastAttacker; }; struct damagedEvent { int isValid; object lastdamager; int totalDamageDealt; int damageAcid; int damageBludgeoning; int damageCold; int damageDivine; int damageElectrical; int damageFire; int damageMagical; int damageNegative; int damagePiercing; int damagePositive; int damageSlashing; int damageSonic; }; struct blockedEvent { int isValid; object blockingDoor; }; //:://///////////////////////////////////////////// //:: GetLastPerceivedEvent //::////////////////////////////////////////////// // // Retrieves the last perception event data from target. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct perceivedEvent GetLastPerceivedEvent(object target = OBJECT_SELF); //:://///////////////////////////////////////////// //:: SetLastPerceivedEvent //::////////////////////////////////////////////// // // Stores the perception event data for the caller. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// void SetLastPerceivedEvent(struct perceivedEvent evt); //:://///////////////////////////////////////////// //:: PerceivedEvent //::////////////////////////////////////////////// // // Returns the data available for a caller perception event. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct perceivedEvent PerceivedEvent(); //:://///////////////////////////////////////////// //:: GetLastDisturbedEvent //::////////////////////////////////////////////// // // Retrieves the last inventory dirsturbed event data from target. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct disturbedEvent GetLastDisturbedEvent(object target = OBJECT_SELF); //:://///////////////////////////////////////////// //:: SetLastDisturbedEvent //::////////////////////////////////////////////// // // Stores the inventory dirsturbed event data for the caller. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// void SetLastDisturbedEvent(struct disturbedEvent evt); //:://///////////////////////////////////////////// //:: DisturbedEvent //::////////////////////////////////////////////// // // Returns the data available for a caller inventory dirsturbed event. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct disturbedEvent DisturbedEvent(); //:://///////////////////////////////////////////// //:: GetLastAttackedEvent //::////////////////////////////////////////////// // // Retrieves the last on attacked event data from target. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct attackedEvent GetLastAttackedEvent(object target = OBJECT_SELF); //:://///////////////////////////////////////////// //:: SetLastAttackedEvent //::////////////////////////////////////////////// // // Stores the on attacked event data on the caller. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// void SetLastAttackedEvent(struct attackedEvent evt); //:://///////////////////////////////////////////// //:: AttackedEvent //::////////////////////////////////////////////// // // Returns the available on attacked event data. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct attackedEvent AttackedEvent(); //:://///////////////////////////////////////////// //:: CreatePCClone //::////////////////////////////////////////////// // // Creates a clone of PC at cloneLocation. The clone will // use the set of script corresponding to scriptset. // If spawn is TRUE then CustomSet_respawn is called. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// object CreatePCClone(object PC,location cloneLocation,int scriptset = CustomSet_DefaultSet,int spawn = TRUE); //:://///////////////////////////////////////////// //:: GetLastDamagedEvent //::////////////////////////////////////////////// // // Retrieves the last on damaged event data from target. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct damagedEvent GetLastDamagedEvent(object target = OBJECT_SELF); //:://///////////////////////////////////////////// //:: SetLastDamagedEvent //::////////////////////////////////////////////// // // Stores the on damaged event data on the caller. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// void SetLastDamagedEvent(struct damagedEvent evt); //:://///////////////////////////////////////////// //:: DamagedEvent //::////////////////////////////////////////////// // // Returns the data available for a caller on damaged event. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct damagedEvent DamagedEvent(); //:://///////////////////////////////////////////// //:: GetLastBlockedEvent //::////////////////////////////////////////////// // // Retrieves the last on blocked event data from target. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct blockedEvent GetLastBlockedEvent(object target = OBJECT_SELF); //:://///////////////////////////////////////////// //:: SetLastBlockedEvent //::////////////////////////////////////////////// // // Stores the on blocked event data on the caller. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// void SetLastBlockedEvent(struct blockedEvent evt); //:://///////////////////////////////////////////// //:: BlockedEvent //::////////////////////////////////////////////// // // Returns the data available for a caller on blocked event. // //::////////////////////////////////////////////// //:: Created By: Alexandre Brunel //:: Created On: 04/11/2004 //::////////////////////////////////////////////// struct blockedEvent BlockedEvent(); void SetDialog(string dialog,object target= OBJECT_SELF); string GetDialog(object target= OBJECT_SELF); struct perceivedEvent GetLastPerceivedEvent(object target = OBJECT_SELF) { struct perceivedEvent retval; retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceivedIsValid"); retval.lastPerceived = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastPerceived"); retval.lastPerceptionInaudible = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionInaudible"); retval.lastPerceptionSeen = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionSeen"); retval.lastPerceptionVanished = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionVanished"); return retval; } void SetLastPerceivedEvent(struct perceivedEvent evt) { object target = OBJECT_SELF; SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceivedIsValid",evt.isValid); SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastPerceived",evt.lastPerceived); SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionInaudible",evt.lastPerceptionInaudible); SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionSeen",evt.lastPerceptionSeen); SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastPerceptionVanished",evt.lastPerceptionVanished); } struct perceivedEvent PerceivedEvent() { struct perceivedEvent retval; retval.lastPerceived = GetLastPerceived(); retval.isValid = GetIsObjectValid(retval.lastPerceived); retval.lastPerceptionInaudible = GetLastPerceptionInaudible(); retval.lastPerceptionSeen = GetLastPerceptionSeen(); retval.lastPerceptionVanished = GetLastPerceptionVanished(); return retval; } struct disturbedEvent GetLastDisturbedEvent(object target = OBJECT_SELF) { struct disturbedEvent retval; retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDisturbedValid"); retval.lastDisturbed = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDisturbed"); retval.inventoryDisturbItem = GetLocalObject(target,"PC_CLONE_SYSTEM_InventoryDisturbItem"); retval.inventoryDisturbType = GetLocalInt(target,"PC_CLONE_SYSTEM_inventoryDisturbType"); return retval; } void SetLastDisturbedEvent(struct disturbedEvent evt) { object target = OBJECT_SELF; SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDisturbedValid",evt.isValid); SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDisturbed",evt.lastDisturbed); SetLocalObject(target,"PC_CLONE_SYSTEM_InventoryDisturbItem",evt.inventoryDisturbItem); SetLocalInt(target,"PC_CLONE_SYSTEM_inventoryDisturbType",evt.inventoryDisturbType); } struct disturbedEvent DisturbedEvent() { struct disturbedEvent retval; retval.lastDisturbed = GetLastDisturbed(); retval.inventoryDisturbItem = GetInventoryDisturbItem(); retval.isValid = GetIsObjectValid(retval.lastDisturbed) && GetIsObjectValid(retval.inventoryDisturbItem); retval.inventoryDisturbType = GetInventoryDisturbType(); return retval; } struct attackedEvent GetLastAttackedEvent(object target = OBJECT_SELF) { struct attackedEvent retval; retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastAttackerValid"); retval.lastAttacker = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastAttacker"); return retval; } void SetLastAttackedEvent(struct attackedEvent evt) { object target = OBJECT_SELF; SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastAttackerValid",evt.isValid); SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastAttacker",evt.lastAttacker); } struct attackedEvent AttackedEvent() { struct attackedEvent retval; retval.lastAttacker = GetLastAttacker(); retval.isValid = GetIsObjectValid(retval.lastAttacker); return retval; } object CreatePCClone(object PC,location cloneLocation,int scriptset = CustomSet_DefaultSet,int spawn = TRUE) { object copy = CopyObject(PC,cloneLocation); SetLocalInt(copy,"PC_CLONE_SYSTEM",TRUE); SetLocalInt(copy,CustomSetScriptSet,scriptset); if(spawn) { CustomSet_respawn(copy); } AssignCommand(copy,DelayCommand(RoundsToSeconds(1),ExecuteScript("clone_heartbeat",copy))); return copy; } struct damagedEvent GetLastDamagedEvent(object target = OBJECT_SELF) { struct damagedEvent retval; retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDamagerValid"); retval.lastdamager = GetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDamager"); retval.totalDamageDealt = GetLocalInt(target,"PC_CLONE_SYSTEM_GetTotalDamageDealt"); retval.damageAcid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ACID)); retval.damageBludgeoning = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_BLUDGEONING)); retval.damageCold = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_COLD)); retval.damageDivine = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_DIVINE)); retval.damageElectrical = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ELECTRICAL)); retval.damageFire = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_FIRE)); retval.damageMagical = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_MAGICAL)); retval.damageNegative = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_NEGATIVE)); retval.damagePiercing = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_PIERCING)); retval.damagePositive = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_POSITIVE)); retval.damageSlashing = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SLASHING)); retval.damageSonic = GetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SONIC)); return retval; } void SetLastDamagedEvent(struct damagedEvent evt) { object target = OBJECT_SELF; SetLocalInt(target,"PC_CLONE_SYSTEM_GetLastDamagerValid",evt.isValid); SetLocalObject(target,"PC_CLONE_SYSTEM_GetLastDamager",evt.lastdamager); SetLocalInt(target,"PC_CLONE_SYSTEM_GetTotalDamageDealt",evt.totalDamageDealt); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ACID),evt.damageAcid); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_BLUDGEONING),evt.damageBludgeoning); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_COLD),evt.damageCold); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_DIVINE),evt.damageDivine); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_ELECTRICAL),evt.damageElectrical); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_FIRE),evt.damageFire); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_MAGICAL),evt.damageMagical); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_NEGATIVE),evt.damageNegative); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_PIERCING),evt.damagePiercing); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_POSITIVE),evt.damagePositive); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SLASHING),evt.damageSlashing); SetLocalInt(target,"PC_CLONE_SYSTEM_GetDamageDealtByType"+IntToString(DAMAGE_TYPE_SONIC),evt.damageSonic); } struct damagedEvent DamagedEvent() { struct damagedEvent retval; retval.lastdamager = GetLastDamager(); retval.isValid = GetIsObjectValid(retval.lastdamager); retval.totalDamageDealt = GetTotalDamageDealt(); retval.damageAcid = GetDamageDealtByType(DAMAGE_TYPE_ACID); retval.damageBludgeoning = GetDamageDealtByType(DAMAGE_TYPE_BLUDGEONING); retval.damageCold = GetDamageDealtByType(DAMAGE_TYPE_COLD); retval.damageDivine = GetDamageDealtByType(DAMAGE_TYPE_DIVINE); retval.damageElectrical = GetDamageDealtByType(DAMAGE_TYPE_ELECTRICAL); retval.damageFire = GetDamageDealtByType(DAMAGE_TYPE_FIRE); retval.damageMagical = GetDamageDealtByType(DAMAGE_TYPE_MAGICAL); retval.damageNegative = GetDamageDealtByType(DAMAGE_TYPE_NEGATIVE); retval.damagePiercing = GetDamageDealtByType(DAMAGE_TYPE_PIERCING); retval.damagePositive = GetDamageDealtByType(DAMAGE_TYPE_POSITIVE); retval.damageSlashing = GetDamageDealtByType(DAMAGE_TYPE_SLASHING); retval.damageSonic = GetDamageDealtByType(DAMAGE_TYPE_SONIC); return retval; } struct blockedEvent GetLastBlockedEvent(object target = OBJECT_SELF) { struct blockedEvent retval; retval.isValid = GetLocalInt(target,"PC_CLONE_SYSTEM_GetBlockingDoorIsValid"); retval.blockingDoor = GetLocalObject(target,"PC_CLONE_SYSTEM_GetBlockingDoor"); return retval; } void SetLastBlockedEvent(struct blockedEvent evt) { SetLocalInt(OBJECT_SELF,"PC_CLONE_SYSTEM_GetBlockingDoorIsValid",evt.isValid); SetLocalObject(OBJECT_SELF,"PC_CLONE_SYSTEM_GetBlockingDoor",evt.blockingDoor); } struct blockedEvent BlockedEvent() { struct blockedEvent retval; retval.blockingDoor = GetBlockingDoor(); retval.isValid = GetIsObjectValid(retval.blockingDoor); return retval; } void SetDialog(string dialog,object target= OBJECT_SELF) { SetLocalString(target,"PC_CLONE_SYSTEM_DLG",dialog); } string GetDialog(object target= OBJECT_SELF) { return GetLocalString(target,"PC_CLONE_SYSTEM_DLG"); }