La Bibliothèque de Neverwinter Nights
Aide et informations diverses sur Neverwinter Nights ainsi que D&D3.
La date/heure actuelle est 13/06/2024 10:56:01


  Page 1 sur 1 ¤

Voir le sujet précédent ¤ Voir le sujet suivant 
Auteur Message
N'kälhäash
Novice
Inscrit le: 12 Avr 2003
Messages: 12
Répondre en citant
Posté le : 14/04/2003 04:00:54 Sujet du message : rajouter un script dans le "onactivate" du module

Bonjour ,
Voila , j'ai déjà un script dans onactivate du module et je dois en placer un autre Surprised comment les fusionner ?
merci Smile
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Cassin
Papa-poule(t) & poissard intemporel
Inscrit le: 16 Sep 2002
Messages: 7471
Localisation: 6 bis rue de la Couveuse, Poulailler 39b
Répondre en citant
Posté le : 14/04/2003 07:50:14 Sujet du message :

NORMALEMENT si tes scripts n'utilisent pas les mêmes références il suffit de les coller l'un en dessous de l'autre (tu inclus le deuxième dans le void main du premier).

Mais si tu mettais tes scripts, ça irait mieux pour t'aider Wink
_________________
Aventure ! Camaraderie ! Et acier sur acier ! Les ingrédients légendaires ! Hein Bouh ?

http://cassin1306.spaces.live.com
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur Ignorer l'utilisateur
 
N'kälhäash
Novice
Inscrit le: 12 Avr 2003
Messages: 12
Répondre en citant
Posté le : 14/04/2003 17:36:04 Sujet du message :

Voilà ce que j'ai déjà (DM helper) :


Code :
#include "hc_inc"
#include "hc_inc_on_act"
#include "hc_text_activate"

object oOther;
void main()
{
    if(!preEvent()) return;
    object oItem=GetItemActivated();
    object oUser=GetItemActivator();
    oOther=GetItemActivatedTarget();
    string sItemTag=GetTag(oItem);

    if(sItemTag=="TrackerTool" &&
       GetLevelByClass(CLASS_TYPE_RANGER, oUser) > 0)
    {
        ExecuteScript("hc_track_start", oUser);
        postEvent();
        return;
    }
    if(sItemTag=="hc_paladinsymb" &&
       GetLevelByClass(CLASS_TYPE_PALADIN,oUser)>0)
    {
        ExecuteScript("hc_pal_detevil",oUser);
        postEvent();
        return;
    }
    if ( sItemTag == "hc_palbadgecour" )
    {
        if(GetLevelByClass(CLASS_TYPE_PALADIN, oUser) < 2)
        {
            SendMessageToPC(oUser,NOINSPIRE);
            postEvent();
            return;
        }
        location lHere = GetItemActivatedTargetLocation();
        oOther=GetFirstObjectInShape(SHAPE_SPHERE,3.0,GetLocation(oUser),FALSE,OBJECT_TYPE_CREATURE);
        effect eVis = EffectVisualEffect(VFX_IMP_GOOD_HELP);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oUser);
        while ( GetIsObjectValid(oOther) )
        {
            if ( (GetIsFriend(oOther,oUser)) && (oOther != oUser ) )
            {
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectSavingThrowIncrease(SAVING_THROW_WILL,4,SAVING_THROW_TYPE_FEAR),oOther,d6(2)*6.0);
                if ( GetIsPC(oOther) )
                    SendMessageToPC(oOther,IMBUECOURAGE);
            }
            oOther=GetNextObjectInShape(SHAPE_SPHERE,3.0,GetLocation(oUser),FALSE,OBJECT_TYPE_CREATURE);
        }
    }
// Thieves' Tools
    if ((sItemTag == "thievesTools") || (sItemTag == "thievesToolsMaster"))
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        SetLocalString(oUser,"TAG",sItemTag);
        ExecuteScript("hc_act_thieftool",oUser);
        postEvent();
        return;
    }
    if ( sItemTag == "BookOfSummons" )
    {
        AssignCommand(oUser, ActionStartConversation(oUser, "hc_c_bookofsummo", TRUE));
    }
    // Active trap searching, gets rid of auto Take 20 problem.
    if (sItemTag == "searchtool")
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_search",oUser);
        postEvent();
        return;
    }
   //Begin Healer's Kit = With thanks to Andalus for taking the time to make.
    if(sItemTag=="hc_healkit")
    {
        if(GetIsPC(oOther) == FALSE)
        {
            postEvent();
            return;
        }
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_healkit",oUser);
        postEvent();
        return;
    }
    //End Healer's Kit


    if(sItemTag=="hc_skinning")
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_skinning",oUser);
        postEvent();
        return;
    }
    if(sItemTag=="hc_acidflask" ||
       sItemTag=="hc_alchfire" ||
       sItemTag=="hc_holywater" ||
       sItemTag=="hc_tangle" ||
       sItemTag=="hc_thunder")
    {
        SetLocalObject(oUser,"GRENADE",oItem);
        SetLocalObject(oUser,"GRENADETARGET",oOther);
        ExecuteScript("hc_grenade", oUser);
    }
    if(sItemTag=="hc_oilflask")
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_oilflask",oUser);
        postEvent();
        return;
    }
    if(FindSubString(sItemTag,"PotionOf")!= -1)
    {
        object oTarget=GetItemActivatedTarget();
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        SetLocalString(oUser,"TAG",sItemTag);
        ExecuteScript("hc_act_potion",oUser);
        postEvent();
        return;
    }

// If the item is the DM Helper, activate it after checking to make sure a
// PC hasnt got their hands on it.
   object oActivator=oUser;
   string sHTarget="";
   string sHLoc;
   string sHConv;

   if(sItemTag=="HCRHelper" || sItemTag=="HCRHelpwand")
   {
      sHTarget="HCRHtarget";
      sHLoc="HCRHloc";
      sHConv="hcrhconv";
   }
   if(GetTag(oItem)=="DMsHelper")
   {
      sHTarget="dmwandtarget";
      sHLoc="dmwandloc";
      sHConv="dmwand";
   }
   if(GetTag(oItem)=="WandOfFX")
   {
      sHTarget="FXWandTarget";
      sHLoc="FXWandLoc";
      sHConv="fxwand";
   }
   if(sHTarget!="")
   {
       // get the wand's activator and target, put target info into local vars on activator
      object oDM = GetItemActivator();
      object oMyTarget = GetItemActivatedTarget();
      SetLocalObject(oDM, sHTarget, oMyTarget);
      location lTargetLoc = GetItemActivatedTargetLocation();
      SetLocalLocation(oDM, sHLoc, lTargetLoc);

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

      while (GetIsObjectValid(oTest) == TRUE)
       {
        if (GetPCPlayerName(oTest) == sTestName && GetIsDM(oTest) == FALSE &&
            GetPCPublicCDKey(oTest)!=GetPersistentString(oMod,"PLAYERDM"))
            {
            DestroyObject(oItem);
            SendMessageToPC(oActivator,NOMORTAL);
            postEvent();
            return;
            }
            oTest=GetNextPC();
       }

      //Make the activator start a conversation with itself
      AssignCommand(oDM, ActionStartConversation(oDM, sHConv, TRUE));
      postEvent();
      return;
   }
   if(GetTag(oItem)=="EmoteWand")
   {
        AssignCommand(oActivator, ActionStartConversation(oActivator, "emotewand", TRUE));
        postEvent();
        return;
   }

   if(GetTag(oItem)=="XPWand")
   {
        object oDM = GetItemActivator();
        object oMyTarget = GetItemActivatedTarget();
        SetLocalObject (oDM, "xpwand_target", oMyTarget);
        AssignCommand (oDM, ActionStartConversation (oDM, "xpwand_conv", TRUE));
        postEvent();
        return;
   }

  if(sItemTag=="PlayerCorpse")
  {
    object oCleric=GetItemActivatedTarget();
    SetLocalObject(oUser,"CLERIC",oCleric);
    SetLocalObject(oUser,"ITEM",oItem);
    ExecuteScript("hc_act_pct",oUser);
  }
  SetLocalObject(oUser,"OTHER",oOther);
  SetLocalObject(oUser,"ITEM",oItem);
  SetLocalString(oUser,"TAG",sItemTag);
  ExecuteScript("hc_act_others",oUser);
  postEvent();
}



Et voila ce que j'aimerai rajouter :


Code :
#include "gzinc_skills"
void main()
{
    // START-------------------------- Dom Queron's Siege Engine System  ----------------
    object oItm = GetItemActivated();
    object oPC = GetItemActivator();
    if (GetTag(oItm) == "GZ_IT_BOOK_SIEGE")
    {
        if (GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)>0 || GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)<30)
        {
            GZSkillSetSkill(oPC,GZ_SKILL_SIEGECRAFT,GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)+10);
        } else
        {
            FloatingTextStringOnCreature("Unfortunatelly you cannot learn anything from this book!",oPC);
        }


    }
    else if (GetTag(oItm) == "GZ_IT_CAT_BOX" || GetTag(oItm) == "GZ_IT_CAT_BOXM"  )
    {


   if (GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)>0) // minimum skill required to use this item
        {
                location lNewPosition = GetLocation(oPC);
                object oNewCatapult;
                if (GetTag(oItm) == "GZ_IT_CAT_BOX")
                    oNewCatapult = CreateObject(OBJECT_TYPE_PLACEABLE, "gz_obj_lcatap", lNewPosition);
                else
                    oNewCatapult = CreateObject(OBJECT_TYPE_PLACEABLE, "gz_obj_mcatap", lNewPosition);

                if (oNewCatapult != OBJECT_INVALID) //only destroy item when successful deployed
                {


                //Designate the player as owner of that catapult.
                SetLocalObject(oNewCatapult, "oOwner", oPC);
                SetLocalObject(oPC, "oCatapult", oNewCatapult);

                //Make the catapult launch its conversation with the player.
                //AssignCommand(oNewCatapult, ActionStartConversation(oPC, "", TRUE));
                DestroyObject(oItm);
                }
                else
                {
                    FloatingTextStringOnCreature("This place is suitable for a siege engine!",oPC);
                }
       }else
    {
        FloatingTextStringOnCreature("I do not know how to handle this item!",oPC);
    }
    }

     // END-------------------------- Dom Queron's Siege Engine System  ----------------
}




^^
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Ignorer l'utilisateur
 
Cassin
Papa-poule(t) & poissard intemporel
Inscrit le: 16 Sep 2002
Messages: 7471
Localisation: 6 bis rue de la Couveuse, Poulailler 39b
Répondre en citant
Posté le : 15/04/2003 09:11:06 Sujet du message :

Ben normalement en faisant ça :

Code :
#include "hc_inc"
#include "hc_inc_on_act"
#include "hc_text_activate"

object oOther;
void main()
{
    if(!preEvent()) return;
    object oItem=GetItemActivated();
    object oUser=GetItemActivator();
    oOther=GetItemActivatedTarget();
    string sItemTag=GetTag(oItem);

    if(sItemTag=="TrackerTool" &&
       GetLevelByClass(CLASS_TYPE_RANGER, oUser) > 0)
    {
        ExecuteScript("hc_track_start", oUser);
        postEvent();
        return;
    }
    if(sItemTag=="hc_paladinsymb" &&
       GetLevelByClass(CLASS_TYPE_PALADIN,oUser)>0)
    {
        ExecuteScript("hc_pal_detevil",oUser);
        postEvent();
        return;
    }
    if ( sItemTag == "hc_palbadgecour" )
    {
        if(GetLevelByClass(CLASS_TYPE_PALADIN, oUser) < 2)
        {
            SendMessageToPC(oUser,NOINSPIRE);
            postEvent();
            return;
        }
        location lHere = GetItemActivatedTargetLocation();
        oOther=GetFirstObjectInShape(SHAPE_SPHERE,3.0,GetLocation(oUser),FALSE,OBJECT_TYPE_CREATURE);
        effect eVis = EffectVisualEffect(VFX_IMP_GOOD_HELP);
        ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oUser);
        while ( GetIsObjectValid(oOther) )
        {
            if ( (GetIsFriend(oOther,oUser)) && (oOther != oUser ) )
            {
                ApplyEffectToObject(DURATION_TYPE_TEMPORARY,EffectSavingThrowIncrease(SAVING_THROW_WILL,4,SAVING_THROW_TYPE_FEAR),oOther,d6(2)*6.0);
                if ( GetIsPC(oOther) )
                    SendMessageToPC(oOther,IMBUECOURAGE);
            }
            oOther=GetNextObjectInShape(SHAPE_SPHERE,3.0,GetLocation(oUser),FALSE,OBJECT_TYPE_CREATURE);
        }
    }
// Thieves' Tools
    if ((sItemTag == "thievesTools") || (sItemTag == "thievesToolsMaster"))
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        SetLocalString(oUser,"TAG",sItemTag);
        ExecuteScript("hc_act_thieftool",oUser);
        postEvent();
        return;
    }
    if ( sItemTag == "BookOfSummons" )
    {
        AssignCommand(oUser, ActionStartConversation(oUser, "hc_c_bookofsummo", TRUE));
    }
    // Active trap searching, gets rid of auto Take 20 problem.
    if (sItemTag == "searchtool")
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_search",oUser);
        postEvent();
        return;
    }
   //Begin Healer's Kit = With thanks to Andalus for taking the time to make.
    if(sItemTag=="hc_healkit")
    {
        if(GetIsPC(oOther) == FALSE)
        {
            postEvent();
            return;
        }
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_healkit",oUser);
        postEvent();
        return;
    }
    //End Healer's Kit


    if(sItemTag=="hc_skinning")
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_skinning",oUser);
        postEvent();
        return;
    }
    if(sItemTag=="hc_acidflask" ||
       sItemTag=="hc_alchfire" ||
       sItemTag=="hc_holywater" ||
       sItemTag=="hc_tangle" ||
       sItemTag=="hc_thunder")
    {
        SetLocalObject(oUser,"GRENADE",oItem);
        SetLocalObject(oUser,"GRENADETARGET",oOther);
        ExecuteScript("hc_grenade", oUser);
    }
    if(sItemTag=="hc_oilflask")
    {
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        ExecuteScript("hc_act_oilflask",oUser);
        postEvent();
        return;
    }
    if(FindSubString(sItemTag,"PotionOf")!= -1)
    {
        object oTarget=GetItemActivatedTarget();
        SetLocalObject(oUser,"OTHER",oOther);
        SetLocalObject(oUser,"ITEM",oItem);
        SetLocalString(oUser,"TAG",sItemTag);
        ExecuteScript("hc_act_potion",oUser);
        postEvent();
        return;
    }

