Author Topic: Angel script needs some modifacation  (Read 365 times)

Legacy_Builder_Anthony

  • Hero Member
  • *****
  • Posts: 786
  • Karma: +0/-0
Angel script needs some modifacation
« on: April 25, 2011, 04:51:12 am »


               I released this to the vault sometime ago but it needs some adjustments.Currently the angel awalys spawns in when you enter a trigger.Id like it to be a 50 50 chance.And im almost postive when the angel casts spells they are not affecting the pc it like its a fake spell.Could someone edit it for me its a cool script ......feel free to use it i did alot of tweaking to it to make it fly in and out nice.
void SpeakRandomLine(object oCreature);
void DivineDestruction(object oOrigin, object oFriend);
void main()
{
object oPC = GetEnteringObject();
if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL)
   return;
if (!GetIsPC(oPC)) return;
if (d100()>20)
   return;
location lTarget = GetLocation(oPC);
if (!GetIsPC(oPC)) return;
object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "angel", lTarget, TRUE);
SetWeather(GetArea(oPC), WEATHER_CLEAR);
DelayCommand(0.1, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUNBEAM), GetLocation(oSpawn)));
AssignCommand(oSpawn, ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED));
AssignCommand(oSpawn, ActionForceMoveToLocation(lTarget));
DelayCommand(4.8, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_BLINDDEAF), GetLocation(oSpawn)));
DelayCommand(5.0, DivineDestruction(oSpawn, oPC));
DelayCommand(9.0, AssignCommand(oSpawn, ActionCastSpellAtObject(SPELL_MASS_HEAL, oPC, METAMAGIC_ANY, TRUE)));
DelayCommand(12.0, AssignCommand(oSpawn, ActionCastSpellAtObject(SPELL_LEGEND_LORE, oPC, METAMAGIC_ANY, TRUE)));
DelayCommand(8.5,SpeakRandomLine(oSpawn));
DelayCommand(14.5, AssignCommand(oSpawn, ClearAllActions()));
DelayCommand(15.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDisappear(), oSpawn));
}
void SpeakRandomLine(object oCreature)
{
switch( d20())
  {
    case 1: AssignCommand(oCreature, ActionSpeakString("Take my blessings brave hero.")); break;
    case 2: AssignCommand(oCreature, ActionSpeakString("Show caution as well as courage; this is all the aid I can give")); break;
    case 3: AssignCommand(oCreature, ActionSpeakString("May heaven guide your steps")); break;
    case 4: AssignCommand(oCreature, ActionSpeakString("Your strength is renewed.Go forth without fear")); break;
    case 5: AssignCommand(oCreature, ActionSpeakString("May we meet again by the silver shores")); break;
    case 6: AssignCommand(oCreature, ActionSpeakString("Fair winds to you, mortals,I have done all I can")); break;
    case 7: AssignCommand(oCreature, ActionSpeakString("Show caution as well as courage")); break;
    case 8: AssignCommand(oCreature, ActionSpeakString("")); break;
    case 9: AssignCommand(oCreature, ActionSpeakString("")); break;
    case 10: AssignCommand(oCreature, ActionSpeakString("")); break;
    case 11: AssignCommand(oCreature, ActionSpeakString("")); break;
    case 12: AssignCommand(oCreature, ActionSpeakString("")); break;
    case 13: AssignCommand(oCreature, ActionSpeakString("")); break;
    case 14: AssignCommand(oCreature, ActionSpeakString("")); break;
    case 15: AssignCommand(oCreature, ActionSpeakString("Let not your heart be troubled")); break;
    case 16: AssignCommand(oCreature, ActionSpeakString("Your silent cries for aid have been answered")); break;
    case 17: AssignCommand(oCreature, ActionSpeakString("Your suffering was heard, and thus was I sent")); break;
    case 18: AssignCommand(oCreature, ActionSpeakString("Be at peace")); break;
    case 19: AssignCommand(oCreature, ActionSpeakString("Even as you have been touched by me, so I have been touched by your pain")); break;
    case 20: AssignCommand(oCreature, ActionSpeakString("I have healed your body. It is up to you to heal your soul")); break;
  }
}
void DivineDestruction(object oOrigin, object oFriend)
{
location lOrigin = GetLocation(oOrigin);
effect eVFX = EffectVisualEffect(VFX_IMP_PULSE_WIND);
effect eDamage;
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 850.0, lOrigin);
while(GetIsObjectValid(oTarget))
    {
    if(GetIsEnemy(oTarget, oFriend))
        {
        eDamage = EffectDamage(GetCurrentHitPoints(oTarget), DAMAGE_TYPE_DIVINE);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
        }
    oTarget = GetNextObjectInShape(SHAPE_SPHERE, 850.0, lOrigin);
    }
}
               
               

               
            

Legacy_Greyfort

  • Sr. Member
  • ****
  • Posts: 442
  • Karma: +0/-0
Angel script needs some modifacation
« Reply #1 on: April 25, 2011, 11:12:51 pm »


               // angel_trg_ent
// Builder_Anthony
/*
I released this to the vault sometime ago but it needs some adjustments.
Currently the angel awalys spawns in when you enter a trigger.Id like it to be
a 50 50 chance.And im almost postive when the angel casts spells they are not
affecting the pc it like its a fake spell.Could someone edit it for me its a
cool script ......feel free to use it i did alot of tweaking to it to make it
fly in and out nice
*/

// custom random speak
void SpeakRandomLine(object oCreature);

// custom effect
void DivineDestruction(object oOrigin, object oFriend);


/////////////////////[ MAIN ]/////////////////////////////////////////
void main()
{
object oPC = GetEnteringObject();
if (GetAlignmentGoodEvil(oPC) == ALIGNMENT_EVIL){   return;}

if (!GetIsPC(oPC)) {return;}
// this your random roll Correct?
if (d100()>51){   return; }
//debug
FloatingTextStringOnCreature("Roll= Succses",oPC,FALSE);

// another way to get random roll
//debug
//int nRoll = Random(100)+1;//this 0-99 +1 [1 to 100]
//FloatingTextStringOnCreature("Roll= "+IntToString(nRoll)+"",oPC,FALSE);
//if (nRoll >= 51){return;}

location lTarget = GetLocation(oPC);
if (!GetIsPC(oPC)){ return; }

object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "angel", lTarget, TRUE);
SetWeather(GetArea(oPC), WEATHER_CLEAR);
DelayCommand(0.1, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUNBEAM), GetLocation(oSpawn)));
AssignCommand(oSpawn, ActionPlayAnimation(ANIMATION_FIREFORGET_PAUSE_BORED));
AssignCommand(oSpawn, ActionForceMoveToLocation(lTarget));
DelayCommand(4.8, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_BLINDDEAF), GetLocation(oSpawn)));
DelayCommand(5.0, DivineDestruction(oSpawn, oPC));
// note for mass heal to work they must be allys ie same faction   METAMAGIC_ANY                   METAMAGIC_NONE
DelayCommand(9.0, AssignCommand(oSpawn, ActionCastSpellAtObject(SPELL_MASS_HEAL, oPC, METAMAGIC_NONE, TRUE,40,PROJECTILE_PATH_TYPE_DEFAULT)));
DelayCommand(12.0, AssignCommand(oSpawn, ActionCastSpellAtObject(SPELL_LEGEND_LORE, oPC, METAMAGIC_NONE, TRUE,40,PROJECTILE_PATH_TYPE_DEFAULT)));
DelayCommand(8.5,SpeakRandomLine(oSpawn));
DelayCommand(14.5, AssignCommand(oSpawn, ClearAllActions()));
DelayCommand(15.0, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDisappear(), oSpawn));

/////////////////////////[ END OF MAIN SCRIPT ]/////////////////////////////
}

void SpeakRandomLine(object oCreature)
{
switch( d20())
 {
   case 1: AssignCommand(oCreature, ActionSpeakString("Take my blessings brave hero.")); break;
   case 2: AssignCommand(oCreature, ActionSpeakString("Show caution as well as courage; this is all the aid I can give")); break;
   case 3: AssignCommand(oCreature, ActionSpeakString("May heaven guide your steps")); break;
   case 4: AssignCommand(oCreature, ActionSpeakString("Your strength is renewed.Go forth without fear")); break;
   case 5: AssignCommand(oCreature, ActionSpeakString("May we meet again by the silver shores")); break;
   case 6: AssignCommand(oCreature, ActionSpeakString("Fair winds to you, mortals,I have done all I can")); break;
   case 7: AssignCommand(oCreature, ActionSpeakString("Show caution as well as courage")); break;
   case 8: AssignCommand(oCreature, ActionSpeakString("")); break;
   case 9: AssignCommand(oCreature, ActionSpeakString("")); break;
   case 10: AssignCommand(oCreature, ActionSpeakString("")); break;
   case 11: AssignCommand(oCreature, ActionSpeakString("")); break;
   case 12: AssignCommand(oCreature, ActionSpeakString("")); break;
   case 13: AssignCommand(oCreature, ActionSpeakString("")); break;
   case 14: AssignCommand(oCreature, ActionSpeakString("")); break;
   case 15: AssignCommand(oCreature, ActionSpeakString("Let not your heart be troubled")); break;
   case 16: AssignCommand(oCreature, ActionSpeakString("Your silent cries for aid have been answered")); break;
   case 17: AssignCommand(oCreature, ActionSpeakString("Your suffering was heard, and thus was I sent")); break;
   case 18: AssignCommand(oCreature, ActionSpeakString("Be at peace")); break;
   case 19: AssignCommand(oCreature, ActionSpeakString("Even as you have been touched by me, so I have been touched by your pain")); break;
   case 20: AssignCommand(oCreature, ActionSpeakString("I have healed your body. It is up to you to heal your soul")); break;
 }
}

void DivineDestruction(object oOrigin, object oFriend)
{
location lOrigin = GetLocation(oOrigin);
effect eVFX = EffectVisualEffect(VFX_IMP_PULSE_WIND);
effect eDamage;
object oTarget = GetFirstObjectInShape(SHAPE_SPHERE, 850.0, lOrigin);
while(GetIsObjectValid(oTarget))
   {
   if(GetIsEnemy(oTarget, oFriend))
       {
       eDamage = EffectDamage(GetCurrentHitPoints(oTarget), DAMAGE_TYPE_DIVINE);
       ApplyEffectToObject(DURATION_TYPE_INSTANT, eVFX, oTarget);
       ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
       }
   oTarget = GetNextObjectInShape(SHAPE_SPHERE, 850.0, lOrigin);
   }
}

i didn't realy alter much showed ya another option for random 50/50 chance.  I have an Idea on how to get the angel to be part of your party so mass heal will work. will try to post that.  I'm a little confused on why the legond lore doesn't work.  I will keep looking.