333 lines
10 KiB
Plaintext
333 lines
10 KiB
Plaintext
#include "in_g_cutscene"
|
|
#include "cleanup"
|
|
#include "charport"
|
|
|
|
void CSvoice2(float oDelay, object oSelf, int iSet)
|
|
{
|
|
|
|
int iVoice;
|
|
float oDice;
|
|
|
|
switch (iSet)
|
|
{
|
|
case 1: iVoice = VOICE_CHAT_ATTACK;break;
|
|
case 2: iVoice = VOICE_CHAT_BATTLECRY1;break;
|
|
case 3: iVoice = VOICE_CHAT_BATTLECRY2;break;
|
|
case 4: iVoice = VOICE_CHAT_BATTLECRY3;break;
|
|
case 5: iVoice = VOICE_CHAT_THREATEN;break;
|
|
case 6: iVoice = VOICE_CHAT_CHEER;break;
|
|
case 7: iVoice = VOICE_CHAT_CUSS;break;
|
|
case 8: iVoice = VOICE_CHAT_FLEE;break;
|
|
case 9: iVoice = VOICE_CHAT_GOODBYE;break;
|
|
case 10: iVoice = VOICE_CHAT_THANKS;break;
|
|
case 11: iVoice = VOICE_CHAT_WEAPONSUCKS;break;
|
|
case 12: iVoice = VOICE_CHAT_LAUGH;break;
|
|
case 13: iVoice = VOICE_CHAT_HELLO;break;
|
|
case 14: iVoice = VOICE_CHAT_FOLLOWME;break;
|
|
case 15: iVoice = VOICE_CHAT_GOODIDEA;break;
|
|
case 16: iVoice = VOICE_CHAT_REST;break;
|
|
case 17: iVoice = VOICE_CHAT_YES;break;
|
|
|
|
|
|
}
|
|
DelayCommand(oDelay, AssignCommand(oSelf, PlayVoiceChat(iVoice)));
|
|
}
|
|
|
|
|
|
void CutsceneSpawn(string oPlaceable, string oWaypoint)
|
|
{
|
|
location lTarget;
|
|
object oTarget = GetWaypointByTag(oWaypoint);
|
|
lTarget = GetLocation(oTarget);
|
|
object oSpawn = CreateObject(OBJECT_TYPE_CREATURE, oPlaceable, lTarget);
|
|
AssignCommand(oSpawn, SetFacing(0.0));
|
|
}
|
|
|
|
|
|
void CutscenePlace(string oPlaceable, string oWaypoint)
|
|
{
|
|
location lTarget;
|
|
object oTarget = GetWaypointByTag(oWaypoint);
|
|
lTarget = GetLocation(oTarget);
|
|
object oSpawn = CreateObject(OBJECT_TYPE_PLACEABLE, oPlaceable, lTarget);
|
|
AssignCommand(oSpawn, SetFacing(0.0));
|
|
}
|
|
|
|
void CutsceneEffect(float oDelay, int oEffect, string oWaypoint)
|
|
{
|
|
object oTarget;
|
|
oTarget = GetObjectByTag(oWaypoint);
|
|
int nInt;
|
|
nInt = GetObjectType(oTarget);
|
|
effect eEffect;
|
|
eEffect = EffectVisualEffect(oEffect);
|
|
if (nInt != OBJECT_TYPE_WAYPOINT)
|
|
DelayCommand(oDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT,
|
|
eEffect, oTarget));
|
|
else
|
|
DelayCommand(oDelay, ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
|
|
eEffect, GetLocation(oTarget)));
|
|
}
|
|
|
|
void Reward(object oPC, int oType)
|
|
{
|
|
|
|
|
|
|
|
object oMod = GetModule();
|
|
string sRes;
|
|
float oDir = 0.0;
|
|
SetLocalInt(oMod, "chest_here", 1);
|
|
SetLocalInt(oMod, "ch_count", 0);
|
|
SetLocalInt(oMod, "countdown", 0);
|
|
SetLocalInt(oMod, "pearl_there", 0);
|
|
CutsceneEffect(0.0, VFX_FNF_SUMMON_CELESTIAL, "test_wp");
|
|
CutsceneEffect(6.0, VFX_IMP_DISPEL, "test_wp");
|
|
if (oType==0)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("reward_chest_spec", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("reward_chest1"),
|
|
SetFacing(oDir)));
|
|
}
|
|
|
|
|
|
if (oType==1)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("reward_chest1", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("reward_chest1"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==2)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("reward_chest2", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("reward_chest2"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==3)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("reward_chest3", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("reward_chest3"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==4)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("reward_chest4", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("reward_chest4"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==5)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("reward_chest5", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("reward_chest5"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==6)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("reward_chest6", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("reward_chest6"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==7)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("win_chest", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("star_chest"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==8)
|
|
{
|
|
DelayCommand(5.5, CutscenePlace("star_chest", "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("win_chest"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==9)
|
|
{
|
|
if (GetGender(oPC)==GENDER_MALE){sRes = "light_love_f";}
|
|
else {sRes = "light_love_m";}
|
|
DelayCommand(5.5, CutsceneSpawn(sRes, "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("win_chest"),
|
|
SetFacing(oDir)));
|
|
}
|
|
if (oType==10)
|
|
{
|
|
if (GetGender(oPC)==GENDER_MALE){sRes = "dark_love_f";}
|
|
else {sRes = "dark_love_m";}
|
|
DelayCommand(5.5, CutsceneSpawn(sRes, "test_wp"));
|
|
DelayCommand(5.7, AssignCommand(GetObjectByTag("win_chest"),
|
|
SetFacing(oDir)));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void CutScene(int oNum, string sChallenge, object oPC)
|
|
{
|
|
object oMod = GetModule();
|
|
object oStarfall=GetObjectByTag("starfall");
|
|
effect eEffect = EffectVisualEffect(VFX_IMP_REMOVE_CONDITION);
|
|
|
|
SetLocalInt(oPC, "cutscene_on",0);
|
|
SetLocalInt(oMod, "d1", 0);
|
|
SetLocalInt(oMod, "d2", 0);
|
|
SetLocalInt(oMod, "d2a", 0);
|
|
SetLocalInt(oMod, "d3", 0);
|
|
SetLocalInt(oMod, "d4", 0);
|
|
SetLocalInt(oMod, "d5", 0);
|
|
|
|
|
|
int iSwing = GetLocalInt(oPC, "pc_CHswing");
|
|
int iHit = GetLocalInt(oPC, "pc_CHhit");
|
|
int iDam = GetLocalInt(oPC, "pc_CHdam");
|
|
int aScore = GetLocalInt(oPC, "a_score");
|
|
|
|
int iAv;
|
|
float fPerc;
|
|
int iPerc;
|
|
int tScore;
|
|
|
|
|
|
if (iHit!=0){iAv = iDam / iHit; }
|
|
else {iAv = 0;}
|
|
|
|
if (iSwing!=0){fPerc = (IntToFloat(iHit) / IntToFloat(iSwing))*100;}
|
|
else {fPerc = 0.0;}
|
|
|
|
iPerc = FloatToInt(fPerc);
|
|
|
|
tScore = (iPerc * iAv)/10;
|
|
if (tScore!=0){aScore+=tScore;}
|
|
else {aScore += 0;}
|
|
|
|
SetLocalInt(oPC, "a_score", aScore);
|
|
|
|
object oArea = GetArea(oPC);
|
|
|
|
object oSface = GetWaypointByTag("mc_facing");
|
|
object oShome = GetWaypointByTag("starfall_wp");
|
|
object oWP1=GetWaypointByTag("starfall_cswp");
|
|
object oWP2=GetWaypointByTag("pc_cswp");
|
|
object oWP3=GetWaypointByTag("test_wp");
|
|
object oGate = GetObjectByTag("arena_gate");
|
|
|
|
string sSFtalk1, sSFtalk2,sSFtalk3,sSFtalk4,sSFtalk5,sSFtalk6,sSFtalk7,
|
|
sSFtalk7a, sSFtalk8,sSFtalk9,sSFtalk10;
|
|
|
|
float oDelay1 = 8.0;
|
|
float oDelay2 = 12.0;
|
|
float oDelay3 = 17.0;
|
|
float oDelay4 = 20.0;
|
|
float oDelay7 = 26.0;
|
|
float oDelay8 = 32.0;
|
|
float oDelay5 = 39.0;
|
|
float oDelay6 = 48.0;
|
|
|
|
CleanArea(oPC);
|
|
CreateItemOnObject("reward_key", oPC);
|
|
|
|
sSFtalk1 = "Congratulations, "+GetName(oPC)+
|
|
"! You have conquered the "+sChallenge+" arena challenge";
|
|
sSFtalk2 = "You took "+IntToString(iSwing)+" swings and landed "+IntToString(iHit)+" blows.";
|
|
sSFtalk3 = IntToString(iPerc)+"% of your attacks found their mark.";
|
|
sSFtalk4 = "You dealt a total of "+IntToString(iDam)+" damage with an average hit dealing "+IntToString(iAv)+" damage.";
|
|
sSFtalk5 = "I now present you with your arena challenge prize";
|
|
sSFtalk6 = "Go now, use your winnings wisely";
|
|
|
|
if (iPerc>=0) {sSFtalk7 = "Your performance was one of little or no skill "; }
|
|
if (iPerc>10) {sSFtalk7 = "Your performance was one of very low skill "; }
|
|
if (iPerc>20) {sSFtalk7 = "Your performance was one of average skill "; }
|
|
if (iPerc>30) {sSFtalk7 = "Your performance was one of moderate skill "; }
|
|
if (iPerc>40) {sSFtalk7 = "Your performance was one of high skill "; }
|
|
if (iPerc>50) {sSFtalk7 = "Your performance was one of very high skill "; }
|
|
if (iPerc>60) {sSFtalk7 = "Your performance was one of impressive skill "; }
|
|
if (iPerc>70) {sSFtalk7 = "Your performance was one of superior skill "; }
|
|
if (iPerc>80) {sSFtalk7 = "Your performance was one of incredible skill "; }
|
|
if (iPerc>90) {sSFtalk7 = "Your performance was one of supreme skill "; }
|
|
|
|
if (iAv>=0) {sSFtalk7a = "and almost no power!"; }
|
|
if (iAv>10) {sSFtalk7a = "and very low power!"; }
|
|
if (iAv>20) {sSFtalk7a = "and low power!"; }
|
|
if (iAv>30) {sSFtalk7a = "and average power!"; }
|
|
if (iAv>50) {sSFtalk7a = "and threatening power!"; }
|
|
if (iAv>70) {sSFtalk7a = "and overwhelming power!"; }
|
|
if (iAv>100) {sSFtalk7a = "and formidible power!"; }
|
|
if (iAv>110) {sSFtalk7a = "and incredible power!"; }
|
|
if (iAv>120) {sSFtalk7a = "and supreme power!"; }
|
|
if (iAv>150) {sSFtalk7a = "and devastating power!"; }
|
|
|
|
sSFtalk7+=sSFtalk7a;
|
|
|
|
sSFtalk8 = "You have been awarded "+IntToString(tScore)+" championship points, giving you a total of "+IntToString(aScore)+" points";
|
|
|
|
GestaltStartCutscene(oPC, "",TRUE,TRUE,TRUE,TRUE,2);
|
|
GestaltCameraFade(0.0, oPC, FADE_IN,FADE_SPEED_SLOW);
|
|
|
|
GestaltPlayMusic(0.0, oArea, TRUE, TRACK_HOTU_BATTLE_LARGE);
|
|
|
|
PortIn(2.5, oStarfall, oWP1, oWP1, oWP2, 0);
|
|
|
|
//GestaltJump(0.0, oPC, OBJECT_INVALID, "pccs_wp" );
|
|
GestaltActionMove(0.0,oPC, oWP2, TRUE, 0.0, 5.0);
|
|
GestaltFace(8.0, oPC, 0.0, 2, oWP1);
|
|
|
|
GestaltSpeak(oDelay1, oStarfall, sSFtalk1,
|
|
ANIMATION_FIREFORGET_VICTORY1);
|
|
GestaltSpeak(oDelay2, oStarfall, sSFtalk2,
|
|
ANIMATION_NONE);
|
|
GestaltSpeak(oDelay3, oStarfall, sSFtalk3,
|
|
ANIMATION_NONE);
|
|
GestaltSpeak(oDelay4, oStarfall, sSFtalk4,
|
|
ANIMATION_NONE);
|
|
GestaltSpeak(oDelay7, oStarfall, sSFtalk7,
|
|
ANIMATION_NONE);
|
|
GestaltSpeak(oDelay8, oStarfall, sSFtalk8,
|
|
ANIMATION_NONE);
|
|
|
|
GestaltSpeak(oDelay5, oStarfall, sSFtalk5,
|
|
ANIMATION_FIREFORGET_BOW);
|
|
GestaltSpeak(oDelay6, oStarfall, sSFtalk6,
|
|
ANIMATION_NONE);
|
|
GestaltFace(44.0, oPC, 0.0, 2, oWP3);
|
|
|
|
DelayCommand(40.0, Reward(oPC, oNum));
|
|
|
|
CSvoice2(46.0, oPC, 10);
|
|
|
|
PortIn(47.0, oStarfall, oWP1, oShome, oSface, 1);
|
|
|
|
|
|
SetLocalFloat(oPC,"fCameraDirection",120.0);
|
|
SetLocalFloat(oPC,"fCameraRange",18.0);
|
|
SetLocalFloat(oPC,"fCameraPitch",60.0);
|
|
|
|
|
|
GestaltCameraMove (0.0,
|
|
120.0,18.0,60.0,
|
|
300.0, 20.0,60.0,
|
|
10.0,30.0,oPC);
|
|
|
|
GestaltCameraMove (10.0,
|
|
300.0,20.0,60.0,
|
|
325.0,22.0,60.0,
|
|
5.0,30.0,oPC);
|
|
|
|
GestaltCameraMove (15.0,
|
|
325.0,22.0,60.0,
|
|
330.0,17.0,60.0,
|
|
5.0,30.0,oPC);
|
|
|
|
GestaltCameraMove (20.0,
|
|
330.0,17.0,60.0,
|
|
345.0,12.0,75.0,
|
|
4.0,30.0,oPC);
|
|
|
|
|
|
|
|
GestaltCameraFade (52.0, oPC, FADE_OUT, FADE_SPEED_SLOW, 3.0);
|
|
GestaltStopCutscene (55.0, oPC);
|
|
|
|
DelayCommand(56.0, MusicBackgroundChangeDay(GetArea(oPC), 0));
|
|
DelayCommand(56.0, MusicBackgroundChangeNight(GetArea(oPC), 0));
|
|
DelayCommand(57.0, MusicBackgroundStop(GetArea(oPC)));
|
|
}
|
|
|
|
//void main () {}
|