Sie sind auf Seite 1von 2

//File name: at_cutscene

//Created by: Shawn Lucas


//Created on: February 21, 2008

/*This script goes in the "valkaya" conversation file. Two goblin shamans appear
& cast magic at Valkaya. The 1st attack misses. Valkaya counters with her own
magic & kills 1st goblin. 2nd goblin hits Valkaya & she dies. Empty NPC moves
out of the way as goblin rushes the PC. PC regains control, which was lost upon
entering Valkaya's trigger.*/

void main()
{
//Defines PC, Empty Vessel, Valkaya & two goblins.
object oPC = GetFirstPC();
object oEmpty = GetObjectByTag("EMPTY_NPC");
object oValkaya = GetObjectByTag("VALKAYA");
object oGoblin1 = GetObjectByTag("GOBLIN_01");
object oGoblin2 = GetObjectByTag("GOBLIN_02");

//Defines waypoints.
object oEMark = GetWaypointByTag("WP_EMARK");
object oVMark = GetWaypointByTag("WP_VMARK");
object oGMark1 = GetWaypointByTag("WP_GMARK_01");
object oGMark2 = GetWaypointByTag("WP_GMARK_02");
object oMiss = GetWaypointByTag("WP_MISS");
object oRestoreBlue = GetWaypointByTag("WP_RESTORE_BLUE");

//Defines waypoint/location goblins jump to.


//Keeps them out of PC view at start.
object oJump = GetWaypointByTag("WP_JUMP");
location lJump = GetLocation(oJump);

//Defines effect.
effect eDeath = EffectDeath();

//Defines floats for delay commands.


//Allows easy multiple object control.
float fM = 0.0;
float fV = 0.0;
float fG1 = 0.0;
float fG2 = 0.0;

//Make both goblins jump to location near PC & NPCs.


AssignCommand(oGoblin1, ActionJumpToLocation(lJump));
AssignCommand(oGoblin2, ActionJumpToLocation(lJump));

//Valkaya's actions. Move, cast fake spell, die anim & scream sfx, destroy object.
DelayCommand(fV+=1.5, AssignCommand(oValkaya, ActionForceMoveToObject(oVMark, TRUE)));
DelayCommand(fV+=2.0, AssignCommand(oValkaya, ActionCastFakeSpellAtObject(SPELL_FIREBALL, oGoblin1)));
DelayCommand(fV+=1.0, AssignCommand(oValkaya, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_BACK, 1.0, 3.0)));
DelayCommand(fV+=0.0, AssignCommand(oValkaya, PlaySound("as_pl_screamf2")));
DelayCommand(fV+=0.5, AssignCommand(oValkaya, ActionDoCommand(DestroyObject(oValkaya))));

//1st goblin's actions. Move, cast fake spell & die.


DelayCommand(fG1+=0.5, AssignCommand(oGoblin1, ActionForceMoveToObject(oGMark1, TRUE)));
DelayCommand(fG1+=3.0, AssignCommand(oGoblin1, ActionCastFakeSpellAtObject(SPELL_ICE_DAGGER, oMiss)));
DelayCommand(fG1+=2.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDeath, oGoblin1));

//2nd goblin's actions. Move, cast fake spell & attack PC.
DelayCommand(fG2+=0.5, AssignCommand(oGoblin2, ActionForceMoveToObject(oGMark2, TRUE)));
DelayCommand(fG2+=3.5, AssignCommand(oGoblin2, ActionCastFakeSpellAtObject(SPELL_ICE_DAGGER, oValkaya)));
DelayCommand(fG2+=1.0, AssignCommand(oGoblin2, ActionAttack(oPC)));

//Empty Vessel action. Face goblins.


DelayCommand(fM+=1.5, AssignCommand(oEmpty, ActionDoCommand(SetFacing(55.0))));

//Restore PC control & add journal entry.


DelayCommand(fM+=7.5, AssignCommand(oPC, ActionDoCommand(SetCutsceneMode(oPC, FALSE))));
DelayCommand(fM+=0.0, AddJournalQuestEntry("JT_VALKAYA", 1, oPC));
DelayCommand(fM+=0.0, SetLocalInt(oGoblin2, "bAttack", 1));

//Empty Vessel action. Move to waypoint.


DelayCommand(fM+=0.2, AssignCommand(oEmpty, ActionForceMoveToObject(oRestoreBlue, TRUE, 0.0)));
}