Neverwinter Nights
Menú
Gamersmafia es ahora un archivo de solo lectura.

Sistema de muerte

He metido un sistema de muerte con desangrado, el problema que tengo es que si un pj muere y sale del server y vuelve a entrar aparece vivito y coleando. ¿Hay algun script que deje las cosas tal y como las dejo el pj, si me haceis el favor de indicarme donde se encuentra? Ej: Si un pj tiene 100 puntos de vida y sale con 86 que cuando vuelva a entrar tenga los 86, al igual que los conjuros si tiene 4 conjuros y usa 2 que cuando entre tenga los 2 que no ha utilizado. GRACIAS

Buf, si usas las hrc van asi, pero yo no las uso y no encontre el sistema. Lee por aqui, que una de mis preguntas tiene una respuesta que a lo mejor te ayuda. Yo lo que tengo puesto es una script que cuando entran al server, les deja todas las habilidades a 0, es muy sencillita, y que cuando entren al server entren siempre con 10 de vida..sera muy cutre, pero funciona , y ademas, no se te sobrecarga nada el mod, que las hrc, son un lio, no saco nada en claro de alli.

Tras varias horas en el vault buscando he encontrado la solución dejo la pagina web para que no me pase igual que a mi y se ponga loco sin saber exactamente que buscar, estos script utilizan el oncliententer y el onmoduleload, el único fallo que he visto es que cuando los pj´s matan algunos enemigos estos pj´s sueltan alguna frase en ingles, habría que buscar y traducirlos cosa que de momento no tengo tiempo.

nwvault.ign.com/Files/other/data/…

Por lo que he visto, lo que comentas del nwnvault no guarda la posicion entre resets del server. En los foros de bioware puedes encontrar este script que va en el evento OnEnter del modulo:

[code:1:e4a342e6ba]
// Put before main function
string sDB = "Your campaign DB name goes here";

void Redirect(location lWhere)
{
if (GetArea(OBJECT_SELF) == OBJECT_INVALID)
{
DelayCommand(0.3, Redirect(lWhere));
return;
}

ClearAllActions();
JumpToLocation(lWhere);
}

void SaveLocation()
{
object oArea = GetArea(OBJECT_SELF);

if (oArea != OBJECT_INVALID)
{
SetCampaignString(sDB, "PCArea", GetTag(oArea), OBJECT_SELF);
SetCampaignLocation(sDB, "PCLocation", GetLocation(OBJECT_SELF), OBJECT_SELF);
}

DelayCommand(30.0, SaveLocation());
}

// Put in the main function
object oPC = GetEnteringObject();
location lWhere = GetCampaignLocation(sDB, "PCLocation", oPC);
object oArea = GetObjectByTag(GetCampaignString(sDB, "PCArea"));

if (oArea != OBJECT_INVALID)
{
lWhere = Location(oArea, GetPositionFromLocation(lWhere), GetFacingFromLocation(lWhere));
AssignCommand(oPC, DelayCommand(1.0, Redirect(lWhere)));
}
AssignCommand(oPC, DelayCommand(30.0, SaveLocation()));

[/code:1:e4a342e6ba]

El hilo completo (En ingles) lo tienes aqui: [url]nwn.bioware.com/forums/viewtopic…. />
Este sistema funciona con la base de datos de NWN. y solo guarda la posicion, pero se puede adaptar a guardar los HP tambien.

Yo estoy usando un sistema derivado de este, pero usa NWNX2/ASP con una base de datos MySQL. Si quieres me puedo extender sobre el.

Tienes razón he vendido la piel del oso sin antes cazarla y la solución que he dado de poco vale. Y la verdad es que si te extendieras más sobre este tema te lo agradecería. Uno de los principales problemas es el HP has comentado la posibilidad de adaptar el script que has colgado, ¿podrías decirme como se puede habilitar?
Gracias.

Depende de si usas NWNX2/ASP o no. Voy a intentar hacer una version del mio sin NWNX2, que no deberia ser dificil. Para darte una pista, las funciones GetCurrentHitPoints(oPC) , EffectHeal() y EffectDamage() estan implicadas, la primera al guardar, y las otras al restituir los puntos de golpe. Si tienes un poco de paciencia, intentare tenerlo para hoy o mañana por la mañana (Estoy liado depurando un PW en version alfa :-) )

