Aller au contenu

Photo

Adding items to vendor via script


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

#1
Wallack

Wallack
  • Members
  • 121 messages

Hi.

 

I don't have the toolset close and won't have it until 7 more hours so wanted to ask womething.

 

I use Commche's random loot generator for my module (will be an action oriented module for levels 1-80 that will announce in a couple of weeks, mostly for fun) and is great.

 

The thing is, I was thinking about adding some vendors that would sell items generated randomly. To do that, my idea was to use a hidden chest, generate the items there, and then, make the vendor read the chest to sell those items.

 

Is this possible at all? Do you guys have anyother suggestion?

 

Thanks.



#2
Wallack

Wallack
  • Members
  • 121 messages

Ok, so correct me if I'm wrong. A store has an inventory so I can just get the store (an object) and add items to its inventory is that right ? I think it should be really easy to do so then.



#3
Baaleos

Baaleos
  • Members
  • 1 322 messages

Yup, thats pretty much how its done.

Anything that has an inventory, can receive items via 

CreateItemOnObject();

or

AssignCommand(oStore,ActionTakeItem());

 

Just be careful with loading stores with Items from scripts, you can overload them, which affects performance.


  • dunahan_schwerterkueste_de aime ceci

#4
Wallack

Wallack
  • Members
  • 121 messages

Yup, thats pretty much how its done.

Anything that has an inventory, can receive items via 

CreateItemOnObject();

or

AssignCommand(oStore,ActionTakeItem());

 

Just be careful with loading stores with Items from scripts, you can overload them, which affects performance.

 

Thanks. I just want some vendors to sell some randomly generated items so on every restart they will have new and interesting stuff.