Author Topic: Could use some help merging a few scripts.  (Read 835 times)

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Could use some help merging a few scripts.
« Reply #15 on: December 27, 2013, 01:01:04 am »


               Thank you Shadooow, that is kind of you. As I mentioned I believe I have a working solution at this point regarding those two scripts. However I do have a few other scripts that are being stubborn, and definitely would welcome some help if you would be willing. I will send you an e-mail once I figure out what's needed, and you can see from there what you would be willing to work on if anything.

Just a disclaimer though, at this point it is all still very experimental. Just testing the waters to see what is even feasible.
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Could use some help merging a few scripts.
« Reply #16 on: December 29, 2013, 03:48:10 am »


               At this point we still have about 40 scripts that aren't compiling. After looking through them none of them seem critical. I could probable just delete them, and they would not be missed by most. However I would still like to see if a full merger is possible, and from what I can tell it comes down to a few errors in a few scripts.

I would love some help resolving this, but again it's just an experiment at this point, and not essential. But I would love to see if we can complete the merge of 2 epic worlds. I think it speaks to the unlimited potential of NWN in general.

The scripts we have that don't compile seem to fall under the same 5-6 types of errors.

_functions_misc.nss(148): ERROR: PARSING VARIABLE LIST


x2_inc_switches.nss(17): ERROR: FUNCTION DEFINITION MISSING NAME

inc_divineinterv.nss(183): ERROR: IDENTIFIER LIST FULL

zero_ggdi.nss(515): ERROR: UNDEFINED IDENTIFIER (DrawStar)

x0_i0_positionav.nss(18): ERROR: FUNCTION DEFINITION MISSING NAME

kt_arrowtrap- no starting conditional

makeavatar- no starting conditional

(Space backspace, does not fix those with out starting conditionals.)

Of course since the toolset only shows the first error with a script (and not subsequent ones) it is quite likely that there are others contained within these.

Looking at just the first script giving the errors this is the script:

_functions_misc.nss

//:://////////////////////////////////////////////////////////////////////////
//:: Created By:    Demented
//:: Name:          Badlands Guild System Include File
//:: Modified:
//:: Date           Description
//:: -------------------------------------------------------------------------
//::
//:://////////////////////////////////////////////////////////////////////////
#include "nw_i0_plot"
#include "_functions_text"
// * Removes all Tempory effects on an Item
void RemoveItemTemp(object oItem);
// * Removes all tempory effects on  a player
void RemovePlayerTemp(object oPC);
// * This removes all Permenent effects on a player
void RemovePlayerPerm(object oPC);
// * Takes one off a item Stack
void RemoveOne(object oItem);
// * The snores for count times
void Snore(object oPC, int iCount=1);
// * Copy properties of one object to another
void CopyItemProperties(object oItem1,object oItem2);
// * Destroy a single object by resref
void Destroy(object oPC,string itemres);
//* Ability Player Ability Test
int PlayerAbilityTest(object oPC,int Ability,int Difficulty);
//* Create Item On A Object Once
void CreateItemOnObjectOnce(string sItemTemplate, object oTarget);
//* DWD TOKEN MESSAGE AND TOKEN DELETION
void TokenMsg(object oPC, string sItemTag, string sType);
//* MaxHP Functions - by OldManWhistler
string GetClassName (int nClass);
string LogMaxHP (object oPC);
void ShowMaxHP(object oPC);
//* Check access restriction.
void RestrictedAreaCheck(string sAreaName);
//*  Delayed Entire Fraction(Party) Jump to object.
void DelayedFractionJump(object oTarget, object oPlayer, float iDelay);
//  Cast A Spell
void Cast_A_Spell(int iSpell, object oCaster, object oTarget);
//  Apply a specail territory guild bonus.
void ApplyGuildBonus(object oPC, string sMessage, effect eVisualEffect, effect eBonusEffect);
//  Return to Waypoint.
void ReturnToWaypoint(object oPC);
//  Create A Portal On Death.
void DeathPortalCreate(object oBoss, object oWaypoint);

