La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 19/04/2025 11:59:20


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
Attention ! Vous êtes en train de lire un message hors de son contexte. Veuillez lire le sujet probleme avec mon respwan des item du coffre en entier avant de répondre à ce message.
AZAZEL11
Seigneur
Inscrit le: 08 Fév 2006
Messages: 156
Répondre en citant
Posté le : 23/11/2006 04:09:22 Sujet du message :

voici notre fonctionnement:


script pour l'include:

generertresor

NWScript :
void GenererTresor(object oCoffre)
{
SetLocalString(oCoffre, "sObjet1", "nw_aarcl007");
SetLocalString(oCoffre, "sObjet2", "nw_aarcl012");
SetLocalString(oCoffre, "sObjet3", "nw_aarcl004");
SetLocalString(oCoffre, "sObjet4", "nw_waxgr001");
SetLocalString(oCoffre, "sObjet5", "nw_wblcl001");
SetLocalString(oCoffre, "sObjet6", "nw_wblfh001");
SetLocalString(oCoffre, "sObjet7", "nw_wblfl001");
SetLocalString(oCoffre, "sObjet8", "nw_wblhl001");
SetLocalString(oCoffre, "sObjet9", "nw_wblhw001");
SetLocalString(oCoffre, "sObjet10", "nw_wblml001");
SetLocalString(oCoffre, "sObjet11", "nw_wblms001");
SetLocalString(oCoffre, "sObjet12", "nw_wbwln001");
SetLocalString(oCoffre, "sObjet13", "nw_wbwsh001");
SetLocalString(oCoffre, "sObjet14", "nw_it_mboots001");
SetLocalString(oCoffre, "sObjet15", "nw_it_mbracer002");
SetLocalString(oCoffre, "sObjet16", "nw_maarcl104");
SetLocalString(oCoffre, "sObjet17", "nw_wbwxh001");
SetLocalString(oCoffre, "sObjet18", "nw_wbwxl001");
SetLocalString(oCoffre, "sObjet19", "nw_wdbax001");
SetLocalString(oCoffre, "sObjet20", "nw_wdbma001");
SetLocalString(oCoffre, "sObjet21", "nw_wdbqs001");
SetLocalString(oCoffre, "sObjet22", "nw_wdbsw001");
SetLocalString(oCoffre, "sObjet23", "nw_wspka001");
SetLocalString(oCoffre, "sObjet24", "nw_wspku001");
SetLocalString(oCoffre, "sObjet25", "nw_wspsc001");
SetLocalString(oCoffre, "sObjet26", "nw_it_gem001");
SetLocalString(oCoffre, "sObjet27", "nw_it_gem007");
SetLocalString(oCoffre, "sObjet28", "nw_it_gem002");
SetLocalString(oCoffre, "sObjet29", "nw_it_gem014");
SetLocalString(oCoffre, "sObjet30", "nw_it_gem004");
SetLocalString(oCoffre, "sObjet31", "nw_it_gem003");
SetLocalString(oCoffre, "sObjet32", "nw_it_gem015");
SetLocalString(oCoffre, "sObjet33", "nw_it_gem011");
SetLocalString(oCoffre, "sObjet34", "nw_it_gem013");
SetLocalString(oCoffre, "sObjet35", "nw_it_gem010");
SetLocalString(oCoffre, "sObjet36", "nw_it_gem008");
SetLocalString(oCoffre, "sObjet37", "nw_it_gem009");
SetLocalString(oCoffre, "sObjet38", "nw_it_gem005");
SetLocalString(oCoffre, "sObjet39", "nw_it_gem006");
SetLocalString(oCoffre, "sObjet40", "nw_it_gem012");
SetLocalString(oCoffre, "sObjet41", "nw_armhe011");
SetLocalString(oCoffre, "sObjet42", "nw_arhe002");
SetLocalString(oCoffre, "sObjet43", "nw_it_mneck001");
SetLocalString(oCoffre, "sObjet44", "nw_it_mring021");
SetLocalString(oCoffre, "sObjet45", "nw_it_mring022");
SetLocalString(oCoffre, "sObjet46", "x2_it_poison013");
SetLocalString(oCoffre, "sObjet47", "nw_wplhb001");
SetLocalString(oCoffre, "sObjet48", "nw_wplsc001");
SetLocalString(oCoffre, "sObjet49", "nw_wplss001");
SetLocalString(oCoffre, "sObjet50", "nw_it_mpotion001");
SetLocalString(oCoffre, "sObjet51", "nw_it_mpotion009");
SetLocalString(oCoffre, "sObjet52", "nw_ashlw001");
SetLocalString(oCoffre, "sObjet53", "nw_ashsw001");
SetLocalString(oCoffre, "sObjet54", "nw_ashto001");
SetLocalString(oCoffre, "sObjet55", "nw_wbwsl001");
SetLocalString(oCoffre, "sObjet56", "nw_wswbs001");
SetLocalString(oCoffre, "sObjet57", "nw_wswdg001");
SetLocalString(oCoffre, "sObjet58", "nw_wswgs001");
SetLocalString(oCoffre, "sObjet59", "nw_wswka001");
SetLocalString(oCoffre, "sObjet60", "nw_wswls001");
SetLocalString(oCoffre, "sObjet61", "nw_wswrp001");
SetLocalString(oCoffre, "sObjet62", "nw_wswsc001");
SetLocalString(oCoffre, "sObjet63", "nw_wswss001");
SetLocalString(oCoffre, "sObjet64", "nw_it_picks001");
SetLocalString(oCoffre, "sObjet65", "nw_wthax001");
SetLocalString(oCoffre, "sObjet66", "nw_wthdt001");
SetLocalString(oCoffre, "sObjet67", "nw_wthsh001");
SetLocalString(oCoffre, "sObjet68", "nw_it_medkit001");
// lvl11 a 17
SetLocalString(oCoffre, "sObjet69", "nw_aarcl006");
SetLocalString(oCoffre, "sObjet70", "nw_maarcl051");
SetLocalString(oCoffre, "sObjet71", "nw_maarcl050");
SetLocalString(oCoffre, "sObjet72", "nw_maarcl064");
SetLocalString(oCoffre, "sObjet73", "nw_maarcl068");
SetLocalString(oCoffre, "sObjet74", "nw_maarcl043");
SetLocalString(oCoffre, "sObjet75", "nw_maarcl045");
SetLocalString(oCoffre, "sObjet76", "nw_maarcl072");
SetLocalString(oCoffre, "sObjet77", "nw_maarcl067");
SetLocalString(oCoffre, "sObjet78", "nw_maarcl048");
SetLocalString(oCoffre, "sObjet79", "nw_maarcl066");
SetLocalString(oCoffre, "sObjet80", "nw_waxmbt002");
SetLocalString(oCoffre, "sObjet81", "nw_waxmbt010");
SetLocalString(oCoffre, "sObjet82", "x2_wmdwraxe002");
SetLocalString(oCoffre, "sObjet83", "x2_wmdwraxe003");
SetLocalString(oCoffre, "sObjet84", "nw_waxmgr002");
SetLocalString(oCoffre, "sObjet85", "nw_waxmgr009");
SetLocalString(oCoffre, "sObjet86", "nw_wblmcl002");
SetLocalString(oCoffre, "sObjet87", "nw_wblmcl010");
SetLocalString(oCoffre, "sObjet88", "nw_wblmfh002");
SetLocalString(oCoffre, "sObjet89", "nw_wblmfh010");
SetLocalString(oCoffre, "sObjet90", "nw_wblmfl002");
SetLocalString(oCoffre, "sObjet91", "nw_wblmfl010");
SetLocalString(oCoffre, "sObjet92", "nw_wblmhl002");
SetLocalString(oCoffre, "sObjet93", "nw_wblmhl010");
SetLocalString(oCoffre, "sObjet94", "nw_wblmhw002");
SetLocalString(oCoffre, "sObjet95", "nw_wblmhw011");
SetLocalString(oCoffre, "sObjet96", "nw_wblmml002");
SetLocalString(oCoffre, "sObjet97", "nw_wblmml011");
SetLocalString(oCoffre, "sObjet98", "nw_wblmms002");
SetLocalString(oCoffre, "sObjet99", "nw_wblmms010");
SetLocalString(oCoffre, "sObjet100", "nw_wbwmln002");
SetLocalString(oCoffre, "sObjet101", "nw_wbwmln008");
SetLocalString(oCoffre, "sObjet102", "nw_wbwmln010");
SetLocalString(oCoffre, "sObjet103", "nw_wbwmsh002");
SetLocalString(oCoffre, "sObjet104", "nw_wbwmsh008");
SetLocalString(oCoffre, "sObjet105", "nw_it_mboots006");
SetLocalString(oCoffre, "sObjet106", "nw_it_mbracer007");
SetLocalString(oCoffre, " sObjet107", "nw_it_mbracer003");
SetLocalString(oCoffre, "sObjet108", "nw_maarcl031");
SetLocalString(oCoffre, "sObjet109", "nw_maarcl092");
SetLocalString(oCoffre, "sObjet110", "nw_maarcl088");
SetLocalString(oCoffre, "sObjet111", "nw_wbwmxh002");
SetLocalString(oCoffre, "sObjet112", "nw_wbwmxh008");
SetLocalString(oCoffre, "sObjet113", "nw_wbwmxl002");
SetLocalString(oCoffre, "sObjet114", "nw_wbwmxl008");
SetLocalString(oCoffre, "sObjet115", "nw_wdbmax002");
SetLocalString(oCoffre, "sObjet116", "nw_wdbmma002");
SetLocalString(oCoffre, "sObjet117", "nw_wdbmqs002");
SetLocalString(oCoffre, "sObjet118", "nw_wdbmqs008");
SetLocalString(oCoffre, "sObjet119", "nw_wdbmsw002");
SetLocalString(oCoffre, "sObjet120", "nw_wspmka002");
SetLocalString(oCoffre, "sObjet121", "nw_wspmka008");
SetLocalString(oCoffre, "sObjet122", "nw_wspmku002");
SetLocalString(oCoffre, "sObjet123", "nw_wspmku008");
SetLocalString(oCoffre, "sObjet124", "nw_wspmsc002");
SetLocalString(oCoffre, "sObjet125", "nw_wspmsc010");
SetLocalString(oCoffre, "sObjet126", "x2_it_wpmwhip1");
SetLocalString(oCoffre, "sObjet127", "x2_it_wpmwhip2");
SetLocalString(oCoffre, "sObjet128", "x2_it_arhelm01");
SetLocalString(oCoffre, "sObjet129", "nw_armhe012");
SetLocalString(oCoffre, "sObjet130", "nw_it_mneck024");
SetLocalString(oCoffre, "sObjet131", "nw_it_mneck025");
SetLocalString(oCoffre, "sObjet132", "nw_it_mneck012");
SetLocalString(oCoffre, "sObjet133", "x2_it_mneck001");
SetLocalString(oCoffre, "sObjet134", "nw_it_mneck013");
SetLocalString(oCoffre, "sObjet135", "nw_it_mring025");
SetLocalString(oCoffre, "sObjet136", "nw_it_mring008");
SetLocalString(oCoffre, "sObjet137", "nw_it_mring029");
SetLocalString(oCoffre, "sObjet138", "nw_it_mmidmisc01");
SetLocalString(oCoffre, "sObjet139", "nw_it_contain002");
SetLocalString(oCoffre, "sObjet140", "nw_wplmhb002");
SetLocalString(oCoffre, "sObjet141", "nw_wplmhb010");
SetLocalString(oCoffre, "sObjet142", "nw_wplmsc002");
SetLocalString(oCoffre, "sObjet143", "nw_wplmsc010");
SetLocalString(oCoffre, "sObjet144", "nw_wplmss002");
SetLocalString(oCoffre, "sObjet145", "nw_wplmss010");
SetLocalString(oCoffre, "sObjet146", "nw_it_mpotion010");
SetLocalString(oCoffre, "sObjet147", "nw_it_mpotion008");
SetLocalString(oCoffre, "sObjet148", "nw_it_mpotion003");
SetLocalString(oCoffre, "sObjet149", "nw_it_mpotion004");
SetLocalString(oCoffre, "sObjet150", "nw_it_mpotion007");
SetLocalString(oCoffre, "sObjet151", "nw_ashmlw002");
SetLocalString(oCoffre, "sObjet152", "nw_ashmlw008");
SetLocalString(oCoffre, "sObjet153", "nw_ashmsw002");
SetLocalString(oCoffre, "sObjet154", "nw_ashmsw008");
SetLocalString(oCoffre, "sObjet155", "nw_ashmto002");
SetLocalString(oCoffre, "sObjet156", "nw_ashmto008");
SetLocalString(oCoffre, "sObjet157", "nw_wbwmsl001");
SetLocalString(oCoffre, "sObjet158", "nw_wbwmsl009");
SetLocalString(oCoffre, "sObjet159", "nw_wswmbs002");
SetLocalString(oCoffre, "sObjet160", "nw_wswmbs009");
SetLocalString(oCoffre, "sObjet161", "nw_wswmdg002");
SetLocalString(oCoffre, "sObjet162", "nw_wswmdg008");
SetLocalString(oCoffre, "sObjet163", "nw_wswmgs002");
SetLocalString(oCoffre, "sObjet164", "nw_wswmgs011");
SetLocalString(oCoffre, "sObjet165", "nw_wswmka002");
SetLocalString(oCoffre, "sObjet166", "nw_wswmka010");
SetLocalString(oCoffre, "sObjet167", "nw_wswmls002");
SetLocalString(oCoffre, "sObjet168", "nw_wswmls010");
SetLocalString(oCoffre, "sObjet169", "nw_wswmrp002");
SetLocalString(oCoffre, "sObjet170", "nw_wswmrp010");
SetLocalString(oCoffre, "sObjet171", "nw_wswmsc002");
SetLocalString(oCoffre, "sObjet172", "nw_wswmsc010");
SetLocalString(oCoffre, "sObjet173", "nw_wswmss002");
SetLocalString(oCoffre, "sObjet174", "nw_wswmss009");
SetLocalString(oCoffre, "sObjet175", "nw_it_picks002");
SetLocalString(oCoffre, "sObjet176", "nw_it_picks003");
SetLocalString(oCoffre, "sObjet177", "x2_it_picks001");
SetLocalString(oCoffre, "sObjet178", "nw_wthmax002");
SetLocalString(oCoffre, "sObjet179", "nw_wthmax008");
SetLocalString(oCoffre, "sObjet180", "nw_it_trap015");
SetLocalString(oCoffre, "sObjet181", "nw_it_trap011");
SetLocalString(oCoffre, "sObjet182", "nw_it_trap028");
SetLocalString(oCoffre, "sObjet183", "nw_wmgwn008");
SetLocalString(oCoffre, "sObjet184", "nw_wmgwn004");
SetLocalString(oCoffre, "sObjet185", "nw_it_medkit001");
SetLocalString(oCoffre, "sObjet186", "nw_it_medkit002");
// lvl 18 a 25
SetLocalString(oCoffre, "sObjet187", "nw_it_medkit003");
SetLocalString(oCoffre, "sObjet188", "nw_it_mpotion002");
SetLocalString(oCoffre, "sObjet189", "nw_it_mpotion012");
SetLocalString(oCoffre, "sObjet190", "nw_it_mpotion006");

object oPC = GetLastOpenedBy();
int iLvl1 = GetLevelByPosition(1, oPC);
int iLvl2 = GetLevelByPosition(2, oPC);
int iLvl3 = GetLevelByPosition(3, oPC);
int iLvl = iLvl1 + iLvl2 + iLvl3;
int iRand = Random(100);
int iOb1 = Random(67)+1;
string sOb1 = IntToString(iOb1);
int iOb2 = Random(185)+1;
string sOb2 = IntToString(iOb2);
int iOb3 = Random(189)+1;
string sOb3 = IntToString(iOb3);
int iGold = Random(500);
int iGold2 = Random(800);
int iGold3 = Random(1000);

    if (iLvl <= 10)
        {
        if (iRand >= 26)
            {
            string sCreat = "sObjet"+sOb1;
            CreateItemOnObject(GetLocalString(oCoffre,sCreat),oCoffre);
            }
        else
            {
            if (iGold < 100)
                {iGold = 100;
                GiveGoldToCreature(oCoffre, iGold);
                }
            else
                {
            GiveGoldToCreature(oCoffre, iGold);
                }
            }
        }
    if (iLvl >= 11&&iLvl <= 17)
        {
        if (iRand >= 26)
            {
            string sCreat = "sObjet"+sOb2;
            CreateItemOnObject(GetLocalString(oCoffre,sCreat),oCoffre);
            }
        else
            {
            if (iGold2 < 500)
                {iGold2 = 500;
                GiveGoldToCreature(oCoffre, iGold2);
                }
            else
                {
            GiveGoldToCreature(oCoffre, iGold);
                }
            }
        }
    if (iLvl >= 18&&iLvl <= 25)
        {
        if (iRand >= 26)
            {
            string sCreat = "sObjet"+sOb3;
            CreateItemOnObject(GetLocalString(oCoffre,sCreat),oCoffre);
            }
        else
            {
            if (iGold3 < 800)
                {iGold3 = 800;
                GiveGoldToCreature(oCoffre, iGold);
                }
                else
                {
            GiveGoldToCreature(oCoffre, iGold3);
                }
            }
        }

}
Le code a colorer syntaxiquement est trop long (plus de 10240 caractères) et risque de ne pas s'afficher du tout. Vous pouvez le voir en version colorée ici.





et le script principal^^


NWScript :
#include "generertresor"
void main()
{
object oItem = OBJECT_INVALID;
object oCoffre = OBJECT_SELF;
object oPC = GetLastOpenedBy();
int iLvl = GetLevelByClass(CREATURE_TYPE_CLASS, oPC);
int iOpen = GetLocalInt(oCoffre,"ouvert");
int iChrono = GetLocalInt(oCoffre,"chrono");
int respawntime = 43200;
int iCurrenttime = GetTimeSecond()+60*GetTimeMinute()+3600*GetTimeHour();

    if (iCurrenttime > iChrono + respawntime||iChrono > iCurrenttime)
        {
        SetLocalInt(oCoffre,"ouvert",0);
        }
    if (iOpen==0)
        {
        GenererTresor(oCoffre);
        SetLocalInt(oCoffre,"ouvert",1);
        SetLocalInt(oCoffre,"chrono",iCurrenttime);
        }
    else
        {
        FloatingTextStringOnCreature("Ce coffre est vide", oPC, TRUE);
        }


}
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.

_________________
L'imagination est plus importante que le savoir. (Albert Einstein)
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé
 
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 38.388ms