Author Topic: Help to compile 2 scripts  (Read 316 times)

Legacy_Sharlegion

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
Help to compile 2 scripts
« on: March 08, 2013, 11:00:18 pm »


               Hi people, Im new here.

Well I need some help with 2 scripts, I want to add the High levels 41 to 60 to my server in Nwn1.

All the scripts are running perfect, but int he Onleave Ive got another script, and I don't know how to compile boths, so please if you could help me, I've no idea of scripts to be honest Lol.

The 2 scripts are these.

1st wich Ive got alredy in the Onleave:

include "nw_i0_plot"
int index, iLev;string sLevels = "HP=" + IntToString( iLev ) + ";";
void SalvaConjuros(object oPC){    iLev = GetCurrentHitPoints( oPC );    for( index = 0; index < 622; index++ )    {    iLev = GetHasSpell( index, oPC );    if ( iLev > 0 )    sLevels += "S" + IntToString( index ) + "=" + IntToString( iLev ) + ";";    }    for( index = 0; index < 480; index++ )    {    iLev = GetHasFeat( index, oPC );    if ( iLev > 0 )    sLevels += "F" + IntToString( index ) + "=" + IntToString( iLev ) + ";";    }    SetCampaignString(GetModuleName(), GetName( oPC ) + "Levels", sLevels );}
void main(){    object oPC = GetExitingObject();    string sRIP = ObjectToString(GetModule());    RemoveEffect(oPC, EffectPolymorph(SPELL_POLYMORPH_SELF));    SetCampaignInt(sRIP, GetName(oPC), GetCurrentHitPoints(oPC));
    SalvaConjuros(oPC);}


2nd wich I need to add

#include "hgll_func_inc"
void main(){    object PC = GetExitingObject();    object M = GetModule();
    string Script = GetLocalString(PC, "LetoScript");
    if( Script != "" )        {        SetLocalString(PC, "LetoScript", "");        LetoScript(Script);        }}

So please if anyone could help me to compile boths in one? Thanks very much in advanced
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Help to compile 2 scripts
« Reply #1 on: March 09, 2013, 05:21:49 pm »


               Surprised no one answered this yet. First of all, it looks like your current onclientexit script is incomplete - there's no void main.

Second, the simple way to merge two scripts is to ExecuteScript one of them from the other. You can add the hgll script to your other one in this fashion pretty easily - just put it at the top.

Make sure to compile afterwards.

Funky