La version actual tampoco tiene en cuenta si el PJ esta muerto, aunque supongo que al tener menos de 0 HP funcionara correctamente. Lo que todavia no me he tomado la molestia de mirar es como llevar el control de los hechizos y habilidades. Se que las HRC hacen algo, pero es una cosa que si puedo, quiero evitar usar.

Hola he visto que hablabais del sistema de muertes y esas cosas, me gustaría si nos mucha molestia que me pasarais un buen scrip de muerte y que guarde la posición del pj aunque rinicie el server. Soy muy pavo en esto así que ponerme si esto va en on ente,r on exit, en donde lo tenga que poner gracias .

[color=red:70a3c27176]bleeding_config[/color:70a3c27176]
[color=white:70a3c27176] // bleeding_config by Brian “spilth” Kelly
// For Neverwinter Nights - Bleeding Tutorial

// ** Configuration Variables - These are meant to be changed **

int iStabilizationChance = 10;

// GUI Options When Disabled (0 HP)
string sDisabledGUIMessage = “You’ve been disabled. You can either wait for another player to help or respawn if nobody else is around.”;
int bAllowRespawnWhenDisabled = TRUE;
int bAllowWaitForHelpWhenDisabled = TRUE;

// GUI Options When Stable (-1 to -9 and not bleeding)
string sStableGUIMessage = “You’ve stabilized! You can either wait for another player to help or respawn if nobody else is around.”;
int bAllowRespawnWhenStable = TRUE;
int bAllowWaitForHelpWhenStable = TRUE;

// GUI Options When Dead (-10 or lower)
string sDeathGUIMessage = “You’ve died! Here are your options…”;
int bAllowRespawnWhenDead = TRUE;
int bAllowWaitForHelpWhenDead = TRUE;

// ** Constants - DO NOT CHANGE THESE! **
int PC_HEALTH_ALIVE = 0; // HP > 0
int PC_HEALTH_DISABLED = 1; // HP = 0
int PC_HEALTH_DYING = 2; // -10 < HP < 0 & Bleeding
int PC_HEALTH_STABLE = 3; // -10 < HP < 0 & Stabilized
int PC_HEALTH_DEAD = 4; // HP <= -10

// A tool to help us test
void SetPCHitPoints(object oPC, int iTargetHitPoints) {
if (GetIsPC(oPC)) {
int iDamage = GetCurrentHitPoints(oPC) - iTargetHitPoints;
effect eDamage = EffectDamage(iDamage, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);

}

}
[/color:70a3c27176]
[color=red:70a3c27176]OnModuleLoad[/color:70a3c27176]
[color=white:70a3c27176]// Module : OnModuleLoad by Brian “spilth” Kelly
// For Neverwinter Nights - Bleeding Tutorial

void main() {
// Everybody is assumed to be living when the module loads
object oModule = GetModule();
SetLocalInt(oModule, “EverybodyAlive”, TRUE);

}
[/color:70a3c27176]
[color=red:70a3c27176]OnClientEnter[/color:70a3c27176]
[color=white:70a3c27176]// Module : OnClientEnter by Brian “spilth” Kelly
// For Neverwinter Nights - Bleeding Tutorial

#include “bleeding_config”

void main() {
object oPC = GetEnteringObject();

if (GetLocalInt(oPC, "Initialized")) {
    int iLastHP;

    if (GetLocalInt(oPC, "PlayerHealth") == PC_HEALTH_DYING) {
        // They left while bleeding so just make em dead
        iLastHP = -10;
    } else {
        // Set them back to whatever HitPoints they had when they left...
        iLastHP = GetLocalInt(oPC, "LastHitPoints");
    }

    effect eDamage = EffectDamage(GetCurrentHitPoints(oPC) - iLastHP, DAMAGE_TYPE_MAGICAL, DAMAGE_POWER_PLUS_FIVE);
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oPC);

} else {
    // First time they signed on
    SetLocalInt(oPC, "Initialized", TRUE);
    SetLocalInt(oPC, "LastHitPoints", GetCurrentHitPoints(oPC));

}

}
[/color:70a3c27176]
[color=red:70a3c27176]OnClientLeave[/color:70a3c27176]
[color=white:70a3c27176]// Module : OnClientLeave by Brian “spilth” Kelly
// For Neverwinter Nights - Bleeding Tutorial

#include “bleeding_config”

void main() {
// Remember what their hit points were at for when they next sign on…
SetLocalInt(GetExitingObject(), “LastHitPoints”, GetCurrentHitPoints(GetExitingObject()));

}
[/color:70a3c27

Los más activos en Scripting