mirror of
https://gitea.raptio.us/Jaysyn/PRC_Merges.git
synced 2026-10-29 01:28:31 -04:00
2026/10/01
Updated CEP2 & CEP3 tlks to parity with PRC8 v4.987 Updated CEP2 AI scripts to call PRC events.
This commit is contained in:
1 parent
498312c474
commit
e55d25171f
37 files changed
+2263
-1318
No files matched your search
@@ -9,6 +9,11 @@
|
||||
// Created By: Zarathustra217 //
|
||||
// Created On: Jan 28. 2003 //
|
||||
///////////////////////////////////////////////////
|
||||
#include "prc_inc_spells"
|
||||
#include "prc_inc_sp_tch"
|
||||
|
||||
// object OBJECT_SELF = OBJECT_SELF; <- Just here for testing
|
||||
|
||||
float ConvAngle(float fAngle)
|
||||
{
|
||||
while(fAngle<0.0)
|
||||
@@ -66,8 +71,8 @@ int GetSpellCasterLvl(object oTarget)
|
||||
//Angle relative to beholder calculater
|
||||
float CalcAngle(object oTarget)
|
||||
{
|
||||
float fBangle=GetFacing(oBeholder);
|
||||
vector vBpos=GetPosition(oBeholder);
|
||||
float fBangle=GetFacing(OBJECT_SELF);
|
||||
vector vBpos=GetPosition(OBJECT_SELF);
|
||||
vector vTpos=GetPosition(oTarget);
|
||||
vector vAngelvector=Vector(vTpos.x-vBpos.x,vTpos.y-vBpos.y,0.0);
|
||||
float fAngle=fBangle-VectorToAngle(vAngelvector);
|
||||
@@ -97,48 +102,50 @@ int CalcArc(object oTarget)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
//Ranged touch
|
||||
int RangedTouch(object oTarget,int nBeam)
|
||||
//Ranged touch <-- Using the PRC's PRCDoRangedTouchAttack instead
|
||||
/* int RangedTouch(object oTarget,int nBeam)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget,SpeakString(GetName(oBeholder)+" attemps ranged touch on "+GetName(oTarget)));
|
||||
//AssignCommand(oTarget,SpeakString(GetName(OBJECT_SELF)+" attemps ranged touch on "+GetName(oTarget)));
|
||||
int nDef=10+GetAbilityModifier(ABILITY_DEXTERITY,oTarget);
|
||||
int nAtt=GetAbilityModifier(ABILITY_DEXTERITY,oBeholder)+GetLevelByPosition(1,oBeholder)+GetCreatureSize(oTarget)-3;
|
||||
int nAtt=GetAbilityModifier(ABILITY_DEXTERITY,OBJECT_SELF)+GetLevelByPosition(1,OBJECT_SELF)+PRCGetCreatureSize(oTarget)-3;
|
||||
int nDice=20-Random(20);
|
||||
if(nDice==20)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget,SpeakString("Critical Hit!"+IntToString(nDice)));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,oBeholder,BODY_NODE_CHEST),oTarget,0.50);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,OBJECT_SELF,BODY_NODE_CHEST),oTarget,0.50);
|
||||
return 2;
|
||||
}
|
||||
else if(nDice==1)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget,SpeakString("Miss!"+IntToString(nDice)));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,oBeholder,BODY_NODE_CHEST,TRUE),oTarget,0.50);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,OBJECT_SELF,BODY_NODE_CHEST,TRUE),oTarget,0.50);
|
||||
return 0;
|
||||
}
|
||||
else if(nDef<=nAtt+nDice)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget,SpeakString("Hit!"+IntToString(nDice)));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,oBeholder,BODY_NODE_CHEST),oTarget,0.50);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,OBJECT_SELF,BODY_NODE_CHEST),oTarget,0.50);
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget,SpeakString("Miss!"+IntToString(nDice)));
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,oBeholder,BODY_NODE_CHEST,TRUE),oTarget,0.50);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectBeam(nBeam,OBJECT_SELF,BODY_NODE_CHEST,TRUE),oTarget,0.50);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
//Charm Person function... Some Leeched from nw_s0_charmper
|
||||
void CharmPer(object oTarget)
|
||||
{
|
||||
// SetLocalInt(OBJECT_SELF,"CharmPerUsed",1);
|
||||
if(RangedTouch(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
|
||||
@@ -148,13 +155,13 @@ void CharmPer(object oTarget)
|
||||
//Link persistant effects
|
||||
effect eLink = EffectLinkEffects(eMind, eCharm);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
int nCasterLevel = GetLevelByPosition(1,oBeholder);
|
||||
int nCasterLevel = GetLevelByPosition(1,OBJECT_SELF);
|
||||
int nDuration = 3 + nCasterLevel/3;
|
||||
int nRacial = GetRacialType(oTarget);
|
||||
int nRacial = MyPRCGetRacialType(oTarget);
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHARM_PERSON, FALSE));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Verify that the Racial Type is humanoid
|
||||
if ((nRacial == RACIAL_TYPE_DWARF) ||
|
||||
@@ -180,11 +187,12 @@ void CharmPer(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Charm Monster function... Some Leeched from nw_s0_charmper
|
||||
void CharmMon(object oTarget)
|
||||
{
|
||||
// SetLocalInt(OBJECT_SELF,"CharmMonUsed",1);
|
||||
if(RangedTouch(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eVis = EffectVisualEffect(VFX_IMP_CHARM);
|
||||
@@ -194,12 +202,12 @@ void CharmMon(object oTarget)
|
||||
//Link persistant effects
|
||||
effect eLink = EffectLinkEffects(eMind, eCharm);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
int nCasterLevel = GetLevelByPosition(1,oBeholder);
|
||||
int nCasterLevel = GetLevelByPosition(1,OBJECT_SELF);
|
||||
int nDuration = 3 + nCasterLevel/3;
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_CHARM_PERSON, FALSE));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Will Save check
|
||||
if (WillSave(oTarget,18,SAVING_THROW_TYPE_MIND_SPELLS)==0)
|
||||
@@ -211,11 +219,12 @@ void CharmMon(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Sleep... Some Leeched from nw_s0_charmper and nw_s0_sleep
|
||||
void Sleep(object oTarget)
|
||||
{
|
||||
// SetLocalInt(OBJECT_SELF,"SleepUsed",1);
|
||||
if(RangedTouch(oTarget,VFX_BEAM_ODD)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_ODD)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_LOS_NORMAL_20);
|
||||
@@ -226,12 +235,12 @@ void Sleep(object oTarget)
|
||||
effect eLink = EffectLinkEffects(eSleep, eMind);
|
||||
eLink = EffectLinkEffects(eLink, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eVis);
|
||||
int nCasterLevel = GetLevelByPosition(1,oBeholder);
|
||||
int nCasterLevel = GetLevelByPosition(1,OBJECT_SELF);
|
||||
int nDuration = 3 + nCasterLevel;
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SLEEP));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Will Save check
|
||||
if (WillSave(oTarget,18,SAVING_THROW_TYPE_MIND_SPELLS)==0)
|
||||
@@ -242,10 +251,11 @@ void Sleep(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Flesh To Stone
|
||||
void FleshToStone(object oTarget)
|
||||
{
|
||||
if(RangedTouch(oTarget,VFX_BEAM_ODD)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_ODD)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eImpact = EffectVisualEffect(VFX_FNF_IMPLOSION);
|
||||
@@ -258,22 +268,23 @@ void FleshToStone(object oTarget)
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MAGIC_MISSILE));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Fortitude Save check
|
||||
if (FortitudeSave(oTarget,18)==0)
|
||||
{
|
||||
//Apply impact and linked effects
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
|
||||
SetIsTemporaryNeutral(oTarget,oBeholder,TRUE,600.0);
|
||||
SetIsTemporaryNeutral(oBeholder,oTarget,TRUE,600.0);
|
||||
SetIsTemporaryNeutral(oTarget,OBJECT_SELF,TRUE,600.0);
|
||||
SetIsTemporaryNeutral(OBJECT_SELF,oTarget,TRUE,600.0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Disintegrate(object oTarget)
|
||||
{
|
||||
if(RangedTouch(oTarget,VFX_BEAM_EVIL)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_EVIL)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eSmoke=EffectVisualEffect(VFX_FNF_SMOKE_PUFF);
|
||||
@@ -282,7 +293,7 @@ void Disintegrate(object oTarget)
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MAGIC_MISSILE));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Fortitude Save check
|
||||
int nFort=FortitudeSave(oTarget,18);
|
||||
@@ -299,10 +310,11 @@ void Disintegrate(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Fear
|
||||
void Fear(object oTarget)
|
||||
{
|
||||
if(RangedTouch(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eImpact = EffectVisualEffect(VFX_IMP_FEAR_S);
|
||||
@@ -310,12 +322,12 @@ void Fear(object oTarget)
|
||||
effect eFear =EffectFrightened();
|
||||
effect eLink = EffectLinkEffects(eImpact, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eFear);
|
||||
int nCasterLevel=GetLevelByPosition(1,oBeholder);
|
||||
int nCasterLevel=GetLevelByPosition(1,OBJECT_SELF);
|
||||
int nDuration=nCasterLevel;
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FEAR));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Will Save check
|
||||
if (WillSave(oTarget,18,SAVING_THROW_TYPE_MIND_SPELLS)==0)
|
||||
@@ -323,7 +335,7 @@ void Fear(object oTarget)
|
||||
//Apply impact and linked effects
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget,RoundsToSeconds(nDuration));
|
||||
AssignCommand(oTarget,ClearAllActions());
|
||||
AssignCommand(oTarget,ActionMoveAwayFromObject(oBeholder,TRUE,50.0));
|
||||
AssignCommand(oTarget,ActionMoveAwayFromObject(OBJECT_SELF,TRUE,50.0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -331,7 +343,7 @@ void Fear(object oTarget)
|
||||
//Slow
|
||||
void Slow(object oTarget)
|
||||
{
|
||||
if(RangedTouch(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_HOLY)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eImpact = EffectVisualEffect(VFX_IMP_SLOW);
|
||||
@@ -339,12 +351,12 @@ void Slow(object oTarget)
|
||||
effect eSlow =EffectSlow();
|
||||
effect eLink = EffectLinkEffects(eImpact, eDur);
|
||||
eLink = EffectLinkEffects(eLink, eSlow);
|
||||
int nCasterLevel=GetCasterLevel(oBeholder);
|
||||
int nCasterLevel=PRCGetCasterLevel(OBJECT_SELF);
|
||||
int nDuration=nCasterLevel;
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SLOW));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!PRCDoResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Will Save check
|
||||
if (WillSave(oTarget,18)==0)
|
||||
@@ -355,10 +367,12 @@ void Slow(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Inflict moderate wounds
|
||||
void InflictModerateWounds(object oTarget)
|
||||
{
|
||||
if(RangedTouch(oTarget,VFX_BEAM_FIRE)!=0)
|
||||
//if(RangedTouch(oTarget,VFX_BEAM_FIRE)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_FIRE)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eNeg=EffectVisualEffect(VFX_COM_HIT_NEGATIVE);
|
||||
@@ -369,7 +383,7 @@ void InflictModerateWounds(object oTarget)
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MAGIC_MISSILE));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!ResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Will Save check
|
||||
int nWill=WillSave(oTarget,18);
|
||||
@@ -385,10 +399,11 @@ void InflictModerateWounds(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Finger of death
|
||||
void FingerOfDeath(object oTarget)
|
||||
{
|
||||
if(RangedTouch(oTarget,VFX_BEAM_COLD)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_COLD)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eNeg=EffectVisualEffect(VFX_COM_HIT_NEGATIVE);
|
||||
@@ -399,7 +414,7 @@ void FingerOfDeath(object oTarget)
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_FINGER_OF_DEATH));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!ResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Fortitude Save check
|
||||
int nFort=FortitudeSave(oTarget,18);
|
||||
@@ -415,11 +430,12 @@ void FingerOfDeath(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Telekinesis
|
||||
void Telekinesis(object oTarget)
|
||||
{
|
||||
// SetLocalInt(OBJECT_SELF,"TelekinesisUsed",1);
|
||||
if(RangedTouch(oTarget,VFX_BEAM_ODD)!=0)
|
||||
if(PRCDoRangedTouchAttack(oTarget,VFX_BEAM_ODD)!=0)
|
||||
{
|
||||
//Declare major variables
|
||||
effect eVFX=EffectVisualEffect(VFX_FNF_SCREEN_BUMP);
|
||||
@@ -432,7 +448,7 @@ void Telekinesis(object oTarget)
|
||||
//Fire cast spell at event for the specified target
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_MAGIC_MISSILE));
|
||||
//Make SR Check
|
||||
if (!ResistSpell(oBeholder, oTarget))
|
||||
if (!ResistSpell(OBJECT_SELF, oTarget))
|
||||
{
|
||||
//Make a Will Save check
|
||||
if (WillSave(oTarget,18)==0)
|
||||
@@ -444,6 +460,7 @@ void Telekinesis(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CentalEyeRay(object oTarget)
|
||||
{
|
||||
if(CalcArc(oTarget)==1)
|
||||
@@ -467,7 +484,7 @@ void CentalEyeRay(object oTarget)
|
||||
eTemp=GetNextEffect(oTarget);
|
||||
}
|
||||
//Applies the effects
|
||||
if(!GetIsFriend(oTarget,oBeholder))
|
||||
if(!GetIsFriend(oTarget,OBJECT_SELF))
|
||||
{
|
||||
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_SILENCE));
|
||||
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eLink, oTarget);
|
||||
@@ -503,107 +520,109 @@ void CentalEyeRay(object oTarget)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AssignBestAction()
|
||||
{
|
||||
//Get threat of near enemies.
|
||||
object oNearestE=GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,oBeholder,1,CREATURE_TYPE_IS_ALIVE,TRUE);
|
||||
object oNearestE=GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,OBJECT_SELF,1,CREATURE_TYPE_IS_ALIVE,TRUE);
|
||||
object oTemp=oNearestE;
|
||||
object oFacing=GetLocalObject(OBJECT_SELF,"Facing");
|
||||
int nCount=1;
|
||||
int nCloseEnemy=0;
|
||||
float fPrefDist=10.0;
|
||||
while(GetDistanceBetween(oBeholder,oTemp)<fPrefDist&&oTemp!=OBJECT_INVALID)
|
||||
while(GetDistanceBetween(OBJECT_SELF,oTemp)<fPrefDist&&oTemp!=OBJECT_INVALID)
|
||||
{
|
||||
nCloseEnemy+=(GetLevel(oTemp)-GetSpellCasterLvl(oTemp));
|
||||
nCount++;
|
||||
oTemp=GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,oBeholder,nCount,CREATURE_TYPE_IS_ALIVE,TRUE);
|
||||
oTemp=GetNearestCreature(CREATURE_TYPE_REPUTATION,REPUTATION_TYPE_ENEMY,OBJECT_SELF,nCount,CREATURE_TYPE_IS_ALIVE,TRUE);
|
||||
}
|
||||
//Assign what to do.
|
||||
if(nCloseEnemy<GetLevel(oBeholder))
|
||||
if(nCloseEnemy<GetLevel(OBJECT_SELF))
|
||||
{
|
||||
if(GetLocalInt(OBJECT_SELF,"EyeOpen"))
|
||||
{
|
||||
if(GetDistanceBetween(oBeholder,oFacing)>3.0)
|
||||
if(GetDistanceBetween(OBJECT_SELF,oFacing)>3.0)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString("This position is good!"));
|
||||
//AssignCommand(OBJECT_SELF,SpeakString("This position is good!"));
|
||||
//ID:1
|
||||
if(GetLocalInt(oBeholder,"CurrentAction")!=1)
|
||||
if(GetLocalInt(OBJECT_SELF,"CurrentAction")!=1)
|
||||
{
|
||||
SetLocalInt(oBeholder,"CurrentAction",1);
|
||||
AssignCommand(oBeholder,ClearAllActions());
|
||||
AssignCommand(oBeholder,SetFacingPoint(GetPosition(oFacing)));
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,TRUE));
|
||||
SetLocalInt(OBJECT_SELF,"CurrentAction",1);
|
||||
AssignCommand(OBJECT_SELF,ClearAllActions());
|
||||
AssignCommand(OBJECT_SELF,SetFacingPoint(GetPosition(oFacing)));
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oFacing,TRUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,TRUE));
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oFacing,TRUE));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString("This position is ok!"));
|
||||
//AssignCommand(OBJECT_SELF,SpeakString("This position is ok!"));
|
||||
//ID:2
|
||||
if(GetLocalInt(oBeholder,"CurrentAction")!=2)
|
||||
if(GetLocalInt(OBJECT_SELF,"CurrentAction")!=2)
|
||||
{
|
||||
SetLocalInt(oBeholder,"CurrentAction",2);
|
||||
AssignCommand(oBeholder,ClearAllActions());
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,FALSE));
|
||||
SetLocalInt(OBJECT_SELF,"CurrentAction",2);
|
||||
AssignCommand(OBJECT_SELF,ClearAllActions());
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oFacing,FALSE));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,FALSE));
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oFacing,FALSE));
|
||||
}
|
||||
}
|
||||
//AssignCommand(oBeholder,ActionAttack(oFacing,TRUE));
|
||||
//AssignCommand(OBJECT_SELF,ActionAttack(oFacing,TRUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString("I'll just eat you!"));
|
||||
//AssignCommand(OBJECT_SELF,SpeakString("I'll just eat you!"));
|
||||
//ID:3
|
||||
if(GetLocalInt(oBeholder,"CurrentAction")!=3)
|
||||
if(GetLocalInt(OBJECT_SELF,"CurrentAction")!=3)
|
||||
{
|
||||
SetLocalInt(oBeholder,"CurrentAction",3);
|
||||
AssignCommand(oBeholder,ClearAllActions());
|
||||
AssignCommand(oBeholder,ActionAttack(oNearestE,FALSE));
|
||||
SetLocalInt(OBJECT_SELF,"CurrentAction",3);
|
||||
AssignCommand(OBJECT_SELF,ClearAllActions());
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oNearestE,FALSE));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oNearestE,FALSE));
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oNearestE,FALSE));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString("This position is bad!"));
|
||||
//AssignCommand(OBJECT_SELF,SpeakString("This position is bad!"));
|
||||
//ID:4
|
||||
if(GetLocalInt(oBeholder,"CurrentAction")!=4||GetCurrentAction(oBeholder)!=ACTION_MOVETOPOINT)
|
||||
if(GetLocalInt(OBJECT_SELF,"CurrentAction")!=4||GetCurrentAction(OBJECT_SELF)!=ACTION_MOVETOPOINT)
|
||||
{
|
||||
SetLocalInt(oBeholder,"CurrentAction",4);
|
||||
AssignCommand(oBeholder,ClearAllActions());
|
||||
if(GetDistanceBetween(oBeholder,oFacing)>fPrefDist)
|
||||
SetLocalInt(OBJECT_SELF,"CurrentAction",4);
|
||||
AssignCommand(OBJECT_SELF,ClearAllActions());
|
||||
if(GetDistanceBetween(OBJECT_SELF,oFacing)>fPrefDist)
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,FALSE));
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oFacing,FALSE));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,ActionMoveAwayFromObject(oNearestE,TRUE,1.5*fPrefDist));
|
||||
AssignCommand(OBJECT_SELF,ActionMoveAwayFromObject(oNearestE,TRUE,1.5*fPrefDist));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(GetDistanceBetween(oBeholder,oFacing)>fPrefDist)
|
||||
if(GetDistanceBetween(OBJECT_SELF,oFacing)>fPrefDist)
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,FALSE));
|
||||
AssignCommand(OBJECT_SELF,ActionAttack(oFacing,FALSE));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,ActionMoveAwayFromObject(oNearestE,TRUE,1.5*fPrefDist));
|
||||
AssignCommand(OBJECT_SELF,ActionMoveAwayFromObject(oNearestE,TRUE,1.5*fPrefDist));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//:: void main (){}
|
||||
Binary file not shown.
@@ -0,0 +1,463 @@
|
||||
///////////////////////////////////////////////////
|
||||
// Beholder Ray: On enter //
|
||||
///////////////////////////////////////////////////
|
||||
/*
|
||||
The beholder has a frontal arc, which dispels all magic.
|
||||
In addition each smaller eye also have functions,
|
||||
and luckly these have the same range as the frontal arc.
|
||||
*/
|
||||
///////////////////////////////////////////////////
|
||||
// Created By: Zarathustra217 //
|
||||
// Created On: Okt 7. 2002 //
|
||||
///////////////////////////////////////////////////
|
||||
#include "z217_behold"
|
||||
void main()
|
||||
{
|
||||
object oTarget=GetEnteringObject();
|
||||
object oBeholder=GetAreaOfEffectCreator();
|
||||
if(oTarget!=oBeholder&&(GetIsInCombat(oBeholder)||(GetIsEnemy(oTarget,oBeholder)&&GetObjectSeen(oTarget,oBeholder))))
|
||||
{
|
||||
if(GetLocalInt(oBeholder,"ArcTargetsDone")==0)
|
||||
{
|
||||
//Area Array
|
||||
int nCreatureCount=0;
|
||||
int nCreatureCountE=0;
|
||||
int nCreatureCountESC=0;
|
||||
int nCreatureCountF=0;
|
||||
int nCreatureCountFSC=0;
|
||||
object oTemp=GetFirstInPersistentObject();
|
||||
while(oTemp!=OBJECT_INVALID)
|
||||
{
|
||||
if(oTemp!=oBeholder)
|
||||
{
|
||||
nCreatureCount++;
|
||||
SetLocalObject(OBJECT_SELF,"AreaArray"+IntToString(nCreatureCount),oTemp);
|
||||
if(GetIsEnemy(oTemp,oBeholder))
|
||||
{
|
||||
nCreatureCountE++;
|
||||
SetLocalObject(OBJECT_SELF,"AreaArrayE"+IntToString(nCreatureCountE),oTemp);
|
||||
if(GetSpellCasterLvl(oTemp)>0)
|
||||
{
|
||||
nCreatureCountESC++;
|
||||
SetLocalObject(OBJECT_SELF,"AreaArrayESC"+IntToString(nCreatureCountESC),oTemp);
|
||||
}
|
||||
}
|
||||
else if(GetIsFriend(oTemp,oBeholder))
|
||||
{
|
||||
nCreatureCountF++;
|
||||
SetLocalObject(OBJECT_SELF,"AreaArrayF"+IntToString(nCreatureCountF),oTemp);
|
||||
if(GetSpellCasterLvl(oTemp)>0)
|
||||
{
|
||||
nCreatureCountFSC++;
|
||||
SetLocalObject(OBJECT_SELF,"AreaArrayFSC"+IntToString(nCreatureCountFSC),oTemp);
|
||||
}
|
||||
}
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString(GetName(oTemp)+" is in array."));
|
||||
//AssignCommand(oBeholder,SpeakString(GetName(oTemp)+"'s spellcasterlevel is "+IntToString(GetSpellCasterLvl(oTemp))));
|
||||
}
|
||||
oTemp=GetNextInPersistentObject();
|
||||
}
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString(GetName(oBeholder)+"'s Area Array done."));
|
||||
//Calculate best facing of Beholder
|
||||
int nCount=1;
|
||||
int nMaxPriority=0;
|
||||
int nPriority=0;
|
||||
int nESCInArc=0;
|
||||
int nBestESCInArc=0;
|
||||
object oFacing=oTarget;
|
||||
oTemp=GetLocalObject(OBJECT_SELF,"AreaArrayESC"+IntToString(nCount));
|
||||
while(oTemp!=OBJECT_INVALID)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString("Checks to see if "+GetName(oTemp)+" is a good creature to face."));
|
||||
int nCount2=1;
|
||||
object oTemp2=GetLocalObject(OBJECT_SELF,"AreaArrayESC"+IntToString(nCount2));
|
||||
while(oTemp2!=OBJECT_INVALID)
|
||||
{
|
||||
float fAngle=ConvAngle(CalcAngle(oTemp2)-CalcAngle(oTemp));
|
||||
if(fAngle<45.0||fAngle>315.0)
|
||||
{
|
||||
nPriority+=GetSpellCasterLvl(oTemp2);
|
||||
nESCInArc++;
|
||||
}
|
||||
nCount2++;
|
||||
oTemp2=GetLocalObject(OBJECT_SELF,"AreaArrayESC"+IntToString(nCount2));
|
||||
}
|
||||
nCount2=1;
|
||||
oTemp2=GetLocalObject(OBJECT_SELF,"AreaArrayFSC"+IntToString(nCount2));
|
||||
while(oTemp2!=OBJECT_INVALID)
|
||||
{
|
||||
float fAngle=ConvAngle(CalcAngle(oTemp2)-CalcAngle(oTemp));
|
||||
if(fAngle<45.0||fAngle>315.0)
|
||||
{
|
||||
nPriority-=GetSpellCasterLvl(oTemp2);
|
||||
}
|
||||
nCount2++;
|
||||
oTemp2=GetLocalObject(OBJECT_SELF,"AreaArrayFSC"+IntToString(nCount2));
|
||||
}
|
||||
//Debug String
|
||||
//AssignCommand(oBeholder,SpeakString(GetName(oTemp)+"'s Priority is "+IntToString(nPriority)+"."));
|
||||
|
||||
if(nPriority>nMaxPriority)
|
||||
{
|
||||
oFacing=oTemp;
|
||||
nMaxPriority=nPriority;
|
||||
nBestESCInArc=nESCInArc;
|
||||
}
|
||||
nCount++;
|
||||
oTemp=GetLocalObject(OBJECT_SELF,"AreaArrayESC"+IntToString(nCount));
|
||||
}
|
||||
if(nMaxPriority>0)
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"EyeOpen",1);
|
||||
}
|
||||
SetLocalInt(OBJECT_SELF,"SpellCastersInFacingArc",nBestESCInArc);
|
||||
SetLocalObject(OBJECT_SELF,"Facing",oFacing);
|
||||
AssignCommand(oBeholder,ClearAllActions());
|
||||
AssignCommand(oBeholder,SetFacingPoint(GetPosition(oFacing)));
|
||||
if(GetIsEnemy(oFacing,oBeholder))
|
||||
{
|
||||
if(nBestESCInArc>1&&GetDistanceBetween(oBeholder,oFacing)>5.0&&GetLocalInt(OBJECT_SELF,"EyeOpen"))
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,TRUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,FALSE));
|
||||
}
|
||||
}
|
||||
//Calculate arc targets
|
||||
nCount=1;
|
||||
oTemp=GetLocalObject(OBJECT_SELF,"AreaArrayE"+IntToString(nCount));
|
||||
while (oTemp!=OBJECT_INVALID)
|
||||
{
|
||||
int nArc=CalcArc(oTemp);
|
||||
SetLocalInt(OBJECT_SELF,"ArcTargets"+IntToString(nArc),nCount);
|
||||
nCount++;
|
||||
oTemp=GetLocalObject(OBJECT_SELF,"AreaArrayE"+IntToString(nCount));
|
||||
}
|
||||
if(GetLocalInt(OBJECT_SELF,"EyeOpen"))
|
||||
{
|
||||
AssignCommand(oBeholder,SpeakString(GetName(oBeholder)+" uses it's central eye ray this round."));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,SpeakString(GetName(oBeholder)+" doesn't use it's central eye ray this round."));
|
||||
}
|
||||
SetLocalInt(oBeholder,"ArcTargetsDone",1);
|
||||
}
|
||||
//Rays
|
||||
if(CalcArc(oTarget)==3&&GetIsEnemy(oTarget,oBeholder))
|
||||
{
|
||||
int nArcTargets=GetLocalInt(OBJECT_SELF,"ArcTargets3");
|
||||
int nRaysToBeUsed=4;
|
||||
int nRaysLeft=4-GetLocalInt(OBJECT_SELF,"CharmPerUsed")-GetLocalInt(OBJECT_SELF,"CharmMonUsed")-GetLocalInt(OBJECT_SELF,"InflictModerateWoundsUsed")-GetLocalInt(OBJECT_SELF,"FleshToStoneUsed");
|
||||
if(nArcTargets==2||nArcTargets==3)
|
||||
{
|
||||
nRaysToBeUsed=2;
|
||||
}
|
||||
else if(nArcTargets>3)
|
||||
{
|
||||
nRaysToBeUsed=1;
|
||||
}
|
||||
if(nRaysToBeUsed>nRaysLeft)
|
||||
{
|
||||
nRaysToBeUsed=nRaysLeft;
|
||||
}
|
||||
int nRandom=d4();
|
||||
int nDebug=0;
|
||||
while(nRaysToBeUsed>0&&nDebug<4)
|
||||
{
|
||||
if(nRandom>4)
|
||||
{
|
||||
nRandom=1;
|
||||
}
|
||||
if(nRandom==4)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"CharmPerUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"CharmPerUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,CharmPer(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==3)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"CharmMonUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"CharmMonUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,CharmMon(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==2)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"InflictModerateWoundsUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"InflictModerateWoundsUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,InflictModerateWounds(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==1)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"FleshToStoneUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"FleshToStoneUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,FleshToStone(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
nDebug++;
|
||||
}
|
||||
}
|
||||
else if(CalcArc(oTarget)==4&&GetIsEnemy(oTarget,oBeholder))
|
||||
{
|
||||
int nArcTargets=GetLocalInt(OBJECT_SELF,"ArcTargets4");
|
||||
int nRaysToBeUsed=3;
|
||||
int nRaysLeft=3-GetLocalInt(OBJECT_SELF,"FingerOfDeathUsed")-GetLocalInt(OBJECT_SELF,"FearUsed")-GetLocalInt(OBJECT_SELF,"InflictModerateWoundsUsed");
|
||||
if(nArcTargets==2)
|
||||
{
|
||||
nRaysToBeUsed=2;
|
||||
}
|
||||
else if(nArcTargets>2)
|
||||
{
|
||||
nRaysToBeUsed=1;
|
||||
}
|
||||
if(nRaysToBeUsed>nRaysLeft)
|
||||
{
|
||||
nRaysToBeUsed=nRaysLeft;
|
||||
}
|
||||
int nRandom=d3();
|
||||
int nDebug=0;
|
||||
while(nRaysToBeUsed>0&&nDebug<3)
|
||||
{
|
||||
if(nRandom>3)
|
||||
{
|
||||
nRandom=1;
|
||||
}
|
||||
if(nRandom==3)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"FingerOfDeathUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"FingerOfDeathUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,FingerOfDeath(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==2)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"InflictModerateWoundsUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"InflictModerateWoundsUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,InflictModerateWounds(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==1)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"FearUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"FearUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,Fear(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
nDebug++;
|
||||
}
|
||||
}
|
||||
else if(CalcArc(oTarget)==2&&GetIsEnemy(oTarget,oBeholder))
|
||||
{
|
||||
int nArcTargets=GetLocalInt(OBJECT_SELF,"ArcTargets2");
|
||||
int nRaysToBeUsed=3;
|
||||
int nRaysLeft=3-GetLocalInt(OBJECT_SELF,"FleshToStoneUsed")-GetLocalInt(OBJECT_SELF,"TelekinesisUsed")-GetLocalInt(OBJECT_SELF,"DisintegrateUsed");
|
||||
if(nArcTargets==2)
|
||||
{
|
||||
nRaysToBeUsed=2;
|
||||
}
|
||||
else if(nArcTargets>2)
|
||||
{
|
||||
nRaysToBeUsed=1;
|
||||
}
|
||||
if(nRaysToBeUsed>nRaysLeft)
|
||||
{
|
||||
nRaysToBeUsed=nRaysLeft;
|
||||
}
|
||||
int nRandom=d3();
|
||||
int nDebug=0;
|
||||
while(nRaysToBeUsed>0&&nDebug<3)
|
||||
{
|
||||
if(nRandom>3)
|
||||
{
|
||||
nRandom=1;
|
||||
}
|
||||
if(nRandom==3)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"FleshToStoneUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"FleshToStoneUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,FleshToStone(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==2)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"TelekinesisUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"TelekinesisUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,Telekinesis(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==1)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"DisintegrateUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"DisintegrateUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,Disintegrate(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
nDebug++;
|
||||
}
|
||||
}
|
||||
else if(CalcArc(oTarget)==1&&!GetLocalInt(OBJECT_SELF,"EyeOpen")&&GetIsEnemy(oTarget,oBeholder))
|
||||
{
|
||||
int nArcTargets=GetLocalInt(OBJECT_SELF,"ArcTargets1");
|
||||
int nRaysToBeUsed=4;
|
||||
int nRaysLeft=4-GetLocalInt(OBJECT_SELF,"DisintegrateUsed")-GetLocalInt(OBJECT_SELF,"FigerOfDeathUsed")-GetLocalInt(OBJECT_SELF,"SleepUsed")-GetLocalInt(OBJECT_SELF,"SlowUsed");
|
||||
if(nArcTargets==2||nArcTargets==3)
|
||||
{
|
||||
nRaysToBeUsed=2;
|
||||
}
|
||||
else if(nArcTargets>3)
|
||||
{
|
||||
nRaysToBeUsed=1;
|
||||
}
|
||||
if(nRaysToBeUsed>nRaysLeft)
|
||||
{
|
||||
nRaysToBeUsed=nRaysLeft;
|
||||
}
|
||||
int nRandom=d4();
|
||||
int nDebug=0;
|
||||
while(nRaysToBeUsed>0&&nDebug<4)
|
||||
{
|
||||
if(nRandom>4)
|
||||
{
|
||||
nRandom=1;
|
||||
}
|
||||
if(nRandom==4)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"DisintegrateUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"DisintegrateUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,Disintegrate(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==3)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"FingerOfDeathUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"FingerOfDeathUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,FingerOfDeath(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==2)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"SleepUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"SleepUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,Sleep(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
else if(nRandom==1)
|
||||
{
|
||||
if(!GetLocalInt(OBJECT_SELF,"SlowUsed"))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"SlowUsed",1);
|
||||
float fCurrentDelay=GetLocalFloat(OBJECT_SELF,"RayDelay");
|
||||
DelayCommand(fCurrentDelay,Slow(oTarget));
|
||||
nRaysToBeUsed--;
|
||||
nRandom++;
|
||||
fCurrentDelay=fCurrentDelay+0.2;
|
||||
SetLocalFloat(OBJECT_SELF,"RayDelay",fCurrentDelay);
|
||||
}
|
||||
}
|
||||
nDebug++;
|
||||
}
|
||||
}
|
||||
//Central eye ray
|
||||
if(GetLocalInt(OBJECT_SELF,"EyeOpen"))
|
||||
{
|
||||
CentalEyeRay(oTarget);
|
||||
DelayCommand(0.5,CentalEyeRay(oTarget));
|
||||
DelayCommand(1.0,CentalEyeRay(oTarget));
|
||||
DelayCommand(1.5,CentalEyeRay(oTarget));
|
||||
DelayCommand(2.0,CentalEyeRay(oTarget));
|
||||
DelayCommand(2.5,CentalEyeRay(oTarget));
|
||||
DelayCommand(3.0,CentalEyeRay(oTarget));
|
||||
DelayCommand(3.5,CentalEyeRay(oTarget));
|
||||
DelayCommand(4.0,CentalEyeRay(oTarget));
|
||||
DelayCommand(4.5,CentalEyeRay(oTarget));
|
||||
DelayCommand(5.0,CentalEyeRay(oTarget));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,39 @@
|
||||
///////////////////////////////////////////////////
|
||||
// Beholder Ray: On exit //
|
||||
///////////////////////////////////////////////////
|
||||
/*
|
||||
Removes the silence effect caused by the
|
||||
beholder's central eye ray.
|
||||
*/
|
||||
///////////////////////////////////////////////////
|
||||
// Created By: Zarathustra217 //
|
||||
// Created On: Okt 7. 2002 //
|
||||
///////////////////////////////////////////////////
|
||||
#include "NW_I0_SPELLS"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oTarget = GetExitingObject();
|
||||
int bValid = FALSE;
|
||||
effect eAOE;
|
||||
eAOE = GetFirstEffect(oTarget);
|
||||
while (GetIsEffectValid(eAOE) && bValid == FALSE)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget, SpeakString("Effect is valid"));
|
||||
if (GetEffectCreator(eAOE) == GetAreaOfEffectCreator())
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget, SpeakString("Effect creator is true"));
|
||||
if(GetEffectType(eAOE) == EFFECT_TYPE_SILENCE)
|
||||
{
|
||||
//Debug String
|
||||
//AssignCommand(oTarget, SpeakString("Effect type is silence"));
|
||||
//AssignCommand(oTarget, SpeakString("Removing effects"));
|
||||
RemoveEffect(oTarget, eAOE);
|
||||
bValid = TRUE;
|
||||
}
|
||||
}
|
||||
eAOE = GetNextEffect(oTarget);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
///////////////////////////////////////////////////
|
||||
// Beholder Ray: On Heartbeat //
|
||||
///////////////////////////////////////////////////
|
||||
/*
|
||||
The persistent area of effect is destroyed each
|
||||
round and recreated if needed...
|
||||
*/
|
||||
///////////////////////////////////////////////////
|
||||
// Created By: Zarathustra217 //
|
||||
// Created On: Okt 7. 2002 //
|
||||
///////////////////////////////////////////////////
|
||||
#include "NW_I0_SPELLS"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oBeholder = GetAreaOfEffectCreator();
|
||||
object oFacing=GetLocalObject(OBJECT_SELF,"Facing");
|
||||
if(GetIsInCombat(oBeholder))
|
||||
{
|
||||
if(!GetIsDead(oBeholder)||!GetIsObjectValid(oBeholder)||!GetIsDead(oFacing)||!GetIsObjectValid(oFacing))
|
||||
{
|
||||
AssignCommand(oBeholder,ClearAllActions());
|
||||
AssignCommand(oBeholder,SetFacingPoint(GetPosition(oFacing)));
|
||||
int nESCInFacingArc=GetLocalInt(OBJECT_SELF,"SpellCastersInFacingArc");
|
||||
if(GetIsEnemy(oFacing,oBeholder))
|
||||
{
|
||||
if(nESCInFacingArc>1&&GetDistanceBetween(oBeholder,oFacing)>5.0&&GetLocalInt(OBJECT_SELF,"EyeOpen"))
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,TRUE));
|
||||
}
|
||||
else
|
||||
{
|
||||
AssignCommand(oBeholder,ActionAttack(oFacing,FALSE));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DestroyObject(OBJECT_SELF, 0.0);
|
||||
}
|
||||
|
||||
Binary file not shown.
@@ -13,9 +13,12 @@
|
||||
//:: Modified by Zarathstra217
|
||||
//:://////////////////////////////////////////////
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "inc_utility"
|
||||
|
||||
void main()
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF,"ArcTargetsDone",0);
|
||||
ExecuteScript("prc_npc_hb", OBJECT_SELF);
|
||||
effect eAOE = EffectAreaOfEffect(50);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100));
|
||||
if(GetSpawnInCondition(NW_FLAG_FAST_BUFF_ENEMY))
|
||||
@@ -48,7 +51,7 @@ void main()
|
||||
}
|
||||
}
|
||||
|
||||
if(!GetHasEffect(EFFECT_TYPE_SLEEP))
|
||||
if(!PRCGetHasEffect(EFFECT_TYPE_SLEEP))
|
||||
{
|
||||
if(!GetIsPostOrWalking())
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -18,7 +18,9 @@
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPercieved=GetLastPerceived();
|
||||
ExecuteScript("prc_npc_percep", OBJECT_SELF);
|
||||
|
||||
object oPercieved=GetLastPerceived();
|
||||
if(GetIsEnemy(oPercieved)&&!GetIsInCombat()&&!GetIsFighting(OBJECT_SELF))
|
||||
{
|
||||
ActionAttack(oPercieved);
|
||||
|
||||
Binary file not shown.
@@ -15,6 +15,7 @@
|
||||
#include "NW_I0_GENERIC"
|
||||
void main()
|
||||
{
|
||||
ExecuteScript("prc_npc_combat", OBJECT_SELF);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -21,6 +21,8 @@ void main()
|
||||
int nMatch = GetListenPatternNumber();
|
||||
object oShouter = GetLastSpeaker();
|
||||
object oIntruder;
|
||||
|
||||
ExecuteScript("prc_npc_conv", OBJECT_SELF);
|
||||
|
||||
if (nMatch == -1 && GetCommandable(OBJECT_SELF))
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -16,7 +16,9 @@
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
void main()
|
||||
{/*
|
||||
{
|
||||
ExecuteScript("prc_npc_physatt", OBJECT_SELF);
|
||||
/*
|
||||
if(!GetFleeToExit())
|
||||
{
|
||||
if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS))
|
||||
|
||||
Binary file not shown.
@@ -16,7 +16,9 @@
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
void main()
|
||||
{/*
|
||||
{
|
||||
ExecuteScript("prc_npc_damaged", OBJECT_SELF);
|
||||
/*
|
||||
if(!GetFleeToExit())
|
||||
{
|
||||
if(!GetSpawnInCondition(NW_FLAG_SET_WARNINGS))
|
||||
|
||||
Binary file not shown.
@@ -15,7 +15,8 @@
|
||||
|
||||
void main()
|
||||
{
|
||||
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
|
||||
|
||||
int nClass = GetLevelByClass(CLASS_TYPE_COMMONER);
|
||||
int nAlign = GetAlignmentGoodEvil(OBJECT_SELF);
|
||||
if(nClass > 0 && (nAlign == ALIGNMENT_GOOD || nAlign == ALIGNMENT_NEUTRAL))
|
||||
{
|
||||
@@ -30,4 +31,7 @@ void main()
|
||||
{
|
||||
SignalEvent(OBJECT_SELF, EventUserDefined(1007));
|
||||
}
|
||||
|
||||
ExecuteScript("prc_npc_death", OBJECT_SELF);
|
||||
//ExecuteScript("prc_pwondeath", OBJECT_SELF);
|
||||
}
|
||||
Binary file not shown.
@@ -19,7 +19,10 @@
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
void main()
|
||||
{/*
|
||||
{
|
||||
|
||||
ExecuteScript("prc_npc_disturb", OBJECT_SELF);
|
||||
/*
|
||||
object oTarget = GetLastDisturbed();
|
||||
|
||||
if(!GetIsObjectValid(GetAttemptedAttackTarget()) && !GetIsObjectValid(GetAttemptedSpellTarget()))
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,4 @@
|
||||
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default: On Spawn In
|
||||
//:: NW_C2_DEFAULT9
|
||||
@@ -74,6 +75,7 @@ void main()
|
||||
SetLocalInt(OBJECT_SELF,"ArcTargetsDone",0);
|
||||
effect eAOE = EffectAreaOfEffect(50);
|
||||
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eAOE, OBJECT_SELF, HoursToSeconds(100));
|
||||
ExecuteScript("prc_npc_spawn", OBJECT_SELF);
|
||||
}
|
||||
|
||||
|
||||
Binary file not shown.
@@ -15,7 +15,7 @@
|
||||
void main()
|
||||
{
|
||||
// enter desired behaviour here
|
||||
|
||||
ExecuteScript("prc_npc_rested", OBJECT_SELF);
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -16,7 +16,9 @@
|
||||
#include "NW_I0_GENERIC"
|
||||
|
||||
void main()
|
||||
{/*
|
||||
{
|
||||
ExecuteScript("prc_npc_spellat", OBJECT_SELF);
|
||||
/*
|
||||
object oCaster = GetLastSpellCaster();
|
||||
if(GetLastSpellHarmful())
|
||||
{
|
||||
|
||||
Binary file not shown.
@@ -15,7 +15,7 @@
|
||||
void main()
|
||||
{
|
||||
// enter desired behaviour here
|
||||
ExecuteScript("prc_npc_userdef", OBJECT_SELF);
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -1,5 +1,5 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: Default On Heartbeat
|
||||
//:: Default On Blocked
|
||||
//:: NW_C2_DEFAULTE
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
@@ -18,6 +18,8 @@ object oBeholder=GetAreaOfEffectCreator();
|
||||
void main()
|
||||
{
|
||||
object oDoor = GetBlockingDoor();
|
||||
|
||||
ExecuteScript("prc_npc_blocked", OBJECT_SELF);
|
||||
|
||||
if(GetAbilityScore(OBJECT_SELF, ABILITY_INTELLIGENCE) >= 5)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user