Archives des forums MMO/MMORPG > Neverwinter Nights > NWN - Maskado > J'en sors plus (pblm de création de placeable avec un item)
J'en sors plus (pblm de création de placeable avec un item)
Par Elmo le 20/11/2002 Ã 9:12:47 (#2599677)
j'ai essayé en me basant sur le script des barrils explosif mais (je sais reconnaitre mes limites, une de mes (trop?) rares qualités...) je comprends pas comment faire!
je sais qu'il faut passer par le Onunacquireitem du module mais c'est tout, ah oui comme j'ai déjà installé les barrils explosifs j'ai ceci dans onunacquireitem:#include "gzi_pkeg_onunaq"
void PowderKeg()
{
//if(!preEvent()) return;//Uncomment for HCR and other script that need this! Or delete this line.
if (CheckPKegUnaquire())
return;
//postEvent();//Uncomment for HCR and other script that need this! Or delete this line.
}
void main()
{
//other();//Example (This line is not to be included) This line can be deleted.
//stuff();//Example (This line is not to be included) This line can be deleted.
//you();//Example (This line is not to be included) This line can be deleted.
//may_have();//Example (This line is not to be included) This line can be deleted.
PowderKeg();
}
comme vous pouvez le voir il appelle un autre script, au cas ou ça serait utile je le met aussi
//::///////////////////////////////////////////////
//:: Part of the Powder Keg item
//:: Copyright (c) 2002 www.NWNZone.com
//:: Copyright (c) 2002www.gulbsoft.de
//:://////////////////////////////////////////////
//:: [Part of the Powder Keg item]
//:: [V2.0a]
//:://////////////////////////////////////////////
//:: Version 2.0a Created By: Xeno
//:: Version 1.0? Created By: Dom Queron
//:: Created On: 1 Nov 2002
//:://////////////////////////////////////////////
// Dom Queron's powderkeg: Call in Module OnUnaquireItem. Will return TRUE
// if a powderkeg was unaquired
int CheckPKegUnaquire();
int CheckPKegUnaquire()
{
object oKeg = GetModuleItemLost();
if (GetTag(oKeg) == "gz_it_pkeg")
{
location lLoc = GetLocation(oKeg);
DestroyObject(oKeg);
CreateObject(OBJECT_TYPE_PLACEABLE,"gz_obj_pkeg",lLoc);
return TRUE;
} else
return FALSE;
}
pour créer l'item dans l'inventaire j'ai déjà le bon script (fiou!) donc ô dieu du script aidez-mwa
Par eMRaistlin le 20/11/2002 Ã 9:31:13 (#2599745)
OnUnaquired
#include "gzi_pkeg_onunaq"
void PowderKeg()
{
//if(!preEvent()) return;//Uncomment for HCR and other script that need this! Or delete this line.
if (CheckPKegUnaquire())
return;
//postEvent();//Uncomment for HCR and other script that need this! Or delete this line.
}
void main()
{
//other();//Example (This line is not to be included) This line can be deleted.
//stuff();//Example (This line is not to be included) This line can be deleted.
//you();//Example (This line is not to be included) This line can be deleted.
//may_have();//Example (This line is not to be included) This line can be deleted.
PowderKeg();
/////////////////////////////////////////////
//:Ici, on va s'occuper de ton placeable
/////////////////////////////////////////////
object oItem = GetModuleItemLost();
location lLocation = GetLocation(oItem);
if (GetTag(oItem)=="Magipulte")
{
DestroyObject(oItem);
CreateObject(OBJECT_TYPE_PLACEABLE ,"RESREF_ET_PAS_TAG", lLocation,FALSE);
}
}
Attetion, ceci implique de ne pas oublier ceci sur le OnUse du placeable :
OnUse
void main(){
object oPC = GetLastUsedBy();
CreateItemOnObject("RES_REF_De_L_Item",oPC,1);}
Si tu le fais pas, tu va avoir un objet posable, mais non ramassable...
Par Elmo le 20/11/2002 Ã 9:51:57 (#2599823)
JOL Archives 1.0.1
@ JOL / JeuxOnLine