Need some C code debugging for quest, the quest delay is 1/2 working. It delays the quest from engaging at the same time as the story_line, but when I go to rank 2, It won't start the video that starts the rest of the code. The game still works, but I need some input Levis.
Code:
void DutchmanQuestComplete(string sQuestName, string qname)
{
ref chr;
//trace("--- QUEST " + sQuestName + " CHECKED ---");
int iChar = -1;
int iShipChar = -1;
string sVideoFile = "";
switch(sQuestName)
{
case "begin_dutchman":
DoQuestCheckDelay("rank2 check", 1.0);
case "rank2 check"
if (sti(pchar.rank) >= 2)
{
PauseAllSounds();
SendMessage(&sound,"lfff", MSG_SOUND_SET_MASTER_VOLUME, 0.0, 0.0, 0.0);
sVideoFile = "IntroDutch"
StartPostVideoAndQuest(sVideoFile,0,"begin_dutchman_continue");
}
else
{
CheckDutchmanRank(qname, 2);
}
break;
}
{
case "begin_dutchman_continue";
ResumeAllSounds();
SendMessage(&sound,"lfff", MSG_SOUND_SET_MASTER_VOLUME, 0.5, 0.5, 0.5);
//login Davy Jones
iChar = GenerateCharacter(PIRATE, WITH_SHIP, "officer", MAN, 1, BOSS);
characters[iChar].id = "Davy Jones";
characters[iChar].name = "Davy";
characters[iChar].lastname = "Jones";
characters[iChar].model = "pirate_5";
characters[iChar].Ship.Type = GenerateShip(SHIP_DUTCHMAN, 1);
characters[iChar].ship.name = "The Flying Dutchman";
characters[iChar].skill.Fencing = 10;
characters[iChar].skill.Gun = 10;
GiveItem2Character(CharacterFromID("Davy Jones"), "blade15");
EquipCharacterByItem(CharacterFromID("Davy Jones"), "blade15");
characters[iChar].cannotsurrender = 1;
DoQuestCheckDelay("rank5 check", 1.0);
break;
case "rank5 check":
if (sti(pchar.rank) >= 5)
{
GiveItem2Character(pchar, "pslip");
DoQuestCheckDelay(rank5 passed)
}
else
{
CheckStoryLineRank(qname, 5);
}
break;
case "rank5 passed"
//generate encounter
iChar = GetCharacterIndex("Davy Jones");
DeleteAttribute(&characters[iChar], "seaai");
Group_CreateGroup("dutchman");
Group_AddCharacter("dutchman", "Davy Jones");
Group_SetGroupCommander("dutchman", "Davy Jones");
Group_SetAddress("dutchman", "grenada", "quest_ships", "quest_ship_1");
SetCharacterRelationBoth(nMainCharacterIndex, iChar, RELATION_ENEMY);
Group_SetTaskAttack("dutchman", PLAYER_GROUP);
Group_LockTask("dutchman");
UpdateRelations();
break;
if trace("!!! sea spawned") = true;
DoQuestCheckDelay(ship dead, 1.0);
break;
case "ship dead":
GiveItem2Character(pchar, "blade19");
GiveItem2Character(pchar, "gun6");
TakeItemFromCharacter(pchar, "pslip");
DoQuestCheckDelay("quest_complete")
break;
case "quest_complete"
PauseAllSounds();
SendMessage(&sound,"lfff", MSG_SOUND_SET_MASTER_VOLUME, 0.0, 0.0, 0.0);
sVideoFile = "OutroDutch"
StartPostVideo(sVideoFile,1);
ResumeAllSounds();
SendMessage(&sound,"lfff", MSG_SOUND_SET_MASTER_VOLUME, 0.5, 0.5, 0.5);
break;
}
}