#include "aps_include" #include "inc_food" //#include "disease_include" #include "rhs_include" void main() { object oPC = GetFirstPC(); while(GetIsObjectValid(oPC)) { if(!GetIsDM(oPC)) { object oArea = GetArea(oPC); string sAreaTag = GetStringLeft(GetTag(oArea), 10); object oDatabase = GetItemPossessedBy(oPC, PC_DATABASE); // Fire HP regen process. // Natural HP regeneration is disabled if the PC is in a "No Regen" area if(GetLocalInt(oArea, "NO_REGEN") == FALSE) { // HP Regeneration Rate int iRate = GetLocalInt(oDatabase, REGEN_RATE); // Current tick we're on (counts down to 0, then recovers some HP) int iTick = GetLocalInt(oDatabase, REGEN_TICK) - 1; // Amount of HP to recover each tick int iAmount = GetLocalInt(oDatabase, REGEN_AMOUNT); // Additional HP is regenerated at a rate of 1 point per 2 points of CON past 10. int iCON = GetAbilityScore(oPC, ABILITY_CONSTITUTION) - 10; iAmount = iAmount + (iCON / 2); if(iAmount < 1) iAmount = 1; // Ready to recover some HP if(iTick <= 0) { // Only recover if PC is damaged. Lowers the amount of heal spam if(GetCurrentHitPoints(oPC) < GetMaxHitPoints(oPC)) { ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectHeal(iAmount), oPC); } iTick = iRate; } // Update current tick SetLocalInt(oDatabase, REGEN_TICK, iTick); } // Fire the hunger process //FOOD_RunHungerCycle(oPC); // Fire the disease reduction process //DISEASE_RunDiseaseRemovalProcess(oPC); // Bleeding System (Displays blood on ground if HP <= 30%) ExecuteScript("bleed_mod_hb", oPC); // Update PC's location - Doesn't fire when PC is in a player owned house if(GetLocalInt(oPC, "LOCATION_LOADED") == TRUE && !GetLocalInt(oArea, RHS_HOUSE_MARKER)) { string sLocation = APSLocationToString(GetLocation(oPC)); SetLocalString(oDatabase, "LOCATION_SYSTEM_SAVED_LOCATION", sLocation); } } oPC = GetNextPC(); } }