//:://///////////////////////////////////////////// //:: Name x2_def_userdef //:: Copyright (c) 2001 Bioware Corp. //::////////////////////////////////////////////// /* Default On User Defined Event script */ //::////////////////////////////////////////////// //:: Created By: Keith Warner //:: Created On: June 11/03 //:://///////////////////////////////////////////// #include "jw_nun_gelc_func" #include "NW_I0_GENERIC" #include "jw_privates_inc" const int EVENT_USER_DEFINED_PRESPAWN = 1510; const int EVENT_USER_DEFINED_POSTSPAWN = 1511; void main() { ExecuteScript("prc_npc_userdef", OBJECT_SELF); int nUser = GetUserDefinedEventNumber(); if(nUser == EVENT_HEARTBEAT ) //HEARTBEAT { // * Only on the first heartbeat, destroy the creature's personal space if (!GetLocalInt(OBJECT_SELF,"X2_L_GCUBE_SETUP")) { effect eGhost = EffectCutsceneGhost(); eGhost = SupernaturalEffect(eGhost); ApplyEffectToObject(DURATION_TYPE_PERMANENT,eGhost,OBJECT_SELF); SetLocalInt(OBJECT_SELF,"X2_L_GCUBE_SETUP",TRUE) ; } // Do nasty things to anything in the cube object oVictim = GetFirstObjectInShape(SHAPE_CUBE,4.0f,GetLocation(OBJECT_SELF),TRUE, OBJECT_TYPE_CREATURE); while (GetIsObjectValid(oVictim)) { if (GetIsEnemy(oVictim,OBJECT_SELF)) { JWEngulfAndDamage(oVictim,OBJECT_SELF); } if (GetIsEnemy(oVictim,OBJECT_SELF)&&GetIsDeadOrBleeding(oVictim)) { PlaySound("as_an_sludggurg2"); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_GLOW_GREEN),oVictim,10.0); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectVisualEffect(VFX_DUR_GHOST_SMOKE_2),oVictim,10.0); } oVictim = GetNextObjectInShape(SHAPE_CUBE,4.0f,GetLocation(OBJECT_SELF),TRUE, OBJECT_TYPE_CREATURE); } } else if(nUser == EVENT_PERCEIVE) // PERCEIVE { } else if(nUser == EVENT_END_COMBAT_ROUND) // END OF COMBAT { object oVictim=GetVictim(); if (GetIsObjectValid(oVictim)&&!GetIsDeadOrBleeding(oVictim)&&GetObjectSeen(oVictim)&&(GetDistanceToObject(oVictim)>4.0)&&(d2()==1)) { int nDC=14+GetHitDice(OBJECT_SELF); if (ReflexSave(oVictim,nDC, SAVING_THROW_TYPE_POISON) == 0) { //// Reflex save failed // Pull the victim over int nBeam=VFX_BEAM_CHAIN; effect eBeam=EffectBeam(nBeam,OBJECT_SELF,BODY_NODE_CHEST); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oVictim,2.0); string sSound="cb_sw_chain2"; if (d2()==1) { sSound="cb_sw_chain1"; } AssignCommand(oVictim,PlaySound(sSound)); DelayCommand(1.0,JWPullOver(oVictim)); DelayCommand(1.4,JWEngulfOnly(oVictim,OBJECT_SELF)); } } else { /// Reflex save succeedded int nBeam=VFX_BEAM_CHAIN; effect eBeam=EffectBeam(nBeam,OBJECT_SELF,BODY_NODE_CHEST); ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oVictim,0.5); string sSound="cb_sw_chain2"; if (d2()==1) { sSound="cb_sw_chain1"; } AssignCommand(oVictim,PlaySound(sSound)); } } else if(nUser == EVENT_DIALOGUE) // ON DIALOGUE { } else if(nUser == EVENT_ATTACKED) // ATTACKED { } else if(nUser == EVENT_DAMAGED) // DAMAGED { } else if(nUser == 1007) // DEATH - do not use for critical code, does not fire reliably all the time { ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_CHUNK_YELLOW_MEDIUM),OBJECT_SELF); ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_CHUNK_BONE_MEDIUM),OBJECT_SELF); DelayCommand(0.3,ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_COM_CHUNK_YELLOW_SMALL),OBJECT_SELF)); //Declare major variables, including the Area of Effect object. effect eAOE = EffectAreaOfEffect(AOE_PER_FOGSTINK,"jw_gcubeaoe_ent","jw_gcubeaoe_hb","jw_gcubeaoe_ex"); //Capture the spell target location so that the AoE object can be created. location lTarget = GetLocation(OBJECT_SELF); int nDuration = 6; effect eImpact = EffectVisualEffect(257); // Acid explosion DelayCommand(0.5,ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eImpact, lTarget)); //Create the object at the location so that the objects scripts will start working. DelayCommand(0.5,ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eAOE, lTarget, RoundsToSeconds(nDuration))); } else if(nUser == EVENT_DISTURBED) // DISTURBED { } else if (nUser == EVENT_USER_DEFINED_PRESPAWN) { } else if (nUser == EVENT_USER_DEFINED_POSTSPAWN) { } }