//  Return to Waypoint.
//void ReturnToWaypoint(object oPC);
//------------------------------------------------------------------------------
//-     Removes all Tempory effects on an Item
//------------------------------------------------------------------------------
void RemoveItemTemp(object oItem)
{
    itemproperty ip = GetFirstItemProperty(oItem);
    while (GetIsItemPropertyValid(ip))
    {
        if (GetItemPropertyDurationType(ip) == DURATION_TYPE_TEMPORARY) RemoveItemProperty(oItem, ip);
        ip = GetNextItemProperty(oItem);
    }
}
//------------------------------------------------------------------------------
//-     This removes all tempory effects on a player
//------------------------------------------------------------------------------
void RemovePlayerTemp(object oPC)
{
    effect eCheck = GetFirstEffect(oPC);
    while(GetIsEffectValid(eCheck))
    {
        if(GetEffectDurationType(eCheck)==DURATION_TYPE_TEMPORARY) RemoveEffect(oPC,eCheck);
        eCheck = GetNextEffect(oPC);
    }
}
//------------------------------------------------------------------------------
//-     This removes all Permenent effects on a player
//------------------------------------------------------------------------------
void RemovePlayerPerm(object oPC)
{
    effect eCheck=GetFirstEffect(oPC);
    while(GetIsEffectValid(eCheck))
    {
        if (GetEffectSubType(eCheck)==SUBTYPE_SUPERNATURAL)
        {
            RemoveEffect(oPC,eCheck);
        }
        eCheck=GetNextEffect(oPC);
    }
}
//------------------------------------------------------------------------------
//-     Remove a single item from a stack
//------------------------------------------------------------------------------
void RemoveOne(object oItem)
{
    int iStack=GetItemStackSize(oItem);
    SetItemStackSize(oItem, iStack-1);
}
//------------------------------------------------------------------------------
//-     Destroy a single object by resref
//------------------------------------------------------------------------------
void Destroy (object oPC,string itemres)
{
    object oDes=GetItemPossessedBy(oPC,itemres);
    DestroyObject(oDes);
}
//------------------------------------------------------------------------------
//-     Applys Cute Sleeping Animation.
//------------------------------------------------------------------------------
void Snore(object oPC, int iCount=1)
{
    FloatingTextStringOnCreature("ZZzzzz",oPC);
    if (iCount '<3')
    {
        iCount++;
        DelayCommand(6.0,AssignCommand (oPC, Snore(oPC,iCount)));
    }
}
//------------------------------------------------------------------------------
//-     Applys Ability Test
//------------------------------------------------------------------------------
int PlayerAbilityTest(object oPC,int Ability,int Difficulty)
{
    int Abb=LoCGetAbilityModifier(Ability,oPC)+d20();
    SendMessageToPC(oPC,"You Rolled Strength Roll of "+IntToString(Abb)+" Difficulty "+IntToString(Difficulty));
    if (Abb>=Difficulty) return TRUE;
    return FALSE;
}
//------------------------------------------------------------------------------
//-     Copy Item Properties
//------------------------------------------------------------------------------
void CopyItemProperties(object oItem1,object oItem2)
{
    itemproperty ip1 =  GetFirstItemProperty(oItem1);
    while (GetIsItemPropertyValid(ip1))
    {
        AddItemProperty(DURATION_TYPE_PERMANENT,ip1,oItem2,0.0f);
        ip1=GetNextItemProperty(oItem1);
    }
}
//------------------------------------------------------------------------------
//-     Create Item On A Object Once
//------------------------------------------------------------------------------
void CreateItemOnObjectOnce(string sItemTemplate, object oTarget)
{
    if(GetItemPossessedBy(oTarget, sItemTemplate) == OBJECT_INVALID)
    {
        CreateItemOnObject(sItemTemplate, oTarget);
    }
    return;
}
//------------------------------------------------------------------------------
//-     DWD TOKEN MESSAGE AND TOKEN DELETION
//------------------------------------------------------------------------------
void TokenMsg(object oPC, string sItemTag, string sType)
{
    int i;
    int iXtra = GetNumItems(oPC, sItemTag) - 1;
    for (i = 1; i <= iXtra; i++)
    {
        Destroy(oPC, sItemTag);
    }
    SendMessageToPC(oPC, "Sorry, you have too many " + sType +
        " You are only allowed 1.  " + IntToString(iXtra) +
        " extra item(s) removed.");
}
//------------------------------------------------------------------------------
// MaxHP Functions - a really small stupid function by OldManWhistler
//------------------------------------------------------------------------------
//
// This is a little function that you can stick into your module (suggested
// spots: OnLevelUp, OnClientEnter, OnClientLeave) to write the player HP to the
// log file.
//
// It logs the maximum HP, the maximum HP possible, the HP from CON+Toughness,
// the maximum HP from classes and the percentage of maximum possible HP the
// character has.
//
// The information can be used to see if certain players are abusing the ability
// to "re-roll" bad HP rolls by hitting cancel in the level up process.
//
// But keep in mind that low Hit Die classes like wizard/sorcerer/rogue/bard
// will most likely always be close to the maximum possible HP because of NWN
// never rolls less than 50% when rolling HD. Also remember that characters get
// 100% of their Hit Die for their first three levels.
//
// Zip includes a tiny sample module and the script in an ERF file.
//------------------------------------------------------------------------------
string GetClassName (int nClass)
{
    // nClass - CLASS_* constant
    switch (nClass)
    {
        case CLASS_TYPE_BARBARIAN: return "Barbarian";
        case CLASS_TYPE_BARD: return "Bard";
        case CLASS_TYPE_CLERIC: return "Cleric";
        case CLASS_TYPE_DRUID: return "Druid";
        case CLASS_TYPE_FIGHTER: return "Fighter";
        case CLASS_TYPE_MONK: return "Monk";
        case CLASS_TYPE_PALADIN: return "Paladin";
        case CLASS_TYPE_RANGER: return "Ranger";
        case CLASS_TYPE_ROGUE: return "Rogue";
        case CLASS_TYPE_SORCERER: return "Sorcerer";
        case CLASS_TYPE_WIZARD: return "Wizard";
    }
    return "";
}
string LogMaxHP (object oPC)
{
    // by OldManWhistler
    // This function writes out the maximum HP the character has and the
    // maximum HP the character can possible have.
    // It is useful for seeing if your players are re-rolling their HP.
    // Note: level 1-3 characters will always have 100% of their maximum
    // possible HP.
    int iLevel = GetLevelByPosition(1, oPC) + GetLevelByPosition(2, oPC) + GetLevelByPosition(3, oPC);
    int iMaxHP = GetMaxHitPoints(oPC);
    int id4 = GetLevelByClass(CLASS_TYPE_SORCERER, oPC) + GetLevelByClass(CLASS_TYPE_WIZARD, oPC);
    int id6 = GetLevelByClass(CLASS_TYPE_BARD, oPC) + GetLevelByClass(CLASS_TYPE_ROGUE, oPC);
    int id8 = GetLevelByClass(CLASS_TYPE_CLERIC, oPC) + GetLevelByClass(CLASS_TYPE_DRUID, oPC) + GetLevelByClass(CLASS_TYPE_MONK, oPC);
    int id10 = GetLevelByClass(CLASS_TYPE_FIGHTER, oPC) + GetLevelByClass(CLASS_TYPE_PALADIN, oPC) + GetLevelByClass(CLASS_TYPE_RANGER, oPC);
    int id12 = GetLevelByClass(CLASS_TYPE_BARBARIAN, oPC);
    int iCon = LoCGetAbilityModifier(ABILITY_CONSTITUTION, oPC);
    int iTough = GetHasFeat(FEAT_TOUGHNESS, oPC);
    int iHPBonus = (iCon + iTough) * iLevel;
    int iHPClass = 4*id4 + 6*id6 + 8*id8 + 10*id10 + 12*id12;
    float fPerc = IntToFloat(iMaxHP - iHPBonus)*100 / IntToFloat(iHPClass);
    string sMsg1 = "LogMaxHP:"+GetPCPlayerName(oPC)+"/"+GetName(oPC);
    string sMsg2 = "LogMaxHP:"+GetClassName(GetClassByPosition(1, oPC))+"/"+GetClassName(GetClassByPosition(2, oPC))+"/"+GetClassName(GetClassByPosition(3, oPC))+" Level:"+IntToString(iLevel)+" MaxHP:"+IntToString(iMaxHP)+" HPPotential:"+IntToString(iHPBonus+iHPClass)+" HPConTough:"+IntToString(iHPBonus)+" HPClasses:"+IntToString(iHPClass)+ " PercentageOfMax:"+FloatToString(fPerc, 4, 2);
    SendMessageToPC(oPC, sMsg1);
    SendMessageToPC(oPC, sMsg2);
    SendMessageToAllDMs(sMsg1);
    SendMessageToAllDMs(sMsg2);
    return sMsg2;
}
void ShowMaxHP(object oPC)
{
    object oPC = GetItemActivatedTarget();
    int iMaxHP = GetMaxHitPoints(oPC);
    string sMaxHP = IntToString(iMaxHP);
    SendMessageToPC(oPC, "Your maximum HP is " + sMaxHP);
    SendMessageToAllDMs("The player's maximum HP is " + sMaxHP);
}
//------------------------------------------------------------------------------
//  Port Access Check.
//------------------------------------------------------------------------------
void RestrictedAreaCheck(string sAreaName)
{
    int iFlag = TRUE;
    //  House of 1000 Burning Kitten Areas
    if (sAreaName == "Advocates Stronghold") iFlag = FALSE;
    //  House of 1000 Burning Kitten Areas
    if (sAreaName == "Order of the Blue Rose Stronghold") iFlag = FALSE;
    //  House of 1000 Burning Kitten Areas
    if (sAreaName == "") iFlag = FALSE;
    //  The Outlawz Areas
    if (sAreaName == "Outlawz Stronghold") iFlag = FALSE;
    //  Brotherhood of Shadows Areas
    if (sAreaName == "Brotherhood of Shadows Stronghold") iFlag = FALSE;
    //  Legion of Vigilantes Areas
    if (sAreaName == "Legion of Vigilantes Stronghold") iFlag = FALSE;
}
//------------------------------------------------------------------------------
//  Delayed Entire Fraction(Party) Jump to object.
//------------------------------------------------------------------------------
/*
*/
void DelayedFractionJump(object oTarget, object oPlayer, float iDelay)
{
    // Get the first PC party member
    object  oObject     = GetFirstFactionMember(oPlayer, TRUE);
    // We stop when there are no more valid PC's in the party.
    while(GetIsObjectValid(oObject) == TRUE)
    {
        //  Do not count yourself, DM's, or members of other guilds.
        if (GetIsPC(oObject))
        {
            //  Port the player.
            DelayCommand(iDelay, AssignCommand(oObject, JumpToObject(oTarget)));
        }
        // Get the next PC member of oPC's faction.
        oObject = GetNextFactionMember(oPlayer, TRUE);
    }
}

//------------------------------------------------------------------------------
//  Cast a Spell.
//------------------------------------------------------------------------------
/*
*/
void Cast_A_Spell(int iSpell, object oCaster, object oTarget)
{
    int nMetaMagic = METAMAGIC_MAXIMIZE;
    int bCheat = TRUE;
    int nDomainLevel = 40;
    int nProjectilePathType = PROJECTILE_PATH_TYPE_DEFAULT;
    int bInstantSpell = TRUE;
    //  Now lets cast GMW on it.
    AssignCommand(oCaster, ActionCastSpellAtObject(iSpell, oTarget, nMetaMagic,
        bCheat, nDomainLevel, nProjectilePathType, bInstantSpell));
}

//------------------------------------------------------------------------------
//  Apply a specail territory guild bonus.
//------------------------------------------------------------------------------
/*
*/
void ApplyGuildBonus(object oPC, string sMessage, effect eVisualEffect, effect eBonusEffect)
{
    AssignCommand(oPC,ClearAllActions());
    //  1st Setup the starndard duration variable.
    float fDur = IntToFloat(20 + GetHitDice(oPC) * d6(4));
    //int iDur = StringToInt(FloatToString(fDur/60.0));
    //  Apply the visual effect.
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisualEffect, oPC);
    //  Apply the Bonus effect.
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBonusEffect, oPC, fDur);
    //  Apply the onuse pause to the character
    SetLocalInt(oPC, "effect_pause", TRUE);
    //  Apply the delayed removal of the pause.
    AssignCommand(oPC, DelayCommand(fDur/6, SetLocalInt(oPC, "effect_pause", FALSE)));
    //  Send the cooresponding floating text message.
    ColoredFloatingString(sMessage, oPC, 10);
    return;
}

//------------------------------------------------------------------------------
//  Return to Waypoint.
//------------------------------------------------------------------------------
void ReturnToWaypoint(object oObject)
{
    //  Grab the needed shop keeper Tag his waypoint Tag when the store closes.
    string   sShopKeeperTag = GetTag(oObject);
    string   sWaypointTag   = "WP_" + sShopKeeperTag + "_01";
    //  Convert the string to its needed objects.
    object   oWaypoint      = GetWaypointByTag(sWaypointTag);
    //  Move the object to the destination.
    AssignCommand(oObject, ActionForceMoveToObject(oWaypoint, TRUE, 1.0f));
}

