La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 23/09/2024 00:30:44


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
Elechos
Acolyte
Inscrit le: 11 Mai 2004
Messages: 31
Répondre en citant
Posté le : 04/07/2004 10:44:10 Sujet du message : problem de repos sur un module

bonjour à tous. Voilà j'ai un probleme sur mon module avec le repos.. je n'arrive pas à utiliser un item de repos ... il s'obstine à me dire : "repos interrompu" si qielqu'un pouvait m'aider...Very Happy

NWScript :
[/nwscript] //dmw_activate

// ** This script goes in the OnItemActivation event of your Module
// ** Properties.  It checks to see if the item used is a DM Helper
// ** And if so, and the user isnt a DM, destroys it, otherwise it
// ** Starts the DM Helper working.  "dmw_inc" contains the actual
// ** code that controls the Helpers effects.  If you update anything
// ** in it, you must recompile the calling dmw_<name> script to make
// ** the change take effect.

void main()
{
  object oItem=GetItemActivated();
  object oActivator=GetItemActivator();
object oAno = GetObjectByTag("pierredelumini"); //ici tu place le tag ou resref de l'item de repos\


if ( oItem == oAno)
{
SetLocalInt (oActivator, "i_TI_LastRest", 0);
FloatingTextStringOnCreature("Vous pouvez maintenant vous reposer", oActivator);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_POLYMORPH), GetLocation(oActivator));
AssignCommand (oActivator, ActionRest());
}

  if(GetTag(oItem)=="DMsHelper")
  {
      // Test to make sure the activator is a DM, or is a DM
      // controlling a creature.
      if(GetIsDM(oActivator) != TRUE)
      {
        object oTest = GetFirstPC();
        string sTestName = GetPCPlayerName(oActivator);
        int nFound = FALSE;
        while (GetIsObjectValid(oTest) && (! nFound))
        {
            if (GetPCPlayerName(oTest) == sTestName)
            {
              if(GetIsDM(oTest))
              {
                  nFound = TRUE;
              }
              else
              {
                  DestroyObject(oItem);
                  SendMessageToPC(oActivator,"");
                  return;
              }
            }
            oTest=GetNextPC();
        }
      }
      // get the wand's activator and target, put target info into local vars on activator
      object oMyActivator = GetItemActivator();
      object oMyTarget = GetItemActivatedTarget();
      SetLocalObject(oMyActivator, "dmwandtarget", oMyTarget);
      location lMyLoc = GetItemActivatedTargetLocation();
      SetLocalLocation(oMyActivator, "dmwandloc", lMyLoc);

      //Make the activator start a conversation with itself
      AssignCommand(oMyActivator, ActionStartConversation(oMyActivator, "dmwand", TRUE));
      return;
  }

  if(GetTag(oItem)=="AutoFollow")
  {
      object oTarget = GetItemActivatedTarget();

      if(GetIsObjectValid(oTarget))
      {
        AssignCommand ( oActivator, ActionForceFollowObject(oTarget));
      }
      return;
  }

  if(GetTag(oItem)=="WandOfFX")
  {

      // get the wand's activator and target, put target info into local vars on activator
      object oDM = GetItemActivator();
      object oMyTarget = GetItemActivatedTarget();
      SetLocalObject(oDM, "FXWandTarget", oMyTarget);
      location lTargetLoc = GetItemActivatedTargetLocation();
      SetLocalLocation(oDM, "FXWandLoc", lTargetLoc);

      object oTest=GetFirstPC();
      string sTestName = GetPCPlayerName(oDM);
      // Test to make sure the activator is a DM, or is a DM
      // controlling a creature.

      if(GetIsDM(oDM) != TRUE)
      {
        object oTest = GetFirstPC();
        string sTestName = GetPCPlayerName(oDM);
        int nFound = FALSE;
        while (GetIsObjectValid(oTest) && (! nFound))
        {
            if (GetPCPlayerName(oTest) == sTestName)
            {
              if(GetIsDM(oTest))
              {
                  nFound = TRUE;
              }
              else
              {
                  DestroyObject(oItem);
                  SendMessageToPC(oDM,"Vous n'etes qu'un mortel, ce n'est pas pour vous !");
                  return;
              }
            }
            oTest=GetNextPC();
        }
      }

      //Make the activator start a conversation with itself
      AssignCommand(oDM, ActionStartConversation(oDM, "fxwand", TRUE));
      return;

  }
  if(GetTag(oItem)=="Teleportation") //tag de l'item qui active la fenetre de dialogue de Tp\
  {
      AssignCommand(oActivator, ActionStartConversation(oActivator, "teleportation", TRUE));//Nom du dialogue a activer une fois l'objet "utiliser"\
      return;
  }
  if(GetTag(oItem)=="EmoteWand")
  {
      AssignCommand(oActivator, ActionStartConversation(oActivator, "emotewand", TRUE));
      return;
  }
  if(GetTag(oItem)=="Tag de l'item")
  {
      AssignCommand(oActivator, ActionStartConversation(oActivator, "nom du dialoque", TRUE));
      return;
}

