Aller au contenu

Photo

need a bit of help please : should be easy 4 a good scripter


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
dickel

dickel
  • Members
  • 72 messages
{

object oPC = GetLastKiller();

while (GetIsObjectValid(GetMaster(oPC)))
   {
   oPC=GetMaster(oPC);
   }

if (!GetIsPC(oPC)) return;

}

This is all I could get from Lilac's generator for the script I am after.

Basically i'd like the script to be placed on the death of an object which then switches the immortal state on an npc to false. The above script just gets the last killer of the object (which hopefully includes any companions making the kill). I'm just not sure how to then tell it to switch the immortal state of the npc with tag  "c_realcptnskr", to false.

Any assistance with this would be awesome. Thanks n peace.:wizard:

ps- if anyone is feeling paticularly creative, I was going to also incorporate (via lilac's) a small magical explosion of some sort when the object gets destroyed ( maybe a waypoint at it's location for a vfx spawn?) and possibly a line of dialogue spoken by the above npc mentioned. (c_realcptnskr)
....such as:

"damn you for breaking my magical and most significant object that i love so much" etc etc.
:P

Modifié par dickel, 13 mars 2011 - 12:05 .


#2
painofdungeoneternal

painofdungeoneternal
  • Members
  • 1 799 messages
Untested...
void main()
{
	object oKiller = GetLastKiller();
	object oDead = OBJECT_SELF;
	object oCptnskr = GetObjectByTag("c_realcptnskr");
	
	// effect e2 = EffectVisualEffect( VFX_DUR_CUTSCENE_INVISIBILITY );
	// ApplyEffectToObject(DURATION_TYPE_PERMANENT, e2, oDead);
	effect eExplode = EffectVisualEffect( VFX_HIT_AOE_MAGIC );
	ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eExplode, GetLocation( oDead) );
	
	if ( GetIsObjectValid( oCptnskr ) )
	{
		AssignCommand( oCptnskr, SpeakString("damn you for breaking my magical and most significant object that i love so much", TALKVOLUME_TALK) );
		SetImmortal(oCptnskr, FALSE);

     }   
        
}


#3
dickel

dickel
  • Members
  • 72 messages
Thanks Pain,
Worked like a charm :D
Well done too, considering it was untested.