//:://///////////////////////////////////////////// //:: Ignite the current contents of the brazier //:: Used in conversation "alchemy01" //:: Jason Richardson //:: 2009-06-2 //::////////////////////////////////////////////// #include "nw_i0_plot" #include "x0_i0_henchman" void ProfessorRun(); void BlowUpLab(object oArea); void main() { object oBrazier = GetObjectByTag("rw_alchemybrazier"); object oPC = GetPCSpeaker(); if (GetIsObjectValid(oBrazier) == TRUE && GetIsPC(oPC) == TRUE) { // Determine what the brazier contains... // Phlogiston, the mixture the plot requires. Create an explosion at // the location of the brazier. if (HasItem(oBrazier, "rw_phlogiston")) { object oProfessor = GetObjectByTag("rw_ProfessorMiklos"); // Make the Professor run for cover ProfessorRun(); // KABOOOM! DelayCommand(4.0, ActionCastSpellAtLocation(SPELL_FIREBALL, GetLocation(oBrazier), METAMAGIC_NONE, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); // If this is the first time this is being done, blow up the // stone wall and create the secret lab door along with some rubble if (GetLocalInt(oPC, "nBlewUpLab") != 1) { // SMASH! DelayCommand(4.05, BlowUpLab(GetArea(oPC))); // Start the last conversation with the Professor if (GetIsObjectValid(oProfessor) == TRUE) { // Store a reference to the conversation in the Professor's local // string. If attempt to start the conversation below fails, // then the player will still be able to play the conversation by // clicking on the Professor (launching script "rw_onconversprof" which // plays the conversation contained in "sCurrentConversation"). SetLocalString(oProfessor, "sCurrentConversation", "professor04"); DelayCommand(9.2f, ExecuteScript("rw_startconverse", oPC)); } } // If for some reason the player gets addicted to pyrotechnics, // make sure we only blow up the lab once and only start the // Professor's conversation once. SetLocalInt(oPC, "nBlewUpLab", 1); } // Panacea is a healing mixture, so give the player a healing potion. else if (HasItem(oBrazier, "rw_panacea")) CreateItemOnObject("nw_it_mpotion002", oPC); // "Venenum Amor" means love potion, so give the player a potion of charm. else if (HasItem(oBrazier, "rw_venenumamor")) CreateItemOnObject("venenumamorpotio", oPC); // "Venenum Dormio" means sleep potion, so give the player a potion of sleep. else if (HasItem(oBrazier, "rw_venenumdormio")) CreateItemOnObject("venenumdormiopot", oPC); // The player flubbed the formulas, give 'em a little acid fog for their trouble. else if (HasItem(oBrazier, "rw_failedmixture")) { object oProfessor = GetObjectByTag("rw_ProfessorMiklos"); if (GetIsObjectValid(oProfessor) == TRUE) { // Select a one-liner for the Professor before he leaves the party SetOneLiner(TRUE, 5, oProfessor); // Make the Professor run for cover ProfessorRun(); // Professor complains DelayCommand(0.3f, AssignCommand(oProfessor, SpeakOneLinerConversation("profoneliners00"))); } DelayCommand(3.0, ActionCastSpellAtLocation(SPELL_ACID_FOG, GetLocation(oBrazier), METAMAGIC_NONE, TRUE, PROJECTILE_PATH_TYPE_DEFAULT, TRUE)); } // Remove the contents of the brazier object oItem = GetFirstItemInInventory(oBrazier); DestroyObject(oItem); } } // Make the Professor run for cover so he doesn't get hurt by explosions or acid void ProfessorRun() { object oPC = GetPCSpeaker(); object oProfessor = GetObjectByTag("rw_ProfessorMiklos"); object oWP = GetWaypointByTag("rw_professorflee"); if (GetIsPC(oPC) == TRUE && GetIsObjectValid(oProfessor) == TRUE && GetIsObjectValid(oWP) == TRUE) { // ActionForceMoveToObject won't work while the Professor is // a henchman RemoveHenchman(oPC, oProfessor); // Professor drops what he's doing and heads for the waypoint AssignCommand(oProfessor, ClearAllActions()); AssignCommand(oProfessor, ActionForceMoveToObject(oWP, TRUE, 0.0f)); // When it's all over, make the Professor our henchman again DelayCommand(6.0f, ExecuteScript("rw_professorjoin", oPC)); } } // Wrapper function so that all this can be done inside a DelayCommand() void BlowUpLab(object oArea) { // Destroy the stone wall object oStoneWall = GetObjectByTag("rw_destructablewall"); if (GetIsObjectValid(oStoneWall) == TRUE) DestroyObject(oStoneWall); // Create a metal door in the wall's place location lDoor = Location(oArea, Vector(24.88f, 41.4f, -0.14f), 270.0f); CreateObject(OBJECT_TYPE_PLACEABLE, "sec_door004", lDoor, FALSE, "rw_secretlabdoor"); // Also make a scorch mark and some rubble for realsim location lScorch = Location(oArea, Vector(24.79, 41.79f, 0.0f), 0.0f); CreateObject(OBJECT_TYPE_PLACEABLE, "plc_weathmark", lScorch, FALSE, "rw_labscorch"); location lRubble1 = Location(oArea, Vector(25.55f, 42.68f, 0.0f), 78.7f); CreateObject(OBJECT_TYPE_PLACEABLE, "plc_rubble", lRubble1, FALSE, "rw_labrubble1"); location lRubble2 = Location(oArea, Vector(24.41f, 44.30f, 0.0f), 123.7f); CreateObject(OBJECT_TYPE_PLACEABLE, "plc_rubble", lRubble2, FALSE, "rw_labrubble2"); // Also as a last touch, change the area music to "Good Temple 2" to // give the module a more dramatic-feeling ending. MusicBackgroundChangeNight(oArea, 49); MusicBackgroundChangeDay(oArea, 49); }