/* 1. Script name: Polydoor
2. what it does: turns a character into a polymorphed character when a door is attacked
3. Notes: place this script in a door's on damaged area

Okay I tried the earlier post about changing an NPC into a penguin when a door was opened, but I wanted the polymorph to happen only when the PC tried the door, as I have many doors that are indesctructible and unopenable (hey, its stupid for an inn to have an open backdoor right? But I didnt want the door to go anywhere), BTW thats a lousy use of plot and I hope Bioware fixes that. Well since I couldn't get it to work that way (or maybe I am just tired) I figured, like me, the PC's would attack the door at least once so I used the on damaged area and came up with this  */



// -------------------------------------------------
// : NWNscript Poly Penguin
// : filename:sc_polydoor
// : Created 30 jun 02 23:40
// : Created by Darryl Sandell
// -------------------------------------------------
// Script to change PC into a polymorphed character
// in this instance a penguin
// when a door is attacked
void main()
{
object oPC = GetLastDamager();
if ( GetIsPC( oPC ) )
{
effect epolymorph = EffectPolymorph(POLYMORPH_TYPE_PENGUIN );
ActionWait(0.5);
ActionCastSpellAtObject( SPELL_POLYMORPH_SELF , oPC);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, epolymorph, oPC, 20.0);
SendMessageToPC(oPC, "You feel like you need a Bud Ice!");
}
}



/* Basically just a one function change and placement into a different call on an placeable. Thank you to the person who posted the original script and I hope this helps someone out. */