1. Script Name: Werewolf Transformation
2. What it does: Transform any NPC into a Werewolf at night and back to the
original NPC by day.
3. Notes: two nice effects on the transformation. A haunting howl and then they
burst open, blood and bone everywhere. Out of the carnage burst the Werewolves.
They even seem to stretch as they appear as though they were cramped inside
those puny Human bodies.
//::///////////////////////////////////////////////
//:: Name: Werewolf Transformation
//:: FileName: werewolf_heart
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
Transform any NPC into a Werewolf at night
and back to the original NPC by day.
*/
//:://////////////////////////////////////////////
//:: Created By: VorpalBlade
//:: Created On: 7/25/02
//:://////////////////////////////////////////////
// Create an NPC and a Werewolf template with the
// Creature Wizard and add this to the OnHeartbeat
// event of both. Then name the Tag of the NPC with
// ResRef of the Werewolf and the Tag of the Werewolf
// with the ResRef of the NPC. Make sure the Name of
// the Werewolf is "Werewolf".
// Do this for each NPC/Werewolf pair you would like
// in your module, so there is a template for each
// NPC and Werewolf.
// Any changes you make to these must be made to the
// templates or they will be lost after the
// transformation.
void ChangeWerewolf(object oObject, string sTemp);
void ChangeTo(string sTemp, location lLoc);
void main()
{
int bDay = GetIsDay();
string sMyName = GetName(OBJECT_SELF);
string sChangeTo = GetTag(OBJECT_SELF);
object oMe = OBJECT_SELF;
// If I'm a man and its night or I'm a WW and it is day.
if (((sMyName != "Werewolf") && (!bDay)) || ((sMyName == "Werewolf") && (bDay))){
AssignCommand(GetModule(), ChangeWerewolf(oMe, sChangeTo)); // Sent to module.
}
// Sent to module because the DestroyObject(OBJECT_SELF) command
// Would kill the script before the other can be created.
}
void ChangeWerewolf(object oObject, string sTemp)
{
// Save the location of the Man/WW and destroy it and spawn it's counterpart.
effect eVis = EffectVisualEffect(VFX_FNF_HOWL_MIND);
location lLoc = GetLocation(oObject);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, lLoc, 2.0f);
DestroyObject(oObject);
DelayCommand(0.5f, ChangeTo(sTemp, lLoc));
}
void ChangeTo(string sTemp, location lLoc)
{
CreateObject(OBJECT_TYPE_CREATURE, sTemp, lLoc);
effect eVis = EffectVisualEffect(VFX_COM_CHUNK_RED_SMALL);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, lLoc, 2.0f);
}