La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 22/09/2024 17:41:22


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
Jaheira 007
Seigneur
Inscrit le: 24 Juin 2004
Messages: 223
Répondre en citant
Posté le : 03/08/2004 23:10:20 Sujet du message : Le respawn qui tue!

Voilà pour mon module j'aimerais modifier le script OnPlayerRespawn. J'ai coller le script de la campagne NWN, celui qui enléve 50 points d'XP et de l'or quant on respawn, mais bizarement, dans mon module quant le pj meurt et qu'il respawn, aucune pénalité n'est faite.

N'y a t-il pas un moyen de faire un script + simple, du genre: quant le pj respawn il subit une pénalité de 10% sur son XP totale?
_________________
La nature reprendra ses droits ici, aprés notre passage.
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Jaheira 007
Seigneur
Inscrit le: 24 Juin 2004
Messages: 223
Répondre en citant
Posté le : 06/08/2004 18:43:47 Sujet du message :

n'ayant pas de réponse de votre part, je vais vous demander autre chose. j'aurai peut être plus de succé.

Quel genre de script ( dans le OnPlayerRespawn )utilisez vous dans votre module ?
_________________
La nature reprendra ses droits ici, aprés notre passage.
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
daelan
Voyageur
Inscrit le: 08 Aoû 2004
Messages: 3
Répondre en citant
Posté le : 09/08/2004 09:20:27 Sujet du message :

personnelement j'ai repris le script d'un module disponible sur internet (la guerre d'Evendale) il est plus long qu'il devrait en raison des factions mais bon, chez moi il fonctionne :

script OnPlayerDeath

//:Confused//////////////////////////////////////////////
//:: Generic On Pressed Respawn Button
//:: Copyright (c) 2001 Bioware Corp.
//:Confused/////////////////////////////////////////////
/*
// * June 1: moved RestoreEffects into plot include
*/
//:Confused/////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: November
//:Confused/////////////////////////////////////////////
#include "nw_i0_plot"

// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
int nPenalty = 50 * GetHitDice(oDead);
int nHD = GetHitDice(oDead);
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oDead, nNewXP);
int nGoldToTake = FloatToInt(0.10 * GetGold(oDead));
// * a cap of 10 000gp taken from you
if (nGoldToTake > 10000)
{
nGoldToTake = 10000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));

}

///////////////////////////////////////////////////////////////////////
// this function resets variabls and clears the arenas in the fighter
// 'gauntlet' subplot in chapter one
///////////////////////////////////////////////////////////////////////

