Aller au contenu

Photo

Restricted containers


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

#1
Leurnid

Leurnid
  • Members
  • 271 messages
A Bookcase that can only hold books.

A pedastal that will only hold a single holy symbol.

I think I have seen this before in modules on the vault, but cannot recall where I saw them, and am not able to get into the toolset to play with it right now...

So I guess what I am really curious about is which functions would one use to restrict stored item types and container capacity?

#2
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

Leurnid wrote...

So I guess what I am really curious about is which functions would one use to restrict stored item types and container capacity?



It sounds to me more like you are asking what event do you use.   It would be OnDisturbed

If you are asking how to the the same for an item container, sadly, it can not be done.  Items have no events for when items are added or removed from them.

#3
Leurnid

Leurnid
  • Members
  • 271 messages
Right now I am just musing, until I can open up the toolset and fiddle around with things. I was hoping that perhaps a module builder active on the forums here had already worked these things out and had some advice, so my fiddling started in the right neighborhood.

#4
lordofworms

lordofworms
  • Members
  • 252 messages
if (GetBaseItemType(oItem) != BASE_ITEM_SPELLSCROLL)// use BASE_ITEM_XXXX for your own
{
DelayCommand(0.3, AssignCommand(OBJECT_SELF, ActionGiveItem(oItem, oPC)));
FloatingTextStringOnCreature("You can only store scrolls here.",oPC,FALSE);
return;
}
if (GetBaseItemType(oItem) == BASE_ITEM_SPELLSCROLL)
{
//do your own storing script stuff
}

#5
Leurnid

Leurnid
  • Members
  • 271 messages
So putting 2 and 2 together:
You can't block the item outright, but you can bounce it back out at them =D