Aelor
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Aelor

Forum officiel du module NeverWinter Nights et role play Aelor.
 
AccueilAccueil  PortailPortail  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  Connexion  
Le deal à ne pas rater :
Display Star Wars Unlimited Ombres de la Galaxie : où l’acheter ?
Voir le deal

 

 Script de mort du PJ NWN2

Aller en bas 
2 participants
AuteurMessage
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptyVen 8 Déc - 23:18

Bon selon les dires de Ba'el, ce script serait peut-être buggé, si quelqu'un pouvais me le donner par Mail .. ça serait sympas .... Mercu d'avance.
Revenir en haut Aller en bas
Ba'elzaden
Maitre d'Aelor
Ba'elzaden


Nombre de messages : 909
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 11:30

Code:
//::///////////////////////////////////////////////
//:: Death Script
//:: NW_O0_DEATH.NSS
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
    This script handles the default behavior
    that occurs when a player dies.
   
    BK: October 8 2002: Overriden for Expansion
*/
//:://////////////////////////////////////////////
//:: Created By: Brent Knowles
//:: Created On: November 6, 2001
//:://////////////////////////////////////////////
// BMA-OEI 7/20/06 -- Temp death screen

//const string GUI_DEFAULT_DEATH_SCREEN = "";

// Resurrect and remove negative effects from oPlayer
void Raise( object oPlayer );

// Display death pop-up to oPlayer
void ShowDefaultDeathScreen( object oPlayer );

void main()
{
   object oPlayer = GetLastPlayerDied();
   
   // * increment global tracking number of times that I died
   SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1);

   // * BK: Automation Control. Autopcs ignore death
   if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10)
   {
      Raise(oPlayer);
      //DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF));
      return; // Raise and return
   }

   DelayCommand( 2.5f, ShowDefaultDeathScreen( oPlayer ) );
/*
    // * Handle Spirit of the Wood Death
    string sArea = GetTag(GetArea(oPlayer));

    if (sArea == "MAP_M2Q2F2" && GetDistanceBetweenLocations(GetLocation(GetObjectByTag("M2Q2F2_M2Q2G")), GetLocation(oPlayer)) < 5.0 && GetLocalInt(GetModule(),"NW_M2Q2E_WoodsFreed") == 0)
    {
        int bValid;

        Raise(oPlayer);
        string sDestTag = "WP_M2Q2GtoM2Q2F";
        object oSpawnPoint = GetObjectByTag(sDestTag);
        AssignCommand(oPlayer,JumpToLocation(GetLocation(oSpawnPoint)));
        return;

    }

    // * in last level of the Sourcestone, move the player to the beginning of the area
    // * May 16 2002: or the main area of the Snowglobe (to prevent plot logic problems).
    // * May 21 2002: or Castle Never
    if (sArea == "M4Q1D2" || sArea == "M3Q3C" || sArea == "MAP_M1Q6A")
    {

        //Raise(oPlayer);
        //string sDestTag = "M4QD07_ENTER";
        //object oSpawnPoint = GetObjectByTag(sDestTag);
//        AssignCommand(oPlayer, DelayCommand(1.0, JumpToLocation(GetLocation(oSpawnPoint))));
// * MAY 2002: Just popup the YOU ARE DEAD panel at this point
        DelayCommand(2.5, PopUpDeathGUIPanel(oPlayer,FALSE, TRUE, 66487));
        return;
    }

    // * make friendly to Each of the 3 common factions
    AssignCommand(oPlayer, ClearAllActions());
    // * Note: waiting for Sophia to make SetStandardFactionReptuation to clear all personal reputation
    if (GetStandardFactionReputation(STANDARD_FACTION_COMMONER, oPlayer) <= 10)
    {  SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
        SetStandardFactionReputation(STANDARD_FACTION_COMMONER, 80, oPlayer);
    }
    if (GetStandardFactionReputation(STANDARD_FACTION_MERCHANT, oPlayer) <= 10)
    {  SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
        SetStandardFactionReputation(STANDARD_FACTION_MERCHANT, 80, oPlayer);
    }
    if (GetStandardFactionReputation(STANDARD_FACTION_DEFENDER, oPlayer) <= 10)
    {  SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
        SetStandardFactionReputation(STANDARD_FACTION_DEFENDER, 80, oPlayer);
    }

    DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));
*/
}

/*
void ClearAllFactionMembers(object oMember, object oPlayer)
{
//    AssignCommand(oMember, SpeakString("here"));
    AdjustReputation(oPlayer, oMember, 100);
    SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
    object oClear = GetFirstFactionMember(oMember, FALSE);
    while (GetIsObjectValid(oClear) == TRUE)
    {
        ClearPersonalReputation(oPlayer, oClear);
        oClear = GetNextFactionMember(oMember, FALSE);
    }
}
*/