void ClearArena(object oPC,string sArena)
{
if(sArena == "Map_M1S4C")
{
DestroyObject(GetObjectByTag("M1S04CHRUSK02"));
DestroyObject(GetObjectByTag("M1S4CBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4HruskDef",0);
}
else if(sArena == "Map_M1S4D")
{
DestroyObject(GetObjectByTag("M1S04CFASHI02"));
DestroyObject(GetObjectByTag("M1S4DBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4FashiDef",0);
CreateItemOnObject("M1S04IBADGELVL01",oPC);
}
else if(sArena == "Map_M1S4E")
{
DestroyObject(GetObjectByTag("M1S04CAGAR02"));
DestroyObject(GetObjectByTag("M1S4EBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4AgarDef",0);
CreateItemOnObject("M1S04IBADGELVL02",oPC);
}
else if(sArena == "Map_M1S4F")
{
DestroyObject(GetObjectByTag("M1S04CCLAUDUS02"));
DestroyObject(GetObjectByTag("M1S4FBeast",0));
DestroyObject(GetObjectByTag("M1S4FBeast",1));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4ClaudusDef",0);
CreateItemOnObject("M1S04IBADGELVL03",oPC);
}
SetLocalInt(oPC,"NW_L_M1S4Won",FALSE);
SetLocalInt(GetModule(),"NW_G_" + sArena + "_Occupied",FALSE);
}

//////////////////////////////////////////////////////////////////////////////


void main()
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
//* Return PC to temple



string sDestTag = "NW_DEATH_TEMPLE";
string sArea = GetTag(GetArea(oRespawner));
/*
CHAPTER 1 SPECIAL CASE
*/
if (sArea == "MAP_M1S3B")
{
sDestTag = "M1_WIZSPAWN";
}
else
if (sArea == "Map_M1S4E" || sArea == "Map_M1S4C" || sArea == "Map_M1S4D" || sArea == "Map_M1S4F")
{
sDestTag = "M1_FIGSPAWN";
ClearArena(oRespawner,sArea);
}
else
/*
CHAPTER 2 SPECIAL CASE
*/
/*
if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oRespawner)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
{

sDestTag = "WP_M2Q2GtoM2Q2F";
}
else
*/
// * Druid Match
if (sArea == "MAP_M2Q2E2")
{
sDestTag = "WP_M2Q2E_ENDDCC";
DestroyObject(GetObjectByTag("M2Q2EWELCARFT"));
DestroyObject(GetObjectByTag("M2Q2EHENNAFT"));
DestroyObject(GetObjectByTag("M2Q2EJANKENFT"));
DestroyObject(GetObjectByTag("M2Q2EELGARFT"));
// * June 2002: Destroy pets as well
DestroyObject(GetObjectByTag("M2Q2EWELCARFTPET"));
DestroyObject(GetObjectByTag("M2Q2EHENNAFTPET"));
DestroyObject(GetObjectByTag("M2Q2EJANKENFTPET"));
DestroyObject(GetObjectByTag("M2Q2EELGARFTPET"));


SetLocalInt(GetObjectByTag("M2Q2EJAER"),"NW_M2Q2E_LFIGHT",FALSE);
}
/*
CHAPTER 3 SPECIAL CASE
*/
else
// * time travel dungeon past - Dungeon
if (sArea == "M3Q2G")
{
sDestTag = "WP_ALTERNATE_SPWN";
}
// * time travel dungeon past - Grove
else
if (sArea == "M3Q2I")
{
sDestTag = "WP_ALTERNATE_SPWN";
}
if (GetIsObjectValid(GetObjectByTag(sDestTag)))
{

if (sDestTag == "NW_DEATH_TEMPLE")
{
object oPriest = GetObjectByTag("NW_DEATH_CLERIC");
//SetLocalInt(oPriest, "NW_L_SAYONELINER", 10);

//AssignCommand(oPriest, DelayCommand(3.0,ActionStartConversation(oRespawner)));
AssignCommand(oPriest, DelayCommand(2.1, PlayVoiceChat(VOICE_CHAT_TALKTOME, oPriest)));

SetLocalLocation(oRespawner, "NW_L_I_DIED_HERE", GetLocation(GetLastRespawnButtonPresser()));
SetLocalInt(oRespawner, "NW_L_I_DIED", 1);
SetLocalObject(oPriest, "NW_L_LASTDIED", GetLastRespawnButtonPresser());
// * April 2002: Moved penalty here, only when going back to the death temple
ApplyPenalty(oRespawner);
}
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
// * mak
}
else
{
// * do nothing, just 'res where you are.
}
}



script OnPlayerRespaw

//:Confused//////////////////////////////////////////////
//:: Generic On Pressed Respawn Button
//:: Copyright (c) 2001 Bioware Corp.
//:Confused/////////////////////////////////////////////
/*
// * June 1: moved RestoreEffects into plot include
*/
//:Confused/////////////////////////////////////////////
//:: Created By: Brent
//:: Created On: November
//:Confused/////////////////////////////////////////////
#include "nw_i0_plot"

// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
int nXP = GetXP(oDead);
int nPenalty = 50 * GetHitDice(oDead);
int nHD = GetHitDice(oDead);
// * You can not lose a level with this respawning
int nMin = ((nHD * (nHD - 1)) / 2) * 1000;

int nNewXP = nXP - nPenalty;
if (nNewXP < nMin)
nNewXP = nMin;
SetXP(oDead, nNewXP);
int nGoldToTake = FloatToInt(0.10 * GetGold(oDead));
// * a cap of 10 000gp taken from you
if (nGoldToTake > 10000)
{
nGoldToTake = 10000;
}
AssignCommand(oDead, TakeGoldFromCreature(nGoldToTake, oDead, TRUE));
DelayCommand(4.0, FloatingTextStrRefOnCreature(58299, oDead, FALSE));
DelayCommand(4.8, FloatingTextStrRefOnCreature(58300, oDead, FALSE));

}

///////////////////////////////////////////////////////////////////////
// this function resets variabls and clears the arenas in the fighter
// 'gauntlet' subplot in chapter one
///////////////////////////////////////////////////////////////////////

void ClearArena(object oPC,string sArena)
{
if(sArena == "Map_M1S4C")
{
DestroyObject(GetObjectByTag("M1S04CHRUSK02"));
DestroyObject(GetObjectByTag("M1S4CBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4HruskDef",0);
}
else if(sArena == "Map_M1S4D")
{
DestroyObject(GetObjectByTag("M1S04CFASHI02"));
DestroyObject(GetObjectByTag("M1S4DBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4FashiDef",0);
CreateItemOnObject("M1S04IBADGELVL01",oPC);
}
else if(sArena == "Map_M1S4E")
{
DestroyObject(GetObjectByTag("M1S04CAGAR02"));
DestroyObject(GetObjectByTag("M1S4EBeast"));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4AgarDef",0);
CreateItemOnObject("M1S04IBADGELVL02",oPC);
}
else if(sArena == "Map_M1S4F")
{
DestroyObject(GetObjectByTag("M1S04CCLAUDUS02"));
DestroyObject(GetObjectByTag("M1S4FBeast",0));
DestroyObject(GetObjectByTag("M1S4FBeast",1));
SetLocalInt(GetObjectByTag(sArena),"NW_A_M1S4ClaudusDef",0);
CreateItemOnObject("M1S04IBADGELVL03",oPC);
}
SetLocalInt(oPC,"NW_L_M1S4Won",FALSE);
SetLocalInt(GetModule(),"NW_G_" + sArena + "_Occupied",FALSE);
}

//////////////////////////////////////////////////////////////////////////////


void main()
{
object oRespawner = GetLastRespawnButtonPresser();
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oRespawner);
ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oRespawner)), oRespawner);
RemoveEffects(oRespawner);
//* Return PC to temple



