/////////////////////////////////////////////////////// // DESERT HEAT 2.0 - OnAreaEnter // By Deva Bryson Winblood // 10/10/2003 /////////////////////////////////////////////////////// //////////////////////////// // Prototypes //////////////////////////// void fnHeatEffects(object oPC,object oArea); //////////////////////////////////////////// MAIN void main() { object oPC=GetEnteringObject(); object oIntensity=GetNearestObjectByTag("DH2_INTENSITY",oPC); object oArea=GetArea(oPC); int nIntensity=30; if (oIntensity!=OBJECT_INVALID) nIntensity=StringToInt(GetName(oIntensity)); SetLocalInt(oPC,"DH2_Intensity",nIntensity); if (nIntensity<5) nIntensity=30; if (GetIsNight()==TRUE&&GetWaypointByTag("DH2_DAYNIGHT")!=OBJECT_INVALID) nIntensity=nIntensity*2; if (GetIsPC(oPC)==TRUE) { // is PC DelayCommand(IntToFloat(nIntensity),fnHeatEffects(oPC,oArea)); ExecuteScript("area_visit",OBJECT_SELF); } // is PC } //////////////////////////////////////////// MAIN /////////////////////////// // Functions /////////////////////////// void fnHeatEffects(object oPC,object oArea) { int nHeat; effect eCon=EffectAbilityDecrease(ABILITY_CONSTITUTION,1); effect eMov=EffectMovementSpeedDecrease(20); effect eStr=EffectAbilityDecrease(ABILITY_STRENGTH,1); effect eLight=EffectVisualEffect(VFX_IMP_DAZED_S); effect eFull=EffectVisualEffect(VFX_IMP_SLOW); effect eDmg=EffectDamage(1); if (GetArea(oPC)==oArea) { // still in same area //SendMessageToPC(oPC,"fnHeatEffects("+GetName(oPC)+","+GetName(oArea)+") current area:"+GetName(GetArea(oPC))); nHeat=GetLocalInt(oPC,"DH2_HeatLevel"); nHeat=nHeat+1; SetLocalInt(oPC,"DH2_HeatLevel",nHeat); if (nHeat==2) SendMessageToPC(oPC,"You are starting to feel thirsty."); else if (nHeat==3) SendMessageToPC(oPC,"You need a drink of water soon."); else if (nHeat==4) { SendMessageToPC(oPC,"You are extremely thirsty."); ApplyEffectToObject(DURATION_TYPE_INSTANT,eLight,oPC,5.0); } else if (nHeat>4) { // suffer heat problems SendMessageToPC(oPC,"You are suffering from thirst"); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eCon,oPC,140.0); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eMov,oPC,130.0); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eStr,oPC,120.0); ApplyEffectToObject(DURATION_TYPE_INSTANT,eFull,oPC,5.0); ApplyEffectToObject(DURATION_TYPE_INSTANT,eDmg,oPC,1.0); } // suffer heat problems nHeat=GetLocalInt(oPC,"DH2_Intensity"); if (GetIsNight()==TRUE&&GetWaypointByTag("DH2_DAYNIGHT")!=OBJECT_INVALID) nHeat=nHeat*2; DelayCommand(IntToFloat(nHeat),fnHeatEffects(oPC,oArea)); } // still in same area } // fnHeatEffects()