{
//ICI PIERRE DE RAPPEL\

// si l'objet est la pierre de retour on prend l'utilisateur et on le teleporte au portail
if (GetTag(oItem)=="NW_pierrederappel")
    {
// On verifie que l'utilisateur est un PJ
        if (GetIsPC(oActivator))
            {
            AssignCommand(oActivator, JumpToObject(GetObjectByTag("NW_retournexus")));
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), oActivator);
            }
    }

}


if (GetTag(oItem)=="AnneaudelaMainNoire")
    {
// On verifie que l'utilisateur est un PJ
        if (GetIsPC(oActivator))
            {
            AssignCommand(oActivator, JumpToObject(GetObjectByTag("cachotsdelacrypte")));
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_DISPEL_DISJUNCTION ), oActivator);
            }
    }


if (GetTag(oItem)=="NW_Araignedor")
    {
// On verifie que l'utilisateur est un PJ
        if (GetIsPC(oActivator))
            {
            AssignCommand(oActivator, JumpToObject(GetObjectByTag("ileperduroymort")));
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), oActivator);
            }
    }


if (GetTag(oItem)=="tag de l'autre objet")
    {
// On verifie que l'utilisateur est un PJ
        if (GetIsPC(oActivator))
            {
            AssignCommand(oActivator, JumpToObject(GetObjectByTag("TAg de WP ou de l'objet,creature... de destination ")));
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), oActivator);
            }
    }


if (GetTag(oItem)=="tag de l'autre objet")
    {
// On verifie que l'utilisateur est un PJ
        if (GetIsPC(oActivator))
            {
            AssignCommand(oActivator, JumpToObject(GetObjectByTag("TAg de WP ou de l'objet,creature... de destination ")));
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), oActivator);
            }
    }


if (GetTag(oItem)=="PierredeVoyage")
    {
// On verifie que l'utilisateur est un PJ
        if (GetIsPC(oActivator))
            {
            AssignCommand(oActivator, JumpToObject(GetObjectByTag("rappelnexus")));
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_BREACH), oActivator);
            }
    }

// si l'objet est l'oeil de Balor
if (GetTag(oItem)== "OeilBalor")
    {
    SetLocalInt(GetModule(), "polymorph", 10);
    ApplyEffectToObject(DURATION_TYPE_INSTANT,EffectVisualEffect(VFX_FNF_HORRID_WILTING), oActivator);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectPolymorph(POLYMORPH_TYPE_BALOR), oActivator);
    }


if (GetTag(oItem)=="dmfi_pc_emote")
    {
// On verifie que l'utilisateur est un MD, sinon supprimer les 4 lignes suivants
        if (GetIsDM(oActivator))
            {
            ExecuteScript("dmfi_activate", oActivator);
            }
    }

}
[nwscript]
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.



et j'ai ça sur mon onrest:
NWScript :
int GetHourTimeZero(int iYear = 99999, int iMonth = 99, int iDay = 99, int iHour = 99)
{
  // Check if a specific Date/Time is forwarded to the function.
  // If no or invalid values are forwarded to the function, the current Date/Time will be used
  if (iYear > 30000)
    iYear = GetCalendarYear();
  if (iMonth > 12)
    iMonth = GetCalendarMonth();
  if (iDay > 28)
    iDay = GetCalendarDay();
  if (iHour > 23)
    iHour = GetTimeHour();
  //Calculate and return the "HourTimeZero"-TimeI ndex
  int iHourTimeZero = (iYear)*12*28*24 + (iMonth-1)*28*24 + (iDay-1)*24 + iHour;
  return iHourTimeZero;
}