// Resurrect and remove negative effects from oPlayer
void Raise(object oPlayer)
{
   effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);
   
   effect eBad = GetFirstEffect(oPlayer);
   ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
   ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);
   
   //Search for negative effects
   while(GetIsEffectValid(eBad))
   {
       if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
           GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
           GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
           GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
           GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
           {
               //Remove effect if it is negative.
               RemoveEffect(oPlayer, eBad);
           }
       eBad = GetNextEffect(oPlayer);
   }
   //Fire cast spell at event for the specified target
   SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
   ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}

// Display death pop-up to oPlayer
void ShowDefaultDeathScreen( object oPlayer )
{
   //DisplayGuiScreen( oPlayer, GUI_DEFAULT_DEATH_SCREEN, FALSE );
   DisplayMessageBox( oPlayer, 0, GetStringByStrRef(181408), "gui_death_respawn_self", "", FALSE, "", 6603, "", 0, "" );
}

C'est celui de nwn2 "lors de la mort du PJ" tel qu'il est quand tu lance un module vierge.
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 14:09

Merci je vais voir ça.
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 14:51

Lol Une seule commande n'est pas reconnue pas l'éditeur du 1 et elle n'est pas importante Laughing


EDIT : Arf ils se sont vraiment pas fait chier, c'est exactement le même script à quelques lignes près .... Comprend pas qu'ils aient is autant de temps ....
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 15:00

Bon fin de l'étude du script : Il est très court au final, Il ne fait pas grand chose et surtout, chose bizarre, il n'enleve rien pas d'xp pas de PO .... Il faudrais faire un test pour voir si on en pert ou pas ... Après ça je pourrais commencer à le rescripter ....
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 17:30

Il me faudrais aussi le script correspondant au respawn plizz
Revenir en haut Aller en bas
Ba'elzaden
Maitre d'Aelor
Ba'elzaden


Nombre de messages : 909
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 17:34

Code:
//::///////////////////////////////////////////////
//:: Generic On Pressed Respawn Button
//:: Copyright (c) 2001 Bioware Corp.
//:://////////////////////////////////////////////
/*
// * June 1: moved RestoreEffects into plot include
*/
//:://////////////////////////////////////////////
//:: Created By:  Brent
//:: Created On:  November
//:://////////////////////////////////////////////
#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.
    }
 }
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 17:44

Ah, bah voila ... bon, tu veux que ça fasse quoi ? Dit tout en détail si possible et t'aura ce que tu voudra !

Enlever xp et or oki Mais autre chose ? redirection vers un endroit spécial .... ainsi de suite ...
Revenir en haut Aller en bas
Ba'elzaden
Maitre d'Aelor
Ba'elzaden


Nombre de messages : 909
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 20:38

Déjà dire si les races ayant un ajustement de niveau pourraient poser un problème au script. Deux: refaire un script avec les malus dont on avait discuté.
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 20:52

Pas de problème normalement, il faudrais juste que tu me fasse un petit test :


Dans un dialogue tu met ça (action conséquente)

Code:

void main()
{
object oPc = GetPCSpeaker();
int iLvl1 = GetLevelByPosition(1,oPc);
int iLvl2 = GetLevelByPosition(2,oPc);
int iLvl3 = GetLevelByPosition(3,oPc);
int iLvl4 = GetLevelByPosition(4,oPc);
int iLvl = iLvl1 + iLvl2 + iLvl3 + iLvl4;
FloatingTextStringOnCreature(iLvl,oPc);
}

Tu essaie avec un Aasimar et une race "normale" au lvl 3 et tu me dit le résultat
Revenir en haut Aller en bas
Ba'elzaden
Maitre d'Aelor
Ba'elzaden


Nombre de messages : 909
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptySam 9 Déc - 21:06

Declaration does not match parameters lors de la compilation du script^^
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptyDim 10 Déc - 0:13

Merde ça doi être une commande qui n'existe plus dans le 2

A quelle ligne (à tout hasard)
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptyDim 10 Déc - 3:27

Au pire là j'ai un script, il est OK avec les règles qu'on s'est dîtes et je ne tient pas compte des races sépciales, c'est a dire, que si elles sont sur la feuille de perso lvl 1 avec 3000 xp, le script considère le perso comme un lvl 1

Le script ne t'enleve rien si tu es tué par un PJ.
Si tu veux rajouter des Fonctions, dit le ! Y'a pas de problème

Mort d'un PJ
Code:
//const string GUI_DEFAULT_DEATH_SCREEN = "";

// Resurrect and remove negative effects from oPlayer
void Raise( object oPlayer );

// Display death pop-up to oPlayer
void ShowDefaultDeathScreen( object oPlayer );

