Jump to content

Dude won't go hostile...


LadyHonor

Recommended Posts

So I'm trying to make a dude go hostile on me, but he won't do it. I have him set with his own little team id. I've checked it in the area file (several times) and exported the area file (several times). I've checked the dialog flags to make sure they were set properly (several times). I checked and rechecked my script (thousands of time...well maybe a slight exaggeration). It's looks fine. Compiles without errors. Everything appears to be right. It's a sparring quest to spar with some of the city guard members. The first one jumps to her way point as she should. Goes hostile as she should. Dies temporarily as she should. Jumps back to her original way point as she should when the fight ends. The conversation triggered with the trainer goes as it should after the team destroyed flag is set. Dude jumps to position as he should. But he NEVER goes hostile. He just stands there with his arms crossed looking like a dumb butt. (I'm really going to enjoy killing his stubborn *** when I get this fixed). And his scripting is EXACTLY (well, his info is put in instead of hers but you know what I mean) as the first. So any suggestions on how to fix this?

 

Here are all the scripts dealing with this quest. Maybe someone can see something I can't.

 

Plot Script:

//::///////////////////////////////////////////////
//:: Plot Events Template
//:: Copyright (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Plot events
*/
//:://////////////////////////////////////////////
//:: Created By: Yaron
//:: Created On: July 21st, 2006
//:://////////////////////////////////////////////

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"
#include "lhc_hvr_constants_h"
#include "lhc_hvr_functions_h"
#include "plt_lhc_hvr_honing_skill"

int StartingConditional()
{
    event eParms = GetCurrentEvent();                // Contains all input parameters
    int nType = GetEventType(eParms);               // GET or SET call
    string strPlot = GetEventString(eParms, 0);         // Plot GUID
    int nFlag = GetEventInteger(eParms, 1);          // The bit flag # being affected
    object oParty = GetEventCreator(eParms);      // The owner of the plot table for this script
    object oBorin = GetEventObject(eParms, 0); // Owner on the conversation, if any
    int nResult = FALSE; // used to return value for DEFINED GET events
    object oPC = GetHero();

    plot_GlobalPlotHandler(eParms); // any global plot operations, including debug info

    if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
    {
        int nValue = GetEventInteger(eParms, 2);        // On SET call, the value about to be written (on a normal SET that should be '1', and on a 'clear' it should be '0')
        int nOldValue = GetEventInteger(eParms, 3);     // On SET call, the current flag value (can be either 1 or 0 regardless if it's a set or clear event)
        // IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!
        switch(nFlag)
        {

            case LHC_HVR_HONING_SKILL_ACCEPTED:
            {
                WR_SetPlotFlag(PLT_LHC_HVR_HONING_SKILL, LHC_HVR_HONING_SKILL_AVAILABLE, FALSE);
                break;
            }
            case LHC_HVR_HONING_SKILL_CHALLENGE_ACCEPTED:
            {
                lhcStoreParty(1);
                break;
            }
            case LHC_HVR_HONING_SKILL_TEAM_ONE:
            {
                object oGuard3 = GetObjectByTag("lhc_hvr_sparring_guard3");

                UT_LocalJump(oGuard3, "wp_lhc_fighter_one", TRUE, FALSE, FALSE, FALSE);
                UT_LocalJump(oBorin, "lhc_hvr_borin_secondary", TRUE, TRUE, FALSE, FALSE);
                UT_TeamGoesHostile(301, TRUE);
                break;
            }
            case LHC_HVR_HONING_SKILL_TEAM_TWO:
            {
                object oGuard1 = GetObjectByTag("lhc_hvr_sparring_guard1");

                UT_LocalJump(oGuard1, "wp_lhc_fighter_one", TRUE, FALSE, FALSE, FALSE);
                UT_LocalJump(oBorin, "lhc_hvr_borin_secondary", TRUE, TRUE, FALSE, FALSE);
                UT_TeamGoesHostile(302, TRUE);
                break;
            }
            case LHC_HVR_HONING_SKILL_TEAM_THREE:
            {
                object oGuard2 = GetObjectByTag("lhc_hvr_sparring_guard2");
                object oGuard4 = GetObjectByTag("lhc_hvr_sparring_guard4");

                UT_LocalJump(oGuard2, "wp_lhc_fighter_one", TRUE, FALSE, FALSE, FALSE);
                UT_LocalJump(oGuard4, "wp_lhc_fighter_two", TRUE, FALSE, FALSE, FALSE);
                UT_LocalJump(oBorin, "lhc_hvr_borin_secondary", TRUE, TRUE, FALSE, FALSE);
                UT_TeamGoesHostile(303, TRUE);
                break;
            }
            case LHC_HVR_HONING_SKILL_TEAM_FOUR:
            {
                UT_LocalJump(oBorin, "wp_lhc_fighter_one", TRUE, FALSE, FALSE, FALSE);
                UT_TeamGoesHostile(304, TRUE);
                break;
            }
            case LHC_HVR_HONING_SKILL_QUEST_COMPLETE:
            {
                RewardXPParty(700, XP_TYPE_PLOT, OBJECT_INVALID, OBJECT_INVALID);
                lhcIncAttribScore(oPC, PROPERTY_ATTRIBUTE_CONSTITUTION);
                DisplayFloatyMessage(oPC, "Inspired! +2 Constitution", FLOATY_MESSAGE, 16777215, 10.0);
                UT_PartyRestore();
                break;
            }
        }
     }
     else // EVENT_TYPE_GET_PLOT -> defined conditions only
     {

        switch(nFlag)
        {


        }

    }

    plot_OutputDefinedFlag(eParms, nResult);

    return nResult;
}

Teamed Destroyed Function Script (I really doubt this has anything to do with it tho):

    if(GetEventInteger(ev,0) == 301)
    {
        object oBorin = GetObjectByTag("lhc_hvr_borin");
        object oOpponent = GetObjectByTag("lhc_hvr_sparring_guard3");

        WR_SetPlotFlag(PLT_LHC_HVR_HONING_SKILL, LHC_HVR_HONING_SKILL_FIGHT_ONE, TRUE);
        UT_Talk(oBorin, oPC);
        ResurrectCreature(oOpponent, TRUE);
        SetTeamId(oOpponent, -1);
        UT_LocalJump(oOpponent, "wp_lhc_sparring_guard3", TRUE, TRUE, FALSE, FALSE);
    }
    if(GetEventInteger(ev,0) == 302)
    {
        object oBorin = GetObjectByTag("lhc_hvr_borin");
        object oOpponent = GetObjectByTag("lhc_hvr_sparring_guard1");

        WR_SetPlotFlag(PLT_LHC_HVR_HONING_SKILL, LHC_HVR_HONING_SKILL_FIGHT_TWO, TRUE);
        UT_Talk(oBorin, oPC);
        ResurrectCreature(oOpponent, TRUE);
        SetTeamId(oOpponent, -1);
        UT_LocalJump(oOpponent, "wp_lhc_sparring_guard1", TRUE, TRUE, FALSE, FALSE);
    }
    if(GetEventInteger(ev,0) == 303)
    {
        object oBorin = GetObjectByTag("lhc_hvr_borin");
        object oOpponent = GetObjectByTag("lhc_hvr_sparring_guard2");
        object oOpponent2 = GetObjectByTag("lhc_hvr_sparring_guard4");

        WR_SetPlotFlag(PLT_LHC_HVR_HONING_SKILL, LHC_HVR_HONING_SKILL_FIGHT_THREE, TRUE);
        UT_Talk(oBorin, oPC);
        ResurrectCreature(oOpponent, TRUE);
        ResurrectCreature(oOpponent2, TRUE);
        SetTeamId(oOpponent, -1);
        SetTeamId(oOpponent2, -1);
        UT_LocalJump(oOpponent, "wp_lhc_sparring_guard2", TRUE, TRUE, FALSE, FALSE);
        UT_LocalJump(oOpponent2, "wp_lhc_sparring_guard4", TRUE, TRUE, FALSE, FALSE);
    }
    if(GetEventInteger(ev,0) == 304)
    {
        object oBorin = GetObjectByTag("lhc_hvr_borin");

        WR_SetPlotFlag(PLT_LHC_HVR_HONING_SKILL, LHC_HVR_HONING_SKILL_FIGHT_TWO, TRUE);
        ResurrectCreature(oBorin, TRUE);
        SetTeamId(oBorin, -1);
        UT_Talk(oBorin, oPC);
    }

Party Store Function (another I don't think is the culprit but here it is anyway):

void lhcStoreParty(int nSetNeutral = FALSE)
{
    Log_Trace(LOG_CHANNEL_SYSTEMS, "utility_h.UT_PartyStore", "Storing active party (up to 3 followers can be stores)");

    object [] arParty = GetPartyList(GetPartyLeader());
    int nSize = GetArraySize(arParty);
    int i;
    SetLocalObject(GetModule(), PARTY_STORE_SLOT_1, OBJECT_INVALID);
    SetLocalObject(GetModule(), PARTY_STORE_SLOT_2, OBJECT_INVALID);
    SetLocalObject(GetModule(), PARTY_STORE_SLOT_3, OBJECT_INVALID);

    RemoveAllSummons();

    object oCurrent;
    for(i = 0; i < nSize; i++)
    {
        oCurrent = arParty[i];
        Log_Trace(LOG_CHANNEL_SYSTEMS, "utility_h.UT_PartyStore", "current party member: " + GetTag(oCurrent));

        if(IsFollower(oCurrent) && !IsHero(oCurrent))
        {
            Log_Trace(LOG_CHANNEL_SYSTEMS, "utility_h.UT_PartyStore", "STORING CURRENT PARTY MEMBER");
            if(GetLocalObject(GetModule(), PARTY_STORE_SLOT_1) == OBJECT_INVALID)
            {
                SetLocalObject(GetModule(), PARTY_STORE_SLOT_1, oCurrent);
                WR_SetFollowerState(oCurrent, FOLLOWER_STATE_UNAVAILABLE);
                if(nSetNeutral)
                    SetGroupId(oCurrent, GROUP_NEUTRAL);

                UT_LocalJump(oCurrent, "wp_lhc_partystore_1", TRUE);
            }

            else if(GetLocalObject(GetModule(), PARTY_STORE_SLOT_2) == OBJECT_INVALID)
            {
                SetLocalObject(GetModule(), PARTY_STORE_SLOT_2, oCurrent);
                WR_SetFollowerState(oCurrent, FOLLOWER_STATE_UNAVAILABLE);
                if(nSetNeutral)
                    SetGroupId(oCurrent, GROUP_NEUTRAL);

                 UT_LocalJump(oCurrent, "wp_lhc_partystore_2", TRUE);
            }

            else if(GetLocalObject(GetModule(), PARTY_STORE_SLOT_3) == OBJECT_INVALID)
            {
                SetLocalObject(GetModule(), PARTY_STORE_SLOT_3, oCurrent);
                WR_SetFollowerState(oCurrent, FOLLOWER_STATE_UNAVAILABLE);
                if(nSetNeutral)
                    SetGroupId(oCurrent, GROUP_NEUTRAL);

                UT_LocalJump(oCurrent, "wp_lhc_partystore_3", TRUE);

            }

        }

    }
    Log_Trace(LOG_CHANNEL_SYSTEMS, "utility_h.UT_PartyStore", "END");
}

Constants:

//City Guard Teams
const int LHC_HVR_HONING_TEAM_1     =   301;
const int LHC_HVR_HONING_TEAM_2     =   302;
const int LHC_HVR_HONING_TEAM_3     =   303;
const int LHC_HVR_HONING_TEAM_4     =   304;

And heck, let's just go ahead and give all the surprises away....

 

Attribute Bonus Function:

void lhcIncAttribScore(object oCreature, int nAttribute)
{
    // props 1 - 6 are attributes
    if (nAttribute>0 && nAttribute <7)
    {
        float fValue = GetCreatureProperty(oCreature, nAttribute, PROPERTY_VALUE_BASE) + 2.0;
        SetCreatureProperty(oCreature, nAttribute,fValue);
    }
}
Link to comment
Share on other sites

I fixed it. The mistake was in the team destroyed function. I called for the plot flag for fight two twice. I went from two to three then to two again when I should have gone to four.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...