Yrian

09/03/2013 15:36:32

Wenas gente, soy nuevo por aqui.

Necesito ayuda para compilar dos scripts, es en referencia a los levels de 41 a 60, todos los scripts me funcionan bien, pero tengo otro ya en el Onleave del server y necesito compilar dos scripts en uno si pudierais ayudarme, no tengo mucha idea de scripts la verdad.

El primero es este:

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);}

Y el segundo es este:

#include "hgll_func_inc"

void main(){ object PC = GetExitingObject(); object M = GetModule();

string Script = GetLocalString(PC, "LetoScript");

if( Script != "" ) { SetLocalString(PC, "LetoScript", ""); LetoScript(Script); }}

Gracias de antemano por si alguien puede ayudarme a compilarlos en 1 solo

Cerril

09/03/2013 16:03:56

si quieres compilar los dos en uno vasta con usar la funcioón ExecuteScript

Está un poquitin descolocado y no pones el nombre de los guiones así que el de arriba lo llamaré guión1 y el de abajo guión2, luego sustituyes guión2 por el nombre de tu guión...

En el guión 1 veo que tienenes dos funciones, pues al final de la función main escribes la función execute de esta forma
[code:1:97fde0694b]
void main()
{
object oPC = GetExitingObject();
string sRIP = ObjectToString(GetModule());
RemoveEffect(oPC, EffectPolymorph(SPELL_POLYMORPH_SELF));
SetCampaignInt(sRIP, GetName(oPC), GetCurrentHitPoints(oPC));
SalvaConjuros(oPC);
ExecuteScript(guión2, OBJECT_SELF);
} [/code:1:97fde0694b]

Recuerda que donde pone guión2, tienes que poner el que tienes tu.

Yrian

09/03/2013 18:07:16

a ver voy a probar gracias por tu respuesta ahora te digo si me funciona

Yrian

09/03/2013 18:14:29

Nada me da fallo en variable definida sin tipo

Mira el primer script se llama 0_tx_salida, el segundo script se llama hgll_client_exit

lo he puesto asi pero me da el fallo:

#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);
ExecuteScript(hgll_client_exit, OBJECT_SELF);
}

AlthorDeMalavir

09/03/2013 18:21:02

Es que el nombre del script ha de estar entre comillas

ExecuteScript("hgll_client_exit", OBJECT_SELF);

Yrian

09/03/2013 18:22:03

ahora si que si, gracias a los dos, muchas gracias

Cerril

09/03/2013 22:47:04

ups. fallo mio :P :oops: