Neverwinter Nights > Script Request
Rawr!
Mercy:
I was curious to know if anyone had a nice item filter they could send my way? Or maybe you could pass GS's on to me Mo? I am working on a 9ac mod atm because I want to play nwn! And you noobs need to play too!
Elessar Telrunya:
This is the filter that 420 wrote for me a few years ago. I think it covers all or most of the item restrictions that GS had. Just include an ExecuteScript(sScript, oTarget); line in the module OnEnter before any module items are created on the target.
--- Code: ---//420 Item Filter
//By: 420 6/25/04
//OnClientEnter should make the PC execute this script.
//This script should be named "420itemfilter"
void main()
{
object oPC = OBJECT_SELF;
object oItem;
int iCounter;
int iACProperty;
itemproperty ipItem;
//Check through all equiped items.
for (iCounter = 0; iCounter <= NUM_INVENTORY_SLOTS; iCounter++)
{
oItem = GetItemInSlot(iCounter, oPC);
//Delete any items with the listed properties, you may add more item properties
//to filter.
if (GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_CAST_SPELL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_REDUCTION) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_RESISTANCE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_HEALERS_KIT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMPROVED_EVASION) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_MONSTER_DAMAGE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ON_MONSTER_HIT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ONHITCASTSPELL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION_VAMPIRIC) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_THIEVES_TOOLS) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_TRAP))
{
DestroyObject(oItem);
DelayCommand(0.001, SendMessageToPC(oPC, "*Item property violation.*"));
}
//Check to see what the value of the item is, if over 500,000 gp value,
//destroy it (this value allows 9 AC/11 AB max per item)
if(GetGoldPieceValue(oItem) >= 500001)
{
DestroyObject(oItem);
DelayCommand(0.001, SendMessageToPC(oPC, "*Item value higher than 500,000 gp.*"));
}
}
//Now do the exact same thing for all the items in the players inventory (whatever
//wasn't equiped
oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem) == TRUE)
{
//Delete any items with the listed properties, you may add more item properties
//to filter.
if (GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_ALIGNMENT_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_DAMAGE_TYPE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_RACIAL_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_AC_BONUS_VS_SPECIFIC_ALIGNMENT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_ALIGNMENT_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_RACIAL_GROUP) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ATTACK_BONUS_VS_SPECIFIC_ALIGNMENT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_CAST_SPELL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_REDUCTION) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_DAMAGE_RESISTANCE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_HEALERS_KIT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_MISCELLANEOUS) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPECIFIC_SPELL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPELL_SCHOOL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMMUNITY_SPELLS_BY_LEVEL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_IMPROVED_EVASION) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_MONSTER_DAMAGE) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ON_MONSTER_HIT) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_ONHITCASTSPELL) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_REGENERATION_VAMPIRIC) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_THIEVES_TOOLS) ||
GetItemHasItemProperty(oItem, ITEM_PROPERTY_TRAP))
{
DestroyObject(oItem);
DelayCommand(0.001, SendMessageToPC(oPC, "*Item property violation.*"));
}
//Check to see what the value of the item is, if over 500,000 gp value,
//destroy it (this value allows 9 AC/11 AB max per item)
if(GetGoldPieceValue(oItem) >= 500001)
{
DestroyObject(oItem);
DelayCommand(0.001, SendMessageToPC(oPC, "*Item value higher than 500,000 gp.*"));
}
oItem = GetNextItemInInventory(oPC);
}
}
--- End code ---
Mercy:
Thanks. I will add it when I get back to my pc. :D
Soul Sojourner:
You could probably do a search and find at least half the scripts you need on this board somewhere or another. :P
Wtf is with the purple text anyway?
Do you think it makes you look cool or something?
Well it does. So cut it out.
Mercy:
:O Thanks Hell! (For telling me I'm cool.)
Also come on, at least this got someone to post right? :D
Navigation
[0] Message Index
[#] Next page
Go to full version