//------------------------------------------------------------------------------
//  Return to Waypoint.
//------------------------------------------------------------------------------
//  Create A Portal On Death.
void DeathPortalCreate(object oBoss, object oWaypoint)
{
    string WP_4_Portal = GetLocalString(oBoss, "WP_Portal");
    string WP_TerryNum = GetLocalString(oBoss, "Terry_Num");
    string WP_Terry    = "WP_Territory_" + WP_TerryNum;
    effect eBoom = EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION,FALSE);
    effect eFire = EffectVisualEffect(VFX_IMP_PULSE_COLD);
    effect eDebris = EffectVisualEffect(354);
    location lTerryPortal = GetLocation(oWaypoint);
    object   oTerryPortal = CreateObject(OBJECT_TYPE_PLACEABLE, "boss_Portal", lTerryPortal);
    SetLocalString(oTerryPortal, "WaypointName", WP_Terry);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eBoom, lTerryPortal);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eFire, lTerryPortal);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDebris, lTerryPortal);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDebris, lTerryPortal);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDebris, lTerryPortal);
    ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eDebris, lTerryPortal);
    PlaySound("sim_explsun");
    DestroyObject(oTerryPortal, 100.0);
}
 
               
               

               


                     Modifié par Lazarus Magni, 29 décembre 2013 - 03:48 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Could use some help merging a few scripts.
« Reply #17 on: December 29, 2013, 03:50:54 am »


               And the includes are:

nw_i0_plot:

//::///////////////////////////////////////////////
//::
//:: Designer Include File
//::
//:: NW_I0_PLOT.nss
//::
//:: Copyright © 2001 Bioware Corp.
//::
//::
//:://////////////////////////////////////////////
//::
//::
//:: This is a sample of design wrote
//:: functions that may need inclusion in multiple
//:: modules.
//::
//:://////////////////////////////////////////////
//::
//:: Created By: Brent Knowles
//:: Created On: February 12, 2001
//:: Updated On: August, 14, 2003 (Georg) - Fixed AutoDC, Added const statement to constants
//:://////////////////////////////////////////////
const int DC_EASY = 0;
const int DC_MEDIUM = 1;
const int DC_HARD = 2;
const int DC_SUPERIOR = 3;
const int DC_MASTER = 4;
const int DC_LEGENDARY = 5;
const int DC_EPIC = 6;
// * this is used by some of the template scripts
// * 100 - this number is the chance of that dialog
// * appearing
const int G_CLASSCHANCE = 70;
//Experience Point Rewards constants used in the 'des_xp_rewards' 2da
const int XP_VERY_LOW = 1;    //50 xp
const int XP_LOW = 2;         //100 xp
const int XP_MEDIUM_LOW = 3;  //150 xp
const int XP_MEDIUM = 4;      //250 xp
const int XP_MEDIUM_HIGH = 5; //500 xp
const int XP_HIGH = 6;        //1000 xp
const int XP_VERY_HIGH = 7;   //2000 xp
const int XP_EPIC = 8;        //5000 xp

// * FUNCTION DECLARATIONS
// * returns true if the player can afford to lose the indicated amount of XP without losing  a level
int plotCanRemoveXP(object oPC, int nPenalty);
int GetCanCastHealingSpells(object oPC) ;
int DoOnce();
void DebugSpeak(string s);
object GetMyMaster();
int IsRecall();
void DimensionHop(object oTarget);
int CanSeePlayer();
void EscapeArea(int bRun = TRUE, string sTag="NW_EXIT");
int HasItem(object oCreature, string s);
void TakeGold(int nAmount, object oGoldHolder, int bDestroy=TRUE);
object GetNearestPC();
void SetIsEnemy(object oTarget);
// Provide a scaled skill check DC based on the DC_* constant passed in
// DC      -  DC_EASY  DC_MEDIUM  DC_HARD  DC_SUPERIOR  DC_MASTER  DC_LEGENDARY  DC_EPIC
// nSkill  - SKILL_* constant
// oTarget - creature that is going to perform the check;
int AutoDC(int DC, int nSkill, object oTarget);
void AutoAlignG(int DC, object oTarget);
void AutoAlignE(int DC, object oTarget);
void DoGiveXP(string sJournalTag, int nPercentage, object oTarget, int QuestAlignment=ALIGNMENT_NEUTRAL);
void RewardXP(string sJournalTag, int nPercentage, object oTarget, int QuestAlignment=ALIGNMENT_NEUTRAL, int bAllParty=TRUE);
void RewardGP(int GP, object oTarget,int bAllParty=TRUE);
int CheckCharismaMiddle();
int CheckCharismaNormal();
int CheckCharismaLow();
int CheckCharismaHigh();
int CheckIntelligenceLow();
int CheckIntelligenceNormal();
int CheckIntelligenceNormal();
int CheckIntelligenceHigh();
int CheckWisdomHigh();
// Return the wisdom of oTarget
int GetWisdom(object oTarget);
// Return the Intelligence of the Target
int GetIntelligence(object oTarget);
// Return the Charisma of the Target
int GetCharisma(object oTarget);
// Return the numer of items oTarget possesses from type sItem (Tag)
int GetNumItems(object oTarget,string sItem);
// Gives the item with the ResRef sItem to creature oTarget nNumItems times
void GiveNumItems(object oTarget,string sItem,int nNumItems);
// Remove nNumItems Items of Type sItem (Tag) from oTarget
void TakeNumItems(object oTarget,string sItem,int nNumItems);
// * plays the correct character theme
// * assumes OBJECT_SELF is in the area
void PlayCharacterTheme(int nTheme);
// * plays the old theme for the area
// * assumes OBJECT_SELF is in the area
void PlayOldTheme();
int GetPLocalInt(object oPC,string sLocalName);
void SetPLocalInt(object oPC,string sLocalName, int nValue);
// * removes all negative effects
void RemoveEffects(object oDead);
// * starts store using appraise skill
void gplotAppraiseOpenStore(object oStore, object oPC, int nBonusMarkUp = 0, int nBonusMarkDown = 0);
// * starts store with favorable appraise check
void gplotAppraiseFavOpenStore(object oStore, object oPC, int nBonusMarkUp = 0, int nBonusMarkDown = 0);
//Do a DC check and modify the skill by the Target's Strength modifier
int CheckDCStr(int DC, int nSkill, object oTarget);
//Check to see if target is PC and not DM
int GetIsPlayerCharacter(object oTarget);
//Reward Experience based on an entry in the des_xp_rewards 2da file
void Reward_2daXP(object oPC, int nRow, int bAllParty = TRUE, int nPercentage = 100);
//Both speak a string ref as well as play the associate sound file
void PlaySpeakSoundByStrRef(int nStrRef);