string sDestTag = "NW_DEATH_TEMPLE";
string sArea = GetTag(GetArea(oRespawner));
/*
CHAPTER 1 SPECIAL CASE
*/
if (sArea == "MAP_M1S3B")
{
sDestTag = "M1_WIZSPAWN";
}
else
if (sArea == "Map_M1S4E" || sArea == "Map_M1S4C" || sArea == "Map_M1S4D" || sArea == "Map_M1S4F")
{
sDestTag = "M1_FIGSPAWN";
ClearArena(oRespawner,sArea);
}
else
/*
CHAPTER 2 SPECIAL CASE
*/
/*
if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oRespawner)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
{

sDestTag = "WP_M2Q2GtoM2Q2F";
}
else
*/
// * Druid Match
if (sArea == "MAP_M2Q2E2")
{
sDestTag = "WP_M2Q2E_ENDDCC";
DestroyObject(GetObjectByTag("M2Q2EWELCARFT"));
DestroyObject(GetObjectByTag("M2Q2EHENNAFT"));
DestroyObject(GetObjectByTag("M2Q2EJANKENFT"));
DestroyObject(GetObjectByTag("M2Q2EELGARFT"));
// * June 2002: Destroy pets as well
DestroyObject(GetObjectByTag("M2Q2EWELCARFTPET"));
DestroyObject(GetObjectByTag("M2Q2EHENNAFTPET"));
DestroyObject(GetObjectByTag("M2Q2EJANKENFTPET"));
DestroyObject(GetObjectByTag("M2Q2EELGARFTPET"));


SetLocalInt(GetObjectByTag("M2Q2EJAER"),"NW_M2Q2E_LFIGHT",FALSE);
}
/*
CHAPTER 3 SPECIAL CASE
*/
else
// * time travel dungeon past - Dungeon
if (sArea == "M3Q2G")
{
sDestTag = "WP_ALTERNATE_SPWN";
}
// * time travel dungeon past - Grove
else
if (sArea == "M3Q2I")
{
sDestTag = "WP_ALTERNATE_SPWN";
}
if (GetIsObjectValid(GetObjectByTag(sDestTag)))
{

if (sDestTag == "NW_DEATH_TEMPLE")
{
object oPriest = GetObjectByTag:grin:("NW_DEATH_CLERIC");Very Happy
//SetLocalInt(oPriest, "NW_L_SAYONELINER", 10);

//AssignCommand(oPriest, DelayCommand(3.0,ActionStartConversation(oRespawner)));
AssignCommand(oPriest, DelayCommand(2.1, PlayVoiceChat(VOICE_CHAT_TALKTOME, oPriest)));

SetLocalLocation(oRespawner, "NW_L_I_DIED_HERE", GetLocation(GetLastRespawnButtonPresser()));
SetLocalInt(oRespawner, "NW_L_I_DIED", 1);
SetLocalObject(oPriest, "NW_L_LASTDIED", GetLastRespawnButtonPresser());
// * April 2002: Moved penalty here, only when going back to the death temple
ApplyPenalty(oRespawner);
}
object oSpawnPoint = GetObjectByTag(sDestTag);
AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
// * mak
}
else
{
// * do nothing, just 'res where you are.
}
}

oubli pas de changer le tag du point de respaw (c un simple point de passage) que tu doit placer dans la zone ou tu veu que le PJ respaw. (celui entre les Smilies)ou plus simple tu cree un point de respaww dont le tag se nomme NW_DEATH_TEMPLE

je suis nouveau dans les script c pk je recopi des script deja fait, dsl d'avance s'il y a des fautes ou si c mal explique
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Jaheira 007
Seigneur
Inscrit le: 24 Juin 2004
Messages: 223
Répondre en citant
Posté le : 09/08/2004 19:36:38 Sujet du message :

Merci mais... c'est quoi la conséquence de ce script?
_________________
La nature reprendra ses droits ici, aprés notre passage.
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Montrer les messages depuis :
Page 1 sur 1 ¤


Vous ne pouvez pas poster de nouveaux sujets dans ce forum
Vous ne pouvez pas répondre aux sujets dans ce forum
Vous ne pouvez pas éditer vos messages dans ce forum
Vous ne pouvez pas supprimer vos messages dans ce forum
Vous ne pouvez pas voter dans les sondages de ce forum


Sauter vers:
FAQ | Rechercher | Liste des Membres | Groupes d'utilisateurs | S'enregistrer | Profil | Se connecter pour vérifier ses messages privés | Connexion
Powered by phpBB 2.* [m] © 2001, 2002 phpBB Group
Theme rewritten in beautiful XHTML code by Baldurien.
Thème "La Bibliothèque de Neverwinter" crée par Kruger
Traduction par : phpBB-fr.com
Page generated in 43.64ms