//:Confused/////////
//:: Main Function
//:: Copyright (c) 2002 Brotherhood of Zock
//:Confused/////////
/*
  The Main Function of the resting script.
*/

//:Confused/////////
//:: Created By: Timo "Lord Gsox" Bischoff (NWN Nick: Kihon)
//:: Created On: August 04, 2002
//:Confused/////////
// The main function placed in the onRest event
void main()
{
  object oPC = GetLastPCRested(); // This Script only affects Player Characters. Familiars, summoned creatures and probably henchmen WILL rest!
  int iRestDelay = 5; // The ammount of hours a player must wait between Rests (Default = 8 hours)
  int iHostileRange = 20; // The radius around the players that must be free of hostiles in order to rest.
                            // iHostileRange = 0: Hostile Check disabled
                            // iHostileRange = x; Radius of Hostile Check (x meters)
                            // This can be abused as some sort of "monster radar".
  // ---------- Rest Event started ----------
  if (GetLastRestEventType() == REST_EVENTTYPE_REST_STARTED)
  {
    // Check if since the last rest more than <iRestDelay> hours have passed.
    if (GetHourTimeZero() < GetLocalInt (oPC, "i_TI_LastRest") + iRestDelay) // i_TI_LastRest is 0 when the player enters the module
    { // Resting IS NOT allowed
      AssignCommand (oPC, ClearAllActions()); // Prevent Resting
      SendMessageToPC (oPC,"Tu dois attendre " + IntToString (iRestDelay - (GetHourTimeZero() - GetLocalInt (oPC, "i_TI_LastRest"))) + " heure(s) avant de te reposer a nouveau.");
    }
    else // Resting IS possible
    {
      object oCreature = GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY);
      if (iHostileRange == 0 || (iHostileRange != 0 && GetDistanceToObject(oCreature) <= IntToFloat(iHostileRange)))
      { // If Hostile Check disabled or no Hostiles within Hostile Radius: Initiate Resting
        object oRestbedroll = CreateObject (OBJECT_TYPE_PLACEABLE, "plc_bedrolls", GetLocation (oPC), FALSE); // Place a static bedroll under the player
        SetLocalObject (oPC, "o_PL_Bedrollrest", oRestbedroll); // Temporary "global" variable. Gets deleted after deletion of the bedroll.
        SetLocalInt (oPC, "i_TI_LastRest", GetHourTimeZero()); // Set Last Rest Time
      }
      else
      { // Resting IS NOT allowed
        AssignCommand (oPC, ClearAllActions()); // Prevent Resting
        SendMessageToPC (oPC, "Tu ne peux pas te reposer : Il y a des ennemis tout pres...");
      }
    }
  }
  // ---------- Rest Event finished or aborted ----------
  if ((GetLastRestEventType() == REST_EVENTTYPE_REST_FINISHED || GetLastRestEventType() == REST_EVENTTYPE_REST_CANCELLED) && GetIsObjectValid(GetLocalObject (oPC, "o_PL_Bedrollrest")))
  { // If a bedroll was placed under the player: Delete it
    DestroyObject (GetLocalObject (oPC, "o_PL_Bedrollrest"), 0.0f);
    DeleteLocalObject (oPC, "o_PL_Bedrollrest");
  }



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



C'est long je sais mais merci d'avaance à ceux qui auront le courage...Razz
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
diraen
Novice
Inscrit le: 04 Juil 2004
Messages: 15
Répondre en citant
Posté le : 04/07/2004 18:05:10 Sujet du message :

Surprised
Ben si quelqu'un trouve ou est le souci ca m'interesse parce que moi je vois pas! Razz
Dernière édition par diraen le 04/07/2004 19:35:06; édité 1 fois
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Klemmth
Seigneur
Inscrit le: 26 Juin 2004
Messages: 176
Localisation: france
Répondre en citant
Posté le : 04/07/2004 19:32:54 Sujet du message :

Les smilies dans les commentaires c'est fait expres ? Laughing

...... c'est bon, j'ai compris, je sort Cool
_________________
...
 
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 73.187ms