// * returns a value that will be subtracted from the
// * oTarget's DC to resist APpraise or Persuasion
int GetNPCEasyMark(object oTarget)
{
    int nCharmMod = 0;
    if (GetHasSpellEffect(SPELL_CHARM_PERSON, oTarget))
    {
        nCharmMod = 10;
    }
    else
    if (GetHasSpellEffect(SPELL_CHARM_MONSTER, oTarget))
    {
        nCharmMod = 10;
    }
    else
    if (GetHasSpellEffect(SPELL_CHARM_PERSON_OR_ANIMAL, oTarget))
    {
        nCharmMod = 10;
    }
    else if (GetHasSpellEffect(SPELL_MASS_CHARM, oTarget))
    {
            nCharmMod = 15;
    }
    else if (GetHasSpellEffect(SPELL_DOMINATE_MONSTER, oTarget))
    {
            nCharmMod = 20;
    }
    else if (GetHasSpellEffect(SPELL_DOMINATE_ANIMAL, oTarget))
    {
            nCharmMod = 20;
    }
    else if (GetHasSpellEffect(SPELL_DOMINATE_PERSON, oTarget))
    {
        nCharmMod = 20;
    }
    return nCharmMod;
}
//::///////////////////////////////////////////////
//:: gplotAppraiseOpenStore
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Opens a store, modifying the store prices
    by the Appraise skill of the PCspeaker
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:: 2003-05-26: Updated from XP1 sources - Georg
//:://////////////////////////////////////////////
void gplotAppraiseOpenStore(object oStore, object oPC, int nBonusMarkUp = 0, int nBonusMarkDown = 0)
{
    int STATE_FAILED = 1;
    int STATE_TIE = 2;
    int STATE_WON = 3;
    string sTag = ObjectToString(OBJECT_SELF);
    int nPlayerSkillRank = GetSkillRank(SKILL_APPRAISE, oPC);
    int nNPCSkillRank = GetSkillRank(SKILL_APPRAISE, OBJECT_SELF) - GetNPCEasyMark(OBJECT_SELF);

    if (nNPCSkillRank < 1 )
        nNPCSkillRank = 1;
    int nAdjust = 0;

    /*
      New System:
        An opposed skill check (a d10 roll instead). Your appraise skill versus the shopkeepers appraise skill.
        Possible Results:
        Percentage Rebate/Penalty: The 'difference'
        Feedback: [Appraise Skill]: Merchant's reaction is unfavorable.
                  [Appraise Skill]: Merchant's reaction is neutral.
                  [Appraise Skill]: Merchant's reaction is favorable.
        Additional: Remember last reaction for this particular skill.
        When the player gets a new skill rank in this skill they'll get a
        reroll against this merchant.
    */
    int nState = 0;
    int nPreviousRank = GetLocalInt(oPC, "X0_APPRAISERANK"+ sTag);
    // * if the player's rank has improved, let them have another appraise check
    // * against this merchant
 
    if ( (nPlayerSkillRank > nPreviousRank) || !GetLocalInt(oPC, "X0_APPRAISEVISITED"+sTag) )
    {
       SetLocalInt(oPC, "X0_APPRAISERANK"+ sTag, nPlayerSkillRank);
       SetLocalInt(oPC, "X0_APPRAISEVISITED"+sTag, 1);
        nPlayerSkillRank = nPlayerSkillRank + d10();
        nNPCSkillRank = nNPCSkillRank + d10();
        nAdjust = nNPCSkillRank - nPlayerSkillRank; // * determines the level of price modification
        if (nNPCSkillRank > nPlayerSkillRank)
        {
            nState = STATE_FAILED;
        }
        else
        if (nNPCSkillRank < nPlayerSkillRank)
        {
            nState = STATE_WON;
        }
        else
        if (nNPCSkillRank == nPlayerSkillRank)
        {
            nState = STATE_TIE;
        }
    }
    else
    {
        // * recover last reaction
        nAdjust  = GetLocalInt(oPC, "X0_APPRAISEADJUST" + sTag);
        if (nAdjust > 0)
        {
            nState = STATE_FAILED;
        }
        else
        if (nAdjust < 0)
        {
            nState = STATE_WON;
        }
        else
        if (nAdjust == 0)
        {
            nState = STATE_TIE;
        }
    }
    if (nState == STATE_FAILED  )
    {
        FloatingTextStrRefOnCreature(8963, oPC, FALSE);
    }
    else
    if (nState == STATE_WON)
    {
        FloatingTextStrRefOnCreature(8965, oPC, FALSE);
    }
    else
    if (nState == STATE_TIE)
    {
        FloatingTextStrRefOnCreature(8964, oPC, FALSE);
    }
    SetLocalInt(oPC, "X0_APPRAISEADJUST"+ sTag, nAdjust);
  //  SpawnScriptDebugger();

    // * Hard cap of 30% max up or down
    if (nAdjust > 30)
        nAdjust = 30;
    if (nAdjust < -30)
        nAdjust = -30;
    nBonusMarkUp = nBonusMarkUp + nAdjust;
    nBonusMarkDown = nBonusMarkDown - nAdjust;
    OpenStore(oStore, oPC, nBonusMarkUp, nBonusMarkDown);
}
//::///////////////////////////////////////////////
//:: gplotAppraiseFavOpenStore
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Opens a store, modifying the store prices
    by the Appraise skill of the PCspeaker
    THIS SCRIPT ALWAYS RESULTS IN A GOOD APPRAISE
    RESULT
*/
//:://////////////////////////////////////////////
//:: Created By: Keith Warner
//:: Created On: Mar 7/03
//:: 2003-05-26: Updated from XP1 sources - Georg
//:://////////////////////////////////////////////
void gplotAppraiseFavOpenStore(object oStore, object oPC, int nBonusMarkUp = 0, int nBonusMarkDown = 0)
{
    int STATE_WON = 3;
    string sTag = ObjectToString(OBJECT_SELF);
    int nPlayerSkillRank = GetSkillRank(SKILL_APPRAISE, oPC);
    int nNPCSkillRank = 0;

    int nAdjust = 0;
    int nState = STATE_WON;
    int nPreviousRank = GetLocalInt(oPC, "X0_APPRAISERANK"+ sTag);
    // * if the player's rank has improved, let them have another appraise check
    // * against this merchant
 
    if ( (nPlayerSkillRank > nPreviousRank) || !GetLocalInt(oPC, "X0_APPRAISEVISITED"+sTag) )
    {
       SetLocalInt(oPC, "X0_APPRAISERANK"+ sTag, nPlayerSkillRank);
       SetLocalInt(oPC, "X0_APPRAISEVISITED"+sTag, 1);
        nPlayerSkillRank = nPlayerSkillRank + d10();
        nAdjust = nNPCSkillRank - nPlayerSkillRank; // * determines the level of price modification
    }
    else
    {
        // * recover last reaction
        nAdjust  = GetLocalInt(oPC, "X0_APPRAISEADJUST" + sTag);
    }
    FloatingTextStrRefOnCreature(8965, oPC, FALSE);

    SetLocalInt(oPC, "X0_APPRAISEADJUST"+ sTag, nAdjust);
    // * Hard cap of 30% max up or down
    if (nAdjust > 30)
        nAdjust = 30;
    if (nAdjust < -30)
        nAdjust = -30;
    nBonusMarkUp = nBonusMarkUp + nAdjust;
    nBonusMarkDown = nBonusMarkDown - nAdjust;
    OpenStore(oStore, oPC, nBonusMarkUp, nBonusMarkDown);
}

// * plays the correct character theme
// * assumes OBJECT_SELF is in the area
void PlayCharacterTheme(int nTheme)
{
    object oArea =GetArea(OBJECT_SELF);
    int nMusicNight = MusicBackgroundGetNightTrack(oArea);
    int nMusicDay = MusicBackgroundGetDayTrack(oArea);
   // AssignCommand(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC), SpeakString(IntToString(nMusic)));
    //* stores the last music track
    SetLocalInt(oArea, "NW_L_MYLASTTRACKNight", nMusicNight);
    SetLocalInt(oArea, "NW_L_MYLASTTRACKDay", nMusicDay);
    MusicBackgroundStop(oArea);
    MusicBackgroundChangeNight(oArea, nTheme);
    MusicBackgroundChangeDay(oArea, nTheme);
    MusicBackgroundPlay(oArea);
}
// * plays the old theme for the area
// * assumes OBJECT_SELF is in the area
void PlayOldTheme()
{
    object oArea =GetArea(OBJECT_SELF);
    //* stores the last music track
    int nMusicNight = GetLocalInt(oArea, "NW_L_MYLASTTRACKNight");
    int nMusicDay = GetLocalInt(oArea, "NW_L_MYLASTTRACKDay");
    MusicBackgroundStop(oArea);
    MusicBackgroundChangeNight(oArea, nMusicNight);
    MusicBackgroundChangeDay(oArea, nMusicDay);
    MusicBackgroundPlay(oArea);
}

//  Returns the adjusted Reaction for the purposes of store pricing.
float GetReactionAdjustment(object oTarget);
/*
    Adjusts all faction member's reputation visa via
    another faction.  Pass in a member from each
    faction.
*/
void AdjustFactionReputation(object oTargetCreature, object oMemberOfSourceFaction, int nAdjustment);
/*
    Makes the person teleport away and look like
    they are casting a spell.
*/
void EscapeViaTeleport(object oFleeing);
// * FUNCTION DEFINITIONS

int GetCanCastHealingSpells(object oPC)
{
    talent tTalent = GetCreatureTalentBest(TALENT_CATEGORY_BENEFICIAL_HEALING_TOUCH, 20, oPC);
    if (GetIsTalentValid(tTalent) == TRUE)
    {
      return TRUE;
    }
      return FALSE;
}

int DoOnce()
{
    int bResult = FALSE;
    if (GetLocalInt(OBJECT_SELF,"NW_L_DOONCE999") == 0)
    {
        SetLocalInt(OBJECT_SELF,"NW_L_DOONCE999",1);
        bResult = TRUE;
    }
    return bResult;
}
void DebugSpeak(string s)
{
    SpeakString(s);
}
object GetMyMaster()
{
    return GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC);
}
 
//::///////////////////////////////////////////////
//:: IsRecall
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Attempts  to transport the player
    back to closest Temple of Tyr using
    a Recall Stone.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