void main()
{
    object oPlayer = GetLastPlayerDied();
    if(GetIsPC(GetLastKiller())== TRUE)
        {
        SetLocalInt(oPlayer,"tue_par_pc",TRUE);
        }
    else
        {
        SetLocalInt(oPlayer,"tue_par_pc",FALSE);
        }

  // * increment global tracking number of times that I died
  SetLocalInt(oPlayer, "NW_L_PLAYER_DIED", GetLocalInt(oPlayer, "NW_L_PLAYER_DIED") + 1);

  // * BK: Automation Control. Autopcs ignore death
  if (GetLocalInt(oPlayer, "NW_L_AUTOMATION") == 10)
  {
      Raise(oPlayer);
      //DelayCommand(1.0, ExecuteScript("crawl", OBJECT_SELF));
      return; // Raise and return
  }

  DelayCommand( 2.5f, ShowDefaultDeathScreen( oPlayer ) );
}

/*
void ClearAllFactionMembers(object oMember, object oPlayer)
{
//    AssignCommand(oMember, SpeakString("here"));
    AdjustReputation(oPlayer, oMember, 100);
    SetLocalInt(oPlayer, "NW_G_Playerhasbeenbad", 10); // * Player bad
    object oClear = GetFirstFactionMember(oMember, FALSE);
    while (GetIsObjectValid(oClear) == TRUE)
    {
        ClearPersonalReputation(oPlayer, oClear);
        oClear = GetNextFactionMember(oMember, FALSE);
    }
}
*/

// Resurrect and remove negative effects from oPlayer
void Raise(object oPlayer)
{
  effect eVisual = EffectVisualEffect(VFX_IMP_RESTORATION);

  effect eBad = GetFirstEffect(oPlayer);
  ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectResurrection(),oPlayer);
  ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectHeal(GetMaxHitPoints(oPlayer)), oPlayer);

  //Search for negative effects
  while(GetIsEffectValid(eBad))
  {
      if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
          GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
          GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
          GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
          GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
          {
              //Remove effect if it is negative.
              RemoveEffect(oPlayer, eBad);
          }
      eBad = GetNextEffect(oPlayer);
  }
  //Fire cast spell at event for the specified target
  SignalEvent(oPlayer, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
  ApplyEffectToObject(DURATION_TYPE_INSTANT, eVisual, oPlayer);
}

// Display death pop-up to oPlayer
void ShowDefaultDeathScreen( object oPlayer )
{
    DelayCommand(2.5, PopUpGUIPanel(oPlayer,GUI_PANEL_PLAYER_DEATH));
  //DisplayGuiScreen( oPlayer, GUI_DEFAULT_DEATH_SCREEN, FALSE );
  //DisplayMessageBox( oPlayer, 0, GetStringByStrRef(181408), "gui_death_respawn_self", "", FALSE, "", 6603, "", 0, "" );
}



Lorsque le PJ appuie sur le boutton respawn :
Code:
#include "nw_i0_plot"

// * Applies an XP and GP penalty
// * to the player respawning
void ApplyPenalty(object oDead)
{
    int nXP = GetXP(oDead);
    int iLVL = GetHitDice(oDead);
    int MinXP =  ((iLVL * (iLVL - 1)) / 2) * 1000;
    int nPenalty = FloatToInt(nXP * 0.5);
    int nNewXP = nXP - nPenalty;
    if (nNewXP < MinXP)
      nNewXP = MinXP;
    SetXP(oDead, nNewXP);
  int nGoldToTake =    FloatToInt(0.20 * 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));

}


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


    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);
        }
        object oSpawnPoint = GetObjectByTag(sDestTag);
        AssignCommand(oRespawner,JumpToLocation(GetLocation(oSpawnPoint)));
        if(GetLocalInt(oRespawner,"tue_par_pc")==FALSE)
        ApplyPenalty(oRespawner);
    }
    else
    {
        // * do nothing, just 'res where you are.
    }
 }
Revenir en haut Aller en bas
Ba'elzaden
Maitre d'Aelor
Ba'elzaden


Nombre de messages : 909
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptyDim 10 Déc - 11:59

Ligne 9.
Revenir en haut Aller en bas
Gimli Oakenshield
L'ignorant en Hardware
Gimli Oakenshield


Nombre de messages : 783
Localisation : Près de mon ordi !
Date d'inscription : 15/12/2005

Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 EmptyDim 10 Déc - 12:01

Ah ça change tout
Tu met un speakstring a la place tu dois savoir comment faire non ?
Revenir en haut Aller en bas
Contenu sponsorisé





Script de mort du PJ NWN2 Empty
MessageSujet: Re: Script de mort du PJ NWN2   Script de mort du PJ NWN2 Empty

Revenir en haut Aller en bas
 
Script de mort du PJ NWN2
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» [Script] La statue de la mort pour les morts.
» script pr la viande
» Problème sur un script
» script pr qu'un pnj s'assied
» script quête

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Aelor :: Archives :: Editeur :: Script-
Sauter vers: