///////////////////////////////////////////////////////////////// ////:: Cold Frost Damage OnAreaEnter Script /////////////// ////:: Created By: Mathew Edwards - aka DCMage /////////////// ////:: Created On: 11 July 2003 /////////////// ///////////////////////////////////////////////////////////////// // This script deals d2 of Positive Energy Damage OnEnter and 1 Damage every 10 seconds // there after to any persons in the specified Area/Areas. The higher the level // area the higher the damage will need to be to counter act any resistances a // PC may have. void RunColdFrost(int nSecondsRemaining, object oTarget); void main() { //Declare major variables object oTarget = GetEnteringObject(); if (!GetIsPC(oTarget)) return; object oGear = GetItemPossessedBy(oTarget,"GemofWarming"); int nDamage; effect eDam; string sImmuneItem = "GemofWarming"; // Place ITEM ResRef here that negates effects effect eVis = EffectVisualEffect(VFX_IMP_HEAD_COLD); int nDuration = GetHitDice(oTarget) / 5; //figure out timing float fDelay = 10.0f; //Check that there is at least one payload damage if (nDuration < 1) { nDuration = 1; } { // Check to see if PC has said item in invo if so avoids effects of Cold Frost if (GetItemPossessedBy(oTarget, "GemofWarming")!= OBJECT_INVALID) { SendMessageToPC(oTarget, "The cold does not effect you"); } else { //Roll initial damage nDamage = d2(); // CHANGE THIS FROM d2 TO WHAT EVER DICE ROLL YOU WANT FOR DAMAGE E.G d6(2) IS 2d6 //Set the initial damage effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD); //Apply the inital VFX impact and damage effect DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget)); DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget)); //Apply the bonus damage nDuration = nDuration * 6; DelayCommand(6.0, RunColdFrost(nDuration, oTarget)); } } } void RunColdFrost(int nSecondsRemaining, object oTarget) { object oTarget = GetEnteringObject(); if (GetIsDead(oTarget) == FALSE) { if (nSecondsRemaining % 6 == 0) { //Roll damage int nDamage = 55; // CHANGE THIS FROM 1 DAM TO WHATEVER YOU NEED DO NOT USE DICE ROLLS ONLY NUMBERS effect eDam = EffectDamage(nDamage, DAMAGE_TYPE_COLD); effect eVis = EffectVisualEffect(VFX_IMP_HEAD_COLD); ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget); ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget); SendMessageToPC(oTarget, "You are slowly freezing to death"); } --nSecondsRemaining; if (nSecondsRemaining > 0) { DelayCommand(1.0f, RunColdFrost(nSecondsRemaining, oTarget)); } } }