int IsRecall()
{
    if (GetTag(GetItemActivated()) == "NW_IT_RECALL")
    {
       string sAreaTag = GetTag(GetArea(GetItemActivator()));
       if (/*Chapter 1 Areas*/
           sAreaTag == "MAP_M1S3B" ||
           sAreaTag == "Map_M1S4C" ||
           sAreaTag == "MAP_M1Q6F4" || // Fenthick area in Chapter1e
           sAreaTag == "Map_M1S4D" ||
           sAreaTag == "Map_M1S4E" ||
           sAreaTag == "Map_M1S4F" ||
           /* Chapter 3 and 4 Areas*/
           sAreaTag == "MAP_M1Q6A" || /*Castle Never*/
           sAreaTag == "M4Q1D2" /*Final Source Stone level*/ ||
           sAreaTag == "M4FinalArea" || /*Haedralines area*/
           sAreaTag == "M3Q1A10" || /*Aarin Gend's Lodge*/
           sAreaTag == "M3Q3C" || sAreaTag == "M3Q3Ca" ||  sAreaTag == "M3Q2G" ||  sAreaTag == "M3Q2I" ||
           sAreaTag == "Map_M2Q2E2" || sAreaTag == "Map_M2Q2G" || sAreaTag == "Map_M2Q3GA" || sAreaTag == "Map_M2Q3GB")
       {
        AssignCommand(GetItemActivator(), ActionSpeakStringByStrRef(10611));
        return TRUE;
       }
       else
/*       if (CanAffordIt() == FALSE)
       {
        AssignCommand(GetItemActivator(), ActionSpeakStringByStrRef(66200));
        return TRUE;
       }
       else */
       // * May 2002: Checking a global to see if Haedraline is around as well
       if (        GetLocalInt(GetModule(),"NW_G_RECALL_HAED") == 10
       || GetIsObjectValid(GetNearestObjectByTag("Haedraline3Q11", GetItemActivator())) == TRUE)
       {
        AssignCommand(GetItemActivator(), ActionSpeakStringByStrRef(10612));
        return TRUE;
       }
       else
       {
           object oPortal = GetObjectByTag("NW_RECALL_PORTAL");
           if (GetIsObjectValid(oPortal) == TRUE)
           {
             SetLocalInt(GetItemActivator(), "NW_L_USED_RECALL", 1);
             SetLocalLocation(GetItemActivator(), "NW_L_LOC_RECALL", GetLocation(GetItemActivator()));
             string sTag =  "NW_RECALL_PORTAL";
              object oClicker = GetItemActivator();
              object oTarget = GetObjectByTag(sTag);
             // AssignCommand(GetItemActivator(), SpeakString(sTag));
                // * if I don't do this, gets stuck in a loop
                // * of casting.
              AssignCommand(oClicker, ClearAllActions());
              AssignCommand(oClicker, PlaySound("as_mg_telepout1"));

              //SetAreaTransitionBMP(AREA_TRANSITION_RANDOM);
//              AssignCommand(oClicker, PlaySound("as_mg_telepout1"));
              AssignCommand(oClicker,JumpToObject(oTarget));
//              AssignCommand(oClicker, DelayCommand(1.0,PlaySound("as_mg_telepout1")));
              AssignCommand(oClicker, ActionDoCommand(ClearAllActions()));
              return TRUE;
           }
           // * this module does not have a temple of tyr
           else
           {
                AssignCommand(GetItemActivator(), ActionSpeakStringByStrRef(10614));
                return TRUE;
           }
       }
    }
    return FALSE;
}
//::///////////////////////////////////////////////
//:: DimensionHop
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
     Will move the character from one point to oTarget
     with a flashy graphic.
     Original Use: Dryads in M3Q3, SnowGlobe
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: January 10, 2002
//:://////////////////////////////////////////////
void DimensionHop(object oTarget)
{
    if (GetDistanceToObject(oTarget) > 2.5)
    {
        effect eVis = EffectVisualEffect(VFX_IMP_UNSUMMON);
        ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
        ActionJumpToObject(oTarget);
    }
}
 
//::///////////////////////////////////////////////
//:: CanSeePlayer
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
   Returns true if OBJECT_SELF can see the player
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
int CanSeePlayer()
{
    return GetIsObjectValid(GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN));
}
//::///////////////////////////////////////////////
//:: EscapeArea()
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
  Runs object to nearest waypoint with tag
  "NW_EXIT".  This tag can be overridden.
  You can also specify whether to run or not.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: December 2001
//:://////////////////////////////////////////////
void EscapeArea(int bRun = TRUE, string sTag="NW_EXIT")
{
    object oWay = GetNearestObjectByTag(sTag);
    if (GetIsObjectValid(oWay))
    {
        ActionMoveToObject(oWay, bRun);
        ActionDoCommand(DestroyObject(OBJECT_SELF));
        SetCommandable(FALSE); // * this prevents them from being interrupted
    }
    //else
    //SpeakString("invalid exit waypoint");
}
//::///////////////////////////////////////////////
//:: HasItem
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
      A wrapper to simplify checking for an item.
*/
//:://////////////////////////////////////////////
//:: Created By:        Brent
//:: Created On:        November 2001
//:://////////////////////////////////////////////
int HasItem(object oCreature, string s)
{
    return  GetIsObjectValid(GetItemPossessedBy(oCreature, s));
}
//::///////////////////////////////////////////////
//:: Take Gold
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Takes nAmount of gold from the object speaking.
    By default, the gold is destroyed.
*/
//:://////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: November 2001
//:://////////////////////////////////////////////
void TakeGold(int nAmount, object oGoldHolder, int bDestroy=TRUE)
{
    TakeGoldFromCreature(nAmount, oGoldHolder, bDestroy);
}

//::///////////////////////////////////////////////
//:: HasGold
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Checks to see if the player has nAmount of gold
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
int HasGold(int nAmount, object oGoldHolder)
{
    return GetGold(oGoldHolder) >= nAmount;
}
//:: GetNearestPC
//////////////////////////////////////////////////
//
//  GetNearestPC
//
//////////////////////////////////////////////////
//
//
// Returns the PC closes to the object calling
// the function.
//
//////////////////////////////////////////////////
//
//  Created By: Brent
//  Created On: May 16, 2001
//
//////////////////////////////////////////////////
object GetNearestPC()
{
   return GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR,PLAYER_CHAR_IS_PC);
}

//:: SetIsEnemy
//////////////////////////////////////////////////
//
//  [Function Name]
//
//////////////////////////////////////////////////
//
//
// [A description of the function.  This should contain any
// special ranges on input values]
//
//////////////////////////////////////////////////
//
//  Created By:
//  Created On:
//
//////////////////////////////////////////////////
void SetIsEnemy(object oTarget)
{
    AdjustReputation(oTarget, OBJECT_SELF,-100);
    ActionAttack(oTarget);
}
 

