La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 26/04/2024 08:58:42


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
Paiste
Ecuyer
Inscrit le: 25 Mai 2007
Messages: 65
Localisation: Montréal
Répondre en citant
Posté le : 12/08/2008 03:45:37 Sujet du message : Probleme avec Script de Coffre

J'ai trouver un systeme sur vault qui semble faire en sorte qu'un coffre soit lootable pour differente personne et qu'il respawn apres un certain temps...

Mais quand je test...le coffre est toujours vide... besoin d'aide svp merci!! voici le script dans le open!

NWScript :
//:Confused///////////////////////// /////////////////////
//:: (T)reasure (R)espawn and (G)eneration (S)ystem
//:: trgs_i0_respawn
//:Confused///////////////////////// ////////////////////
/*
    This script is intended to manage the respawn
    aspect of treasure generation while being
    compatible with any existing method of actual
    treasure generation. By default, the system is
    tied to the HOTU treasure generation scripts.
*/

//:Confused///////////////////////// ////////////////////
//:: Created By: Mister_Leebo AKA Bent_Spear
//:: Created On: June 14th, 2005
//:Confused///////////////////////// ////////////////////
// This file is safe to modify.

#include "x2_inc_treasure"

// ROOM FOR ADJUSTMENTS
// You can easily adjust the values of the
// following variables here.

// Which method to use (see RESPAWNMETHODS)
const int DEFAULT_RESPAWN_METHOD = 3;
// How long to wait for returning treasure methods (in minutes)
const int DEFAULT_RESPAWN_DELAY = 12;
// Determines multiplier for unlock xp. In testing, I've found that 5
// produces a reasonable value for a module using an Official Campaign
// rate of advancement. If you want it to take much longer to level,
// reduce this value.
const int DEFAULT_UNLOCK_XP = 5;

// TREASURECLASS and TREASURETYPE:
// Same as default HOTU constants with
// memory-friendly labels.
//
// NOTE: If you modify the TRGS to use a system
// other than the BioWare default HOTU
// scripts, you may need to change these
// constants.
const int LOW = 0;
const int MEDIUM = 1;
const int HIGH = 2;

const int NONE = 0;
const int DISPOSABLES = 1;
const int AMMUNITION = 2;
const int GOLD = 4;
const int EQUIPMENT = 8;

// RESPAWN_METHODS
// Explains the different ways a chest might determine if it
// can respawn its treasure. Use the numeric value to the right
// when selecting which method will become your default.

// BioWare Default script effect: First User only, no respawn
const int RESPAWNMETHOD_ONE_SHOT_NO_RETURN = 0;
// First User only, will respawn
const int RESPAWNMETHOD_ONE_SHOT_AND_RETURN = 1;
// All users, no respawn
const int RESPAWNMETHOD_CONTINUOUS_NO_RETURN = 2;
// All users, will respawn
const int RESPAWNMETHOD_CONTINUOUS_AND_RETURN = 3;

// STRING CONSTANTS
// These are all used to construct the names of
// various local variables used by the system.
// They're all listed here so that you may
// find them easily and change them in the rare
// instance that they match something you use.
//
// You do not have to modify these, and it is
// not recommended that you do.
const string ONE_SHOT = "TREASURE_DO_ONCE";
const string CONTINUOUS = "ONCE_FOR_";
const string AND_RETURN = "_UNTIL_LATER";
const string MINUTE_KEY = "TREASURE_RESPAWN_MINUTE";



// Wrapper function to call HOTU default treasure generation script.
// To quickly and easily affix the Treasure Respawn System to ANY
// treasure generation script, just modify this function, but leave
// its name the same.
void GenerateMyTreasure( object oCont, object oOpener, int CLASS, int TYPE );


void GenerateMyTreasure( object oCont, object oOpener, int CLASS, int TYPE )
{
    DTSGenerateTreasureOnContainer( oCont, oOpener, CLASS, TYPE );
}
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur Ignorer l'utilisateur
 
Paiste
Ecuyer
Inscrit le: 25 Mai 2007
Messages: 65
Localisation: Montréal
Répondre en citant
Posté le : 15/08/2008 04:14:29 Sujet du message :

Je sais que la communauté n'est plus se qu'elle était...mais il doit bien y avoir un ame charitable pour m'aider non ? Sad
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur Ignorer l'utilisateur
 
Mythyzyn
Héros
Inscrit le: 23 Jan 2005
Messages: 292
Localisation: Lyncya
Répondre en citant
Posté le : 15/08/2008 13:34:30 Sujet du message :

Essaie voir ça :

NWScript :
//---------------------------- ------------------------------ -------//
// Container Respawn
// by Ahaneon
//
// Respawn container if it has been at least "respawntime" seconds
// after the last time the container spawned.
//
// Script error: containter respawns at midnight too even if it last
// respawned a second before midnight, might fix this later
//---------------------------- ------------------------------ -------//
#include "NW_O2_CONINCLUDE"

void main()

{
    object oItem = OBJECT_INVALID;
    int respawntime = 36000;

    // Check object for the time it was last opened and see if it is time to respawn
    int lastopened = GetLocalInt(OBJECT_SELF,"CS_Opened");
    // CS_Openend = 0 on not found, GetLocalInt error return
    int currenttime = GetTimeSecond()+60*GetTimeMinute()+3600*GetTimeHour();
    if (currenttime > lastopened + respawntime)
    {
        // respawntime seconds passed?
        SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0);
    }
    if (lastopened > currenttime)
    {
        // maybe a whole day passed? or it's midnight?
        SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",0);
    }

    // Respawn chest
    if (GetLocalInt(OBJECT_SELF,"NW_DO_ONCE") == 0)
    {
      oItem = GetFirstItemInInventory();
      while ( oItem != OBJECT_INVALID )
      {
        DestroyObject( oItem, 0.0 );
        oItem = GetNextItemInInventory();
      }
      object oLastOpener = GetLastOpener();
      // See NW_O2_CONINCLUDE for more Treasure generating scripts,
      // Thisone generates high treasure depending on the lastopener level
      GenerateHighTreasure(oLastOpener, OBJECT_SELF);
      SetLocalInt(OBJECT_SELF,"CS_Opened",GetTimeSecond()+60*GetTimeMinute()+3600*GetTimeHour());
      SetLocalInt(OBJECT_SELF,"NW_DO_ONCE",1);
    }
}

//---------------------------- ------------------------------ -------//
Note : le code affiché ci-dessus n'est pas rendu tel qu'il devrait l'être réellement, en particulier des sauts de lignes sont automatiquement insérés pour éviter de casser la mise en page. En le copiant/collant, vous résoudrez ce problème.

_________________
NwN2 - Lyncya 3 - La Guerre du Crystium
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur Ignorer l'utilisateur
 
Paiste
Ecuyer
Inscrit le: 25 Mai 2007
Messages: 65
Localisation: Montréal
Répondre en citant
Posté le : 17/08/2008 04:49:04 Sujet du message :

merci j'ai trouver mon probleme Smile merci encore!!
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur 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 34.818ms