// If the item is the DM Helper, activate it after checking to make sure a
// PC hasnt got their hands on it.
   object oActivator=oUser;
   string sHTarget="";
   string sHLoc;
   string sHConv;

   if(sItemTag=="HCRHelper" || sItemTag=="HCRHelpwand")
   {
      sHTarget="HCRHtarget";
      sHLoc="HCRHloc";
      sHConv="hcrhconv";
   }
   if(GetTag(oItem)=="DMsHelper")
   {
      sHTarget="dmwandtarget";
      sHLoc="dmwandloc";
      sHConv="dmwand";
   }
   if(GetTag(oItem)=="WandOfFX")
   {
      sHTarget="FXWandTarget";
      sHLoc="FXWandLoc";
      sHConv="fxwand";
   }
   if(sHTarget!="")
   {
       // get the wand's activator and target, put target info into local vars on activator
      object oDM = GetItemActivator();
      object oMyTarget = GetItemActivatedTarget();
      SetLocalObject(oDM, sHTarget, oMyTarget);
      location lTargetLoc = GetItemActivatedTargetLocation();
      SetLocalLocation(oDM, sHLoc, lTargetLoc);

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

      while (GetIsObjectValid(oTest) == TRUE)
       {
        if (GetPCPlayerName(oTest) == sTestName && GetIsDM(oTest) == FALSE &&
            GetPCPublicCDKey(oTest)!=GetPersistentString(oMod,"PLAYERDM"))
            {
            DestroyObject(oItem);
            SendMessageToPC(oActivator,NOMORTAL);
            postEvent();
            return;
            }
            oTest=GetNextPC();
       }

      //Make the activator start a conversation with itself
      AssignCommand(oDM, ActionStartConversation(oDM, sHConv, TRUE));
      postEvent();
      return;
   }
   if(GetTag(oItem)=="EmoteWand")
   {
        AssignCommand(oActivator, ActionStartConversation(oActivator, "emotewand", TRUE));
        postEvent();
        return;
   }

   if(GetTag(oItem)=="XPWand")
   {
        object oDM = GetItemActivator();
        object oMyTarget = GetItemActivatedTarget();
        SetLocalObject (oDM, "xpwand_target", oMyTarget);
        AssignCommand (oDM, ActionStartConversation (oDM, "xpwand_conv", TRUE));
        postEvent();
        return;
   }

  if(sItemTag=="PlayerCorpse")
  {
    object oCleric=GetItemActivatedTarget();
    SetLocalObject(oUser,"CLERIC",oCleric);
    SetLocalObject(oUser,"ITEM",oItem);
    ExecuteScript("hc_act_pct",oUser);
  }
  SetLocalObject(oUser,"OTHER",oOther);
  SetLocalObject(oUser,"ITEM",oItem);
  SetLocalString(oUser,"TAG",sItemTag);
  ExecuteScript("hc_act_others",oUser);
  postEvent();


    // START-------------------------- Dom Queron's Siege Engine System  ----------------
    object oItm = GetItemActivated();
    object oPC = GetItemActivator();
    if (GetTag(oItm) == "GZ_IT_BOOK_SIEGE")
    {
        if (GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)>0 || GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)<30)
        {
            GZSkillSetSkill(oPC,GZ_SKILL_SIEGECRAFT,GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)+10);
        } else
        {
            FloatingTextStringOnCreature("Unfortunatelly you cannot learn anything from this book!",oPC);
        }


    }
    else if (GetTag(oItm) == "GZ_IT_CAT_BOX" || GetTag(oItm) == "GZ_IT_CAT_BOXM"  )
    {


   if (GZSkillGetLevel(oPC,GZ_SKILL_SIEGECRAFT)>0) // minimum skill required to use this item
        {
                location lNewPosition = GetLocation(oPC);
                object oNewCatapult;
                if (GetTag(oItm) == "GZ_IT_CAT_BOX")
                    oNewCatapult = CreateObject(OBJECT_TYPE_PLACEABLE, "gz_obj_lcatap", lNewPosition);
                else
                    oNewCatapult = CreateObject(OBJECT_TYPE_PLACEABLE, "gz_obj_mcatap", lNewPosition);

                if (oNewCatapult != OBJECT_INVALID) //only destroy item when successful deployed
                {


                //Designate the player as owner of that catapult.
                SetLocalObject(oNewCatapult, "oOwner", oPC);
                SetLocalObject(oPC, "oCatapult", oNewCatapult);

                //Make the catapult launch its conversation with the player.
                //AssignCommand(oNewCatapult, ActionStartConversation(oPC, "", TRUE));
                DestroyObject(oItm);
                }
                else
                {
                    FloatingTextStringOnCreature("This place is suitable for a siege engine!",oPC);
                }
       }else
    {
        FloatingTextStringOnCreature("I do not know how to handle this item!",oPC);
    }
    }

     // END-------------------------- Dom Queron's Siege Engine System  ----------------
}


ça devrait marcher Wink

(à vérifier hein, je sais pas si ça compile, mais normalement il ne devrait pas y avoir de problème)
_________________
Aventure ! Camaraderie ! Et acier sur acier ! Les ingrédients légendaires ! Hein Bouh ?

http://cassin1306.spaces.live.com
 
Revenir en haut Voir le profil de l'utilisateur Envoyer un message privé Visiter le site web du posteur Ignorer l'utilisateur
 
N'kälhäash
Novice
Inscrit le: 12 Avr 2003
Messages: 12
Répondre en citant
Posté le : 15/04/2003 18:13:32 Sujet du message :

ça marche, merci bien Mr. Green
 
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 34.174ms