///////////////////////////////////////////////////////////////////////////////
//
//  AutoDC
//
///////////////////////////////////////////////////////////////////////////////
//  Returns a pass value based on the object's level and the suggested DC
// December 20 2001: Changed so that the difficulty is determined by the
// NPC's Hit Dice
// November 2002 (Brent): Adding a higher upper range for level 15+ campaigns.
// August 2003 (Georg): Fixed bug not adding up DCs in the correct order
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13 2001
///////////////////////////////////////////////////////////////////////////////
int AutoDC(int DC, int nSkill, object oTarget)
{
    /*
    Easy = Lvl/4 ...rounded up
    Moderate = 3/Lvl + Lvl ...rounded up
    Difficult = Lvl * 1.5 + 6 ...rounded up
    */
    int nLevel = GetHitDice(OBJECT_SELF);
    int nTest = 0;
    // * July 2
    // * If nLevel is less than 0 or 0 then set it to 1
    if (nLevel <= 0)
    {
        nLevel = 1;
    }
    switch (DC)
    {
        case DC_EASY: nTest = nLevel / 4 + 1; break;
            // * minor tweak to lower the values a little
        case DC_MEDIUM: nTest = (3 / nLevel + nLevel) - abs( (nLevel/2) -2); break;
        case DC_HARD: nTest = FloatToInt(nLevel * 1.5 + 6) - abs( ( FloatToInt(nLevel/1.5) -2)); break;
        case DC_SUPERIOR: nTest = 7+ FloatToInt(nLevel * 1.5 + 6) - abs( ( FloatToInt(nLevel/1.5) -2)); break;
        case DC_MASTER: nTest = 14 + FloatToInt(nLevel * 1.5 + 6) - abs( ( FloatToInt(nLevel/1.5) -2)); break;
        case DC_LEGENDARY: nTest = 21 + FloatToInt(nLevel * 1.5 + 6) - abs( ( FloatToInt(nLevel/1.5) -2)); break;
        case DC_EPIC: nTest = 28 + FloatToInt(nLevel * 1.5 + 6) - abs( ( FloatToInt(nLevel/1.5) -2)); break;
    }
 
    // *********************************
    // * CHARM/DOMINATION
    // * If charmed or dominated the NPC
    // * will be at a disadvantage
    // *********************************
    int nCharmMod = 0;
    if (nSkill == SKILL_PERSUADE || nSkill == SKILL_BLUFF || nSkill == SKILL_INTIMIDATE)
        nCharmMod = GetNPCEasyMark(oTarget);
    int nDC = nTest + 10 - nCharmMod ;
    if (nDC < 1 )
        nDC = 1;
    // * Roll d20 + skill rank vs. DC + 10
    if (GetSkillRank(nSkill, oTarget) + d20() >= (nDC) )
    {
       return TRUE;
    }
       return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
//
//  AutoAlignG(int DC, object oTarget)
//
///////////////////////////////////////////////////////////////////////////////
//  Adjusts the alignment of the object towards good, relative to the
//  degree indicated.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
void AutoAlignG(int DC, object oTarget)
{
    int nShift = 0;
    switch (DC)
    {
        case 0: nShift = 3;  break;
        case 1: nShift = 7; break;
        case 2: nShift = 10; break;
    }
    AdjustAlignment(oTarget, ALIGNMENT_GOOD, nShift);
}
///////////////////////////////////////////////////////////////////////////////
//
//  AutoAlignE
//
///////////////////////////////////////////////////////////////////////////////
//  Adjusts the alignment of the object towards evil, relative to the
//  degree indicated.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
void AutoAlignE(int DC, object oTarget)
{
    int nShift = 0;
    switch (DC)
    {
        case 0: nShift = 3;   break;
        case 1: nShift = 7;  break;
        case 2: nShift = 10;  break;
    }
    AdjustAlignment(oTarget, ALIGNMENT_EVIL, nShift);
}

//::///////////////////////////////////////////////
//:: DoGiveXP
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
      Gives the designated XP to the object
      using the design rules for XP
      distribution.
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
void DoGiveXP(string sJournalTag, int nPercentage, object oTarget, int QuestAlignment=ALIGNMENT_NEUTRAL)
{
    float nRewardMod = 1.0;
    // * error handling
    if ((nPercentage < 0) || (nPercentage > 100))
    {
        nPercentage = 100;
    }
    float nXP = GetJournalQuestExperience(sJournalTag) * (nPercentage * 0.01);
    // * for each party member
    // * cycle through them and
    // * and give them the appropriate reward
    // * HACK FOR NOW
    if ((GetAlignmentGoodEvil(oTarget) == ALIGNMENT_NEUTRAL) || (QuestAlignment ==ALIGNMENT_NEUTRAL) )
    {
        nRewardMod = 1.0;
    }
    else
    if (GetAlignmentGoodEvil(oTarget) == QuestAlignment)
    {
        nRewardMod = 1.25;
    }
    else
    if (GetAlignmentGoodEvil(oTarget) != QuestAlignment)
    {
        nRewardMod = 0.75;
    }
//    AssignCommand(oTarget,SpeakString("My XP reward is: " + FloatToString(nRewardMod * nXP)));
    GiveXPToCreature(oTarget, FloatToInt(nRewardMod * nXP));
}
///////////////////////////////////////////////////////////////////////////////
//
//  RewardXP
//
///////////////////////////////////////////////////////////////////////////////
//  Gives each player the reward, scaled 1.25 times if of the correct alignment
//  and 0.75 times if of the wrong alignment.  Neutral always get the
//  1.0 times reward.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
void RewardXP(string sJournalTag, int nPercentage, object oTarget, int QuestAlignment=ALIGNMENT_NEUTRAL, int bAllParty=TRUE)
{
//   AssignCommand(oTarget, SpeakString("in rewardxp funtion"));
    if (bAllParty == TRUE)
    {
        object oPartyMember = GetFirstFactionMember(oTarget, TRUE);
        while (GetIsObjectValid(oPartyMember) == TRUE)
        {
            DoGiveXP(sJournalTag, nPercentage, oPartyMember, QuestAlignment);
            oPartyMember = GetNextFactionMember(oTarget, TRUE);
//            AssignCommand(oTarget,SpeakString("here your xp sir"));
        }
    }
    else
    {
     DoGiveXP(sJournalTag, nPercentage, oTarget, QuestAlignment);
    }

}

///////////////////////////////////////////////////////////////////////////////
//
//  RewardGP
//
///////////////////////////////////////////////////////////////////////////////
//  Gives the GP to (if bAllParty = TRUE) all party members.
//  Each players gets the GP value amount.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
void RewardGP(int GP, object oTarget,int bAllParty=TRUE)
{
    // * for each party member
    // * cycle through them and
    // * and give them the appropriate reward
    // * HACK FOR NOW
    if (bAllParty == TRUE)
    {
        object oPartyMember = GetFirstFactionMember(oTarget, TRUE);
        while (GetIsObjectValid(oPartyMember) == TRUE)
        {
            //AssignCommand(oPartyMember, SpeakString("MY GP reward is: " + IntToString(GP)));
            GiveGoldToCreature(oPartyMember, GP);
            oPartyMember = GetNextFactionMember(oTarget, TRUE);
        }
    }
    else
    {
     GiveGoldToCreature(oTarget, GP);
    }
}

// *
// * Conversation Functions
// *
///////////////////////////////////////////////////////////////////////////////
//
//  CheckCharismaMiddle
//
///////////////////////////////////////////////////////////////////////////////
//  Returns TRUE if charisma is in the normal range.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
int CheckCharismaMiddle()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_CHARISMA) >= 10 && GetAbilityScore(GetPCSpeaker(),ABILITY_CHARISMA) < 15)
 {
   return TRUE;
 }
 return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
//
//  CheckCharismaNormal
//
///////////////////////////////////////////////////////////////////////////////
//  Returns TRUE if charisma is in the normal range.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
int CheckCharismaNormal()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_CHARISMA) >= 10)
 {
   return TRUE;
 }
 return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
//
//  CheckCharismaLow
//
///////////////////////////////////////////////////////////////////////////////
//  Returns TRUE if charisma is in the low range.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
int CheckCharismaLow()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_CHARISMA) < 10)
 {
  return TRUE;
 }
 return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
//
//  CheckCharismaHigh
//
///////////////////////////////////////////////////////////////////////////////
//  Returns TRUE if charisma is in the high range.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
int CheckCharismaHigh()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_CHARISMA) >= 15)
 {
  return TRUE;
 }
 return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
//
//  CheckIntelligenceLow
//
///////////////////////////////////////////////////////////////////////////////
//  Returns TRUE if intelligence is in the low range
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
int CheckIntelligenceLow()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_INTELLIGENCE) < 9)
   return TRUE;
 return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
//
//  CheckIntelligenceNormal
//
///////////////////////////////////////////////////////////////////////////////
//  Returns TRUE if intelligence is in the normal range
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
int CheckIntelligenceNormal()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_INTELLIGENCE) >= 9)
   return TRUE;
 return FALSE;
}
//::///////////////////////////////////////////////
//:: CheckIntelligenceHigh
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
*/
//:://////////////////////////////////////////////
//:: Created By:
//:: Created On:
//:://////////////////////////////////////////////
int CheckIntelligenceHigh()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_INTELLIGENCE) >= 15)
   return TRUE;
 return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
//
//  CheckWisdomHigh
//
///////////////////////////////////////////////////////////////////////////////
//  Returns TRUE if wisdom is in the High range
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 13, 2001
///////////////////////////////////////////////////////////////////////////////
int CheckWisdomHigh()
{
 if (GetAbilityScore(GetPCSpeaker(),ABILITY_WISDOM) > 13)
   return TRUE;
 return FALSE;
}
int GetWisdom(object oTarget)
{
    return GetAbilityScore(oTarget, ABILITY_WISDOM);
}
int GetIntelligence(object oTarget)
{
    return GetAbilityScore(oTarget, ABILITY_INTELLIGENCE);
}
int GetCharisma(object oTarget)
{
    return GetAbilityScore(oTarget, ABILITY_CHARISMA);
}
//:: GetNumItems
//////////////////////////////////////////////////
//
//  GetNumItems
//
//////////////////////////////////////////////////
//
//
// Returns the number of specified item in the
// target's inventory.
//
//////////////////////////////////////////////////
//
//  Created By: John
//  Created On: September 19, 2001
//
//////////////////////////////////////////////////
int GetNumItems(object oTarget,string sItem)
{
    int nNumItems = 0;
    object oItem = GetFirstItemInInventory(oTarget);
    while (GetIsObjectValid(oItem) == TRUE)
    {
        if (GetTag(oItem) == sItem)
        {
            nNumItems = nNumItems + GetNumStackedItems(oItem);
        }
        oItem = GetNextItemInInventory(oTarget);
    }
   return nNumItems;
}
//:: GiveNumItems
//////////////////////////////////////////////////
//
//  GiveNumItems
//
//////////////////////////////////////////////////
//
//
// Gives the target the number of items specified.
//
//////////////////////////////////////////////////
//
//  Created By: John
//  Created On: September 19, 2001
//
//////////////////////////////////////////////////
void GiveNumItems(object oTarget,string sItem,int nNumItems)
{
    int nCount = 0;
    object oItem = GetFirstItemInInventory(OBJECT_SELF);
    while (GetIsObjectValid(oItem) == TRUE && nCount < nNumItems)
    {
        if (GetTag(oItem) == sItem)
        {
            ActionGiveItem(oItem,oTarget);
            nCount++;
        }
        oItem = GetNextItemInInventory(OBJECT_SELF);
    }
   return;
}
//:: TakeNumItems
//////////////////////////////////////////////////
//
//  TakeNumItems
//
//////////////////////////////////////////////////
//
//
// Takes the number of items specified from the target.
//
//////////////////////////////////////////////////
//
//  Created By: John
//  Created On: September 19, 2001
//
//////////////////////////////////////////////////
void TakeNumItems(object oTarget,string sItem,int nNumItems)
{
    int nCount = 0;
    object oItem = GetFirstItemInInventory(oTarget);
    while (GetIsObjectValid(oItem) == TRUE && nCount < nNumItems)
    {
        if (GetTag(oItem) == sItem)
        {
            ActionTakeItem(oItem,oTarget);
            nCount++;
        }
        oItem = GetNextItemInInventory(oTarget);
    }
   return;
}

///////////////////////////////////////////////////////////////////////////////
//
//  GetReactionAdjustment
//
///////////////////////////////////////////////////////////////////////////////
//  Returns the adjusted Reaction for the purposes of store pricing.
///////////////////////////////////////////////////////////////////////////////
//  Created By: Brent, September 25, 2001
///////////////////////////////////////////////////////////////////////////////
 float GetReactionAdjustment(object oTarget)
{
    float nFactionAdjustment = 2.0;
    // (i)
    if (GetIsFriend(oTarget) == TRUE)
    {
        nFactionAdjustment = 1.0;
    }
    // (ii)
    int oTargetLawChaos = GetLawChaosValue(oTarget);
    int oTargetGoodEvil = GetGoodEvilValue(oTarget);
    int oSourceLawChaos = GetLawChaosValue(OBJECT_SELF);
    int oSourceGoodEvil = GetGoodEvilValue(OBJECT_SELF);
    int APB = abs(oSourceLawChaos - oTargetLawChaos)  + abs(oSourceGoodEvil - oTargetGoodEvil);
    int nTargetCharismaMod = GetAbilityModifier(ABILITY_CHARISMA, oTarget);
    return abs(10 + APB - (nTargetCharismaMod * 10)) * nFactionAdjustment;
}
//::///////////////////////////////////////////////
//:: AdjustFactionReputation
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Adjusts all faction member's reputation visa via
    another faction.  Pass in a member from each
    faction.
*/
//:://////////////////////////////////////////////
//:: Created By: Presotn Watamaniuk
//:: Created On: Nov 15, 2001
//:://////////////////////////////////////////////
void AdjustFactionReputation(object oTargetCreature, object oMemberOfSourceFaction, int nAdjustment)
{
    object oFaction = GetFirstFactionMember(oTargetCreature);
    while(GetIsObjectValid(oFaction))
    {
        AdjustReputation(oTargetCreature, oMemberOfSourceFaction, nAdjustment);
        oFaction = GetNextFactionMember(oTargetCreature);
    }
    AdjustReputation(oTargetCreature, oMemberOfSourceFaction, nAdjustment);
}
//::///////////////////////////////////////////////
//:: Escape Via Teleport
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Makes the person teleport away and look like
    they are casting a spell.
*/
//:://////////////////////////////////////////////
//:: Created By: Preston Watamaniuk
//:: Created On: March 12, 2002
//:://////////////////////////////////////////////
void EscapeViaTeleport(object oFleeing)
{
    effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_MONSTER_3);
    ActionCastFakeSpellAtObject(SPELL_MINOR_GLOBE_OF_INVULNERABILITY, oFleeing);
    DelayCommand(1.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oFleeing)));
    DestroyObject(oFleeing, 2.5);
}

//::///////////////////////////////////////////////
//:: GetP(arty)LocalInt
//:: Copyright © 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Scans through all players in the party, to
    treat them all as 'one person' for the purposes
    of most plots. Makes our plots more multiplayer friendly.
