Aller au contenu

Photo

Script to make non palette item?


  • Veuillez vous connecter pour répondre
6 réponses à ce sujet

#1
Buddywarrior

Buddywarrior
  • Members
  • 256 messages

Is it possible to make a script that would create a Longsword +2 with a name of "Longsword" but not pull it from a precreated item in the item palette? Any direction would be helpful. 

Thanks!

 

 



#2
henesua

henesua
  • Members
  • 3 882 messages

Just create one of bioware's +2 longswords from the palette and then rename it with SetName()



#3
Buddywarrior

Buddywarrior
  • Members
  • 256 messages

If I know how to add stats to a generic item and rename it, I could make randomish loot on certain creatures. Maybe conceptually the below code will better help show what I'm trying to accomplish. 

 

    object oItem = CreateItemOnObject("longsword", OBJECT_SELF);
 
    effect Effect1;
    Effect1 = EffectAttackIncrease(2);
    ApplyEffectToObject(DURATION_TYPE_PERMANENT, Effect1, oItem);
    SetName (oItem, "Some Longsword");
 


#4
henesua

henesua
  • Members
  • 3 882 messages

you can add item properties as well, but you'd probably want to work from a very basic item such as the default bioware longsword, and then add item properties to that.
 
I use this function for that quite often:
IPSafeAddItemProperty(object, itemproperty, float, int, int, int)

 

So read that page, and learn how adding an item property works with that function. Also note that you are probably adding item properties rather than effects. I've never tried doing this with effects, and don't believe it would work. In my experience its item properties that you want to apply to the item

 

In essence you will

  • select a resref for a base item
  • create an item with that resref
  • define an itemproperty
  • add that item property to your item

Resources


  • MrZork, Buddywarrior et Rolo Kipp aiment ceci

#5
Buddywarrior

Buddywarrior
  • Members
  • 256 messages

I'm very grateful Henesua, thank you for the link, looks like that is the direction I needed!



#6
henesua

henesua
  • Members
  • 3 882 messages

i edited my post with some more. take a look. and good luck.

 

i appologize for my style of help since i prefer not to give you the solution but rather show you how to approach teh problem. my hope is that more of us will become experts by learning on our own with forum guidance rather than simply asking for scripts and not knowing how they work.


  • Rolo Kipp aime ceci

#7
Vincent07

Vincent07
  • Members
  • 47 messages

I have a bit of code that will generate random weapons on creatures as they spawn.  It allows for some bit of customization as well.