Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
172
_module/nss/jw_smith_cutscen.nss
Normal file
172
_module/nss/jw_smith_cutscen.nss
Normal file
@@ -0,0 +1,172 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: jw_smith_cutscene
|
||||
//:: Copyright (c) 2003 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Modifies the current item with the currently
|
||||
selected item property.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brent
|
||||
//:: Created On: September 2003
|
||||
//:://////////////////////////////////////////////
|
||||
#include "jw_smith_copy"
|
||||
#include "x2_inc_cutscene"
|
||||
// jw_common3
|
||||
// Turn the armour into Everbright Armour. oEquip is the armour
|
||||
void MakeEverbright(object oEquip, object oPC);
|
||||
|
||||
// This is the command to start the smith's cutscene
|
||||
void StartCutscene(object oPC);
|
||||
|
||||
// make the smith face the PC
|
||||
void CutSetFacingPC(float fDelay, object Smith, object oPC, int iShift = TRUE);
|
||||
|
||||
int nCutsceneNumber = 114;
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetPCSpeaker();
|
||||
// get the armour they are wearing
|
||||
object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
|
||||
// * Oct 15: If the player has unequipped his item for some bizarre reason just
|
||||
// * abort the entire thing
|
||||
if (GetIsObjectValid(oItem) == FALSE)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// take their ore and gold
|
||||
// Remove some gold from the player
|
||||
TakeGoldFromCreature(8000, GetPCSpeaker(), TRUE);
|
||||
|
||||
// Remove items from the player's inventory
|
||||
object oItemToTake;
|
||||
oItemToTake = GetItemPossessedBy(oPC, "jw_bright_ore");
|
||||
if(GetIsObjectValid(oItemToTake) != 0)
|
||||
DestroyObject(oItemToTake);
|
||||
|
||||
oItemToTake = GetItemPossessedBy(oPC, "jw_bright_salve");
|
||||
if(GetIsObjectValid(oItemToTake) != 0)
|
||||
DestroyObject(oItemToTake);
|
||||
MakeEverbright(oItem,oPC);
|
||||
ActionPauseConversation();
|
||||
|
||||
|
||||
|
||||
SetLocalInt(oPC, "jw_smith_cutting", 1);
|
||||
DelayCommand(0.7, StartCutscene(oPC));
|
||||
|
||||
|
||||
//Set Cutscene 114 as active for all future calls to Cut_ commands
|
||||
CutSetActiveCutscene(nCutsceneNumber, CUT_DELAY_TYPE_CONSTANT);
|
||||
|
||||
AssignCommand(oPC, ClearAllActions());
|
||||
//Fade PCs to black
|
||||
BlackScreen(oPC);
|
||||
CutSetActiveCutsceneForObject(oPC, nCutsceneNumber, TRUE);
|
||||
CutDisableAbort(nCutsceneNumber);
|
||||
// We keep the player visible
|
||||
CutSetCutsceneMode(0.5, oPC, TRUE, FALSE, TRUE, TRUE); // pc visible - keep and freeze associates
|
||||
|
||||
// Set the PCs camera facing as we want it
|
||||
DelayCommand(0.4, SetCameraHeight(oPC, 1.0));
|
||||
|
||||
CutFadeFromBlack(1.5, oPC, FADE_SPEED_MEDIUM, FALSE);
|
||||
}
|
||||
|
||||
void StartCutscene(object oPC)
|
||||
{
|
||||
|
||||
object oItem = GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
|
||||
// Make the PC wear boring clothes
|
||||
object oRobe=CreateItemOnObject("jw_common3",oPC);
|
||||
CutActionEquipItem(0.5,oPC,oRobe,INVENTORY_SLOT_CHEST);
|
||||
|
||||
|
||||
object oSmith = OBJECT_SELF;
|
||||
// oForge is humphrey's anvil
|
||||
object oForge = GetNearestObjectByTag("jw_PR_humphrey_anvil");
|
||||
|
||||
|
||||
CutSetActiveCutsceneForObject(oSmith, nCutsceneNumber);
|
||||
CutSetActiveCutsceneForObject(oForge, nCutsceneNumber);
|
||||
|
||||
|
||||
//Location lForge will be the location of the anvil
|
||||
location lForge = GetLocation(GetNearestObjectByTag("jw_hmph_jump_wp"));
|
||||
|
||||
|
||||
|
||||
// make the smith go to the forge
|
||||
CutJumpToLocation(1.8,OBJECT_SELF,lForge,FALSE);
|
||||
|
||||
// make the smith look at the forge
|
||||
CutSetFacingPoint(2.0,OBJECT_SELF,"jw_PR_humphrey_anvil");
|
||||
|
||||
// Make the smith do some hammering
|
||||
CutActionAttack(2.4,OBJECT_SELF,GetNearestObjectByTag("jw_PR_humphrey_anvil"));
|
||||
|
||||
// Play the sound
|
||||
CutPlaySound(3.0, oSmith, "as_cv_smithhamr3", FALSE);
|
||||
|
||||
|
||||
CutApplyEffectToObject(6.0, DURATION_TYPE_TEMPORARY, VFX_DUR_ELEMENTAL_SHIELD, OBJECT_SELF, 0.7);
|
||||
|
||||
CutApplyEffectToObject(7.0, DURATION_TYPE_TEMPORARY, VFX_FNF_MYSTICAL_EXPLOSION, OBJECT_SELF, 0.7);
|
||||
// End Cutscene
|
||||
|
||||
CutFadeOutAndIn(10.0, oPC);
|
||||
DelayCommand(10.2,DestroyObject(oRobe));
|
||||
CutActionEquipItem(10.3,oPC,oItem,INVENTORY_SLOT_CHEST);
|
||||
|
||||
|
||||
|
||||
CutDisableCutscene(nCutsceneNumber, 10.5, 10.5, RESTORE_TYPE_NONE);
|
||||
|
||||
// * Resume conversation - Cleanup
|
||||
|
||||
DelayCommand(9.5, ActionResumeConversation());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void CutSetFacingPC(float fDelay, object Smith, object oPC, int iShift = TRUE)
|
||||
{
|
||||
|
||||
|
||||
DelayCommand(fDelay, AssignCommand(Smith, SetFacingPoint(GetPosition(oPC))));
|
||||
}
|
||||
|
||||
|
||||
|
||||
void MakeEverbright(object oEquip, object oPC)
|
||||
|
||||
{
|
||||
itemproperty iAdd;
|
||||
|
||||
// add the DR
|
||||
iAdd=ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_2,IP_CONST_DAMAGESOAK_10_HP);
|
||||
if (IPGetItemHasProperty(oEquip,iAdd,-1))
|
||||
{
|
||||
SendMessageToPC(oPC,"This item of armour already has a higher level of damage reduction than the Everbright salve can give it.");
|
||||
}
|
||||
else
|
||||
{
|
||||
iAdd=ItemPropertyDamageReduction(IP_CONST_DAMAGEREDUCTION_1,IP_CONST_DAMAGESOAK_5_HP);
|
||||
//SendMessageToPC(oPC,"DEBUG - damage reduction OK to go.");
|
||||
IPSafeAddItemProperty(oEquip,iAdd,0.0,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,FALSE,TRUE);
|
||||
}
|
||||
|
||||
// Add the resistances. The first time, we REMOVE any other resistances it may have
|
||||
iAdd=ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_ACID,IP_CONST_DAMAGERESIST_5);
|
||||
IPSafeAddItemProperty(oEquip,iAdd,0.0,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,FALSE,TRUE);
|
||||
|
||||
|
||||
// Add the resistances. The second time, we keep any other resistances it may have
|
||||
iAdd=ItemPropertyDamageResistance(IP_CONST_DAMAGETYPE_FIRE,IP_CONST_DAMAGERESIST_5);
|
||||
IPSafeAddItemProperty(oEquip,iAdd,0.0,X2_IP_ADDPROP_POLICY_REPLACE_EXISTING,FALSE,FALSE);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user