*/
//:://////////////////////////////////////////////
//:: Created By: John
//:: Created On:
//:://////////////////////////////////////////////
int GetPLocalInt(object oPC,string sLocalName)
{
    int nValue = 0;
    object oMember;
    oMember = GetFir
               
               

               


                     Modifié par Lazarus Magni, 29 décembre 2013 - 03:51 .
                     
                  


            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Could use some help merging a few scripts.
« Reply #18 on: December 29, 2013, 03:52:57 am »


               And...

_functions_text:


//:://////////////////////////////////////////////////////////////////////////
//:: Created By:    Demented
//:: Name:          Various Text Functions
//:: Modified:
//:: Date           Description
//:: -------------------------------------------------------------------------
//::
//::////////////////////////////////////////////////////////////////////////////
/*
    This function returns a RGB colored sting, be very careful with the
    COLORTOKEN if u alter it all this will not work.
*/
#include "blg_inc"
#include "loc_colour"
/*
//  Returns a properly color-coded sText string based on specified RGB values
string ColourString(string sText, int nRed=255, int nGreen=255, int nBlue=255);
*/
//  Shouts a color-coded Text string based on specified RGB values
void ShoutColoredGuildString(string sShout, object oShouter);
//  Shouts a color-coded Text string based on specified RGB values
void ArenaColoredShoutString(string sShout);
//  Displays a color-coded Text string in only a designated area.
void AreaColoredSpeakString(string sShout, string sAreaname);
//  Float a color-coded Text string to specific area.
void AreaColoredFloatingString(string sMessage, string sAreaname, object oPlayer);
//  This assigns custom tokens for conversation menu's.
void AssignColorTokens();
//  Float a Color-coded Floating Text string based on specified RGB values
void ColoredFloatingString(string sMessage, object oPlayer, int iColor);
//  Float a Complete colored Message based on specified RGB values
void ColoredMessage(object oMessageHolder, object oPlayer, int iColor);
//  Float a Alernate colored Message based on specified RGB values
void ColoredAltMessage(object oMessageHolder, object oPlayer, int iColor);
//  Float a Complete colored Message based on specified RGB values Once
void ColoredMessageOnce(object oMessageHolder, object oPlayer, int iColor);

////////////////////////////////////////////////////////////////////////////////
/*
//------------------------------------------------------------------------------
//-     Returns a properly color-coded sText string based on specified RGB values
//------------------------------------------------------------------------------
string ColourString(string sText, int nRed=255, int nGreen=255, int nBlue=255)
{
    return "<c" + GetSubString(COLOURTOKEN, nRed, 1) + GetSubString(COLOURTOKEN, nGreen, 1) + GetSubString(COLOURTOKEN, nBlue, 1) + ">" + sText + "</c>";
}
*/
//------------------------------------------------------------------------------
//  Shouts a color-coded Text string based on specified RGB values
//------------------------------------------------------------------------------
void ShoutColoredGuildString(string sShout, object oShouter)
{
    int     iC1 = 255;
    int     iC2 = 255;
    int     iC3 = 255;
    int     iGuildID    = GetGuildID(oShouter);
    string  sGuildName  = GetGuildName(iGuildID);
    string  sRankName   = GetRankName(0, iGuildID);
    //  Set the Guild Colors for Shouts
    if(iGuildID == 0) {iC1 = 147;  iC2 = 112;  iC3 = 216;}  //Advos
    if(iGuildID == 1) {iC1 = 178;  iC2 = 34;  iC3 = 34;}  //Advos
    if(iGuildID == 2) {iC1 = 255;  iC2 = 255;  iC3 = 255;} //OBR
    if(iGuildID == 3) {iC1 = 0;  iC2 = 128;  iC3 = 0;} //Kittens
    if(iGuildID == 4) {iC1 = 65; iC2 = 105; iC3 = 205;}  //Outlawz
    if(iGuildID == 5) {iC1 = 128;  iC2 = 128;  iC3 = 128;} //BoS
    if(iGuildID == 6) {iC1 = 34;  iC2 = 205;  iC3 = 178;} //LoV
    SpeakString(ColourString(sShout, iC1, iC2, iC3), TALKVOLUME_SHOUT);
    return;
}

//------------------------------------------------------------------------------
//  Shouts a color-coded Text string based on specified RGB values
//------------------------------------------------------------------------------
void ArenaColoredShoutString(string sShout)
{
    //  Set the Color for the Shout.
    int iC1 = iC1 = 0, iC2 = 128, iC3 = 128;
    SpeakString(ColourString(sShout, iC1, iC2, iC3), TALKVOLUME_SHOUT);
    return;
}
//------------------------------------------------------------------------------
//  Displays a color-coded Text string only in a designated area.
//------------------------------------------------------------------------------
void AreaColoredSpeakString(string sMessage, string sAreaname)
{
    object  oObject = GetFirstPC();
    int iLoop_Cnt   = 0;
    int iMax_Objects = 40;
    //  Set the Color for the Shout.{112, 128, 144}
    int iC1 = iC1 = 0, iC2 = 128, iC3 = 128;
    //  Start a loop throught the player base in game.
    while (GetIsObjectValid(oObject) && iLoop_Cnt <= iMax_Objects)
    {
        //  If the player is located in the designated area.
        if(GetName(GetArea(oObject)) == sAreaname)
        {
            //  Send them the included message.
            SpeakString(ColourString(sMessage, iC1, iC2, iC3), TALKVOLUME_TALK);
         }
         // Increment the Count and get the next player.
         iLoop_Cnt++;
         oObject = GetNextPC();
    }
}
//------------------------------------------------------------------------------
//  Speak a Floating color-coded Text string to all in a specific area.
//------------------------------------------------------------------------------
void AreaColoredFloatingString(string sMessage, string sAreaname, object oPlayer)
{
    object  oObject = GetFirstPC();
    int iLoop_Cnt   = 0;
    int iMax_Objects = 40;
    //  Set the Color for the Shout.
    int iC1 = 0, iC2 = 128, iC3 = 128;
    //  Start a loop throught the player base in game.
    while (GetIsObjectValid(oObject) && iLoop_Cnt <= iMax_Objects)
    {
        //  If the player is located in the designated area.
        if(GetName(GetArea(oObject)) == sAreaname)
        {
            //  Send them the included message.
            FloatingTextStringOnCreature(ColourString(sMessage, iC1, iC2, iC3), oPlayer, FALSE);
         }
         // Increment the Count and get the next player.
         iLoop_Cnt++;
         oObject = GetNextPC();
    }
}
//------------------------------------------------------------------------------
//  This assigns custom tokens for conversation menu's.
//------------------------------------------------------------------------------
void AssignColorTokens()
{
    SetCustomToken(100, "</c>");   // CLOSE tag
    SetCustomToken(101, "<cþ  >"); // red
    SetCustomToken(102, "<c þ >"); // green
    SetCustomToken(103, "<c  þ>"); // blue
    SetCustomToken(104, "<c þþ>"); // cyan
    SetCustomToken(105, "<cþ þ>"); // magenta
    SetCustomToken(106, "<cþþ >"); // yellow
    SetCustomToken(107, "<c   >"); // black
    SetCustomToken(108, "<cÂ¥  >"); // dark red
    SetCustomToken(109, "<c Â¥ >"); // dark green
    SetCustomToken(110, "<c  Â¥>"); // dark blue
    SetCustomToken(111, "<c ¥¥>"); // dark cyan
    SetCustomToken(112, "<cÂ¥ Â¥>"); // dark magenta
    SetCustomToken(113, "<c¥¥ >"); // dark yellow
    SetCustomToken(114, "<c¥¥¥>"); // grey
    SetCustomToken(117, "<cÅ’Å’Å’>"); // dark grey
    SetCustomToken(115, "<cþ¥ >"); // orange
    SetCustomToken(116, "<cþŒ >"); // dark orange
    SetCustomToken(117, "<cÚ¥#>"); // brown
    SetCustomToken(118, "<c† >"); // dark brown
    return;
}

//------------------------------------------------------------------------------
//  Float a Color-coded Floating Text string based on specified RGB values
//------------------------------------------------------------------------------
void ColoredFloatingString(string sMessage, object oPlayer, int iColor)
{
    int     iC1 = 255;
    int     iC2 = 255;
    int     iC3 = 255;
    //  Set the Guild Colors for Shouts,
    if(iColor ==  0) {iC1 = 255; iC2 = 255; iC3 = 255;}   //
    if(iColor ==  1) {iC1 = 178; iC2 = 34;  iC3 = 34;}    //Advos
    if(iColor ==  2) {iC1 = 255; iC2 = 255; iC3 = 255;}   //OBR
    if(iColor ==  3) {iC1 = 0;   iC2 = 128; iC3 = 0;}     //Kittens
    if(iColor ==  4) {iC1 = 65;  iC2 = 105; iC3 = 205;}   //Outlawz
    if(iColor ==  5) {iC1 = 128; iC2 = 128; iC3 = 128;}   //BoS
    if(iColor ==  6) {iC1 = 34;  iC2 = 205; iC3 = 178;}   //LoV
    // Used for other colored shouts.
    if(iColor ==  7) {iC1 = 240; iC2 = 1;   iC3 = 1;}     //Red
    if(iColor ==  8) {iC1 = 1;   iC2 = 240; iC3 = 1;}     //Green
    if(iColor ==  9) {iC1 = 1;   iC2 = 1;   iC3 = 240;}   //Blue
    if(iColor == 10) {iC1 = 185; iC2 = 185; iC3 = 185;}   //Grey
    if(iColor == 11) {iC1 = 30;  iC2 = 210; iC3 = 210;}   //Yellow
    //  Send them the included message.
    FloatingTextStringOnCreature(ColourString(sMessage, iC1, iC2, iC3), oPlayer, FALSE);
    return;
}

//------------------------------------------------------------------------------
//  Float a Complete colored Message based on specified RGB values
//------------------------------------------------------------------------------
void ColoredMessage(object oMessageHolder, object oPlayer, int iColor)
{
    int     iNum_Messages, iMax_Messages = 9;
    string  sVariable, sMessage;
    float   fDelay;
    //  Loop and Display The Message if it exists.
    for (iNum_Messages = 1; iNum_Messages <= iMax_Messages; iNum_Messages++)
    {
        //  Grab the next territory marker.
        sVariable = "Message" + IntToString(iNum_Messages);
        sMessage  = GetLocalString(oMessageHolder, sVariable);
        if (sMessage != "")
        {
            //  Float the Message.
            fDelay = IntToFloat(iNum_Messages);
            DelayCommand(fDelay, ColoredFloatingString(sMessage, oPlayer, iColor));
        }
    }
}
//------------------------------------------------------------------------------
//  Float a Alernate colored Message based on specified RGB values
//------------------------------------------------------------------------------
void ColoredAltMessage(object oMessageHolder, object oPlayer, int iColor)
{
    int     iNum_Messages, iMax_Messages = 9;
    string  sVariable, sMessage;
    float   fDelay;
    //  Loop and Display The Message if it exists.
    for (iNum_Messages = 1; iNum_Messages <= iMax_Messages; iNum_Messages++)
    {
        //  Grab the next territory marker.
        sVariable = "MessageAlt" + IntToString(iNum_Messages);
        sMessage  = GetLocalString(oMessageHolder, sVariable);
        if (sMessage != "")
        {
            //  Float the Message.
            fDelay = IntToFloat(iNum_Messages);
            DelayCommand(fDelay, ColoredFloatingString(sMessage, oPlayer, iColor));
        }
    }
}
//------------------------------------------------------------------------------
//  Float a Complete colored Message based on specified RGB values Once
//------------------------------------------------------------------------------
void ColoredMessageOnce(object oMessageHolder, object oPlayer, int iColor)
{
    int     iNum_Messages, iMax_Messages = 9;
    string  sVariable, sMessage;
    float   fDelay;
    string  sVarname    = GetTag(oMessageHolder);
    int     iViewOnce   = GetLocalInt(oPlayer, sVarname);
    //  Test to see if already viewed.
    if(!iViewOnce)
    {
        //  Loop and Display The Message if it exists.
        for (iNum_Messages = 1; iNum_Messages <= iMax_Messages; iNum_Messages++)
        {
            //  Grab the next territory marker.
            sVariable = "Message" + IntToString(iNum_Messages);
            sMessage  = GetLocalString(oMessageHolder, sVariable);
            if (sMessage != "")
            {
                //  Float the Message.
                fDelay = IntToFloat(iNum_Messages);
                DelayCommand(fDelay, ColoredFloatingString(sMessage, oPlayer, iColor));
            }
        }
    }
}
               
               

               


                     Modifié par Lazarus Magni, 29 décembre 2013 - 03:53 .
                     
                  


            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
Could use some help merging a few scripts.
« Reply #19 on: December 29, 2013, 05:09:19 am »


               kt_arrowtrap- no starting conditional
makeavatar- no starting conditional

On thees two,  you are either trying to compile a regular script as a Starting Condition or they are not scripts at all.  If the are include files.  This error is normal and nothing to worry about.    


x2_inc_switches.nss(17): ERROR: FUNCTION DEFINITION MISSING NAME
x0_i0_positionav.nss(18): ERROR: FUNCTION DEFINITION MISSING NAME
 
Never seen this one before,  Either a function has no name,   something like  

void ();

or 
 int ()
{ }

or it may be related to the problem you are having below. 

zero_ggdi.nss(515): ERROR: UNDEFINED IDENTIFIER (DrawStar)

here an identerfier has not been defined,  It could be that an include is miss-named or not included. 


 _functions_misc.nss(148): ERROR: PARSING VARIABLE LIST

this one could be that you have the same lable defined twice in the same namespace.  or related to the one below. 

inc_divineinterv.nss(183): ERROR: IDENTIFIER LIST FULL

this one is your biggest problem and may be causing all the other ones.   
it is bascally saying that your lable list in you scripts has gotten so bit that is is exceeding the limits of the nwn compiler.   Your option here is to either shorten or limit the number of includes that you place in a script or start using one of the external compilers.    like the PRC compiler.   I have never used any of them so can not help much.    
               
               

               
            

Legacy_Lazarus Magni

  • Hero Member
  • *****
  • Posts: 1837
  • Karma: +0/-0
Could use some help merging a few scripts.
« Reply #20 on: December 30, 2013, 04:31:03 am »


               Thanks Light. I appreciate the input.