Items Scripts
NWN Script: lore_items.htm
| Author: | Adam |
| Author Website: | http://www.mudsolutions.com/~adam/nwn/index.html |
| Script Name: | EQ-Style Lore Items |
| Description: | This script prevents a player from possessing more than 1 of any item with a tag of "LORE_xxxx". The "LORE" part of the tag is not case sensitive and the "xxxx" part is replaced with any name of your choosing. |
| Instructions on Use: | Place the first script into the Module event: OnAcquireItem, place the second script into the Module event: OnUnAcquireItem. In order to make an item lore, simply change the tag of the item by adding "LORE_" at the beginning (this is not case sensitive, so don't worry). |
Script 1 (OnAquireItem):
| void main() { object oItem = GetModuleItemAcquired(); object oPlayer = GetItemPossessor( oItem ); // determine if item acquired is lore string sItemTag = GetTag( oItem ); // if item is lore, check the player to see if they have the item already if( GetStringLowerCase( GetStringLeft( sItemTag, 5 ) ) == "lore_" ) { int bHasItem = GetLocalInt( oPlayer, "bHas_" + sItemTag ); // if they don't have it, set the variable if ( bHasItem == 0 ) { SetLocalInt( oPlayer, "bHas_" + sItemTag, 1 ); // otherwise, get rid of the second item } else { AssignCommand( oPlayer, ActionPutDownItem( oItem ) ); SendMessageToPC( oPlayer, "Lore Item ( " + GetName( oItem ) + " ) duplicated." ); } } } |
Script 2 (OnUnAcquireItem):
| void main() { object oItem = GetModuleItemLost(); object oPlayer = GetModuleItemAcquiredFrom(); // determine if item acquired is lore string sItemTag = GetTag( oItem ); // if item is lore, check the player to see if they have the item already if( GetStringLowerCase( GetStringLeft( sItemTag, 5 ) ) == "lore_" ) { SetLocalInt( oPlayer, "bHas_" + sItemTag, 0 ); } } |
All Items Scripts
📄 aquire_time
📄 bead_of_force
📄 book_of_inf_spells
📄 clear_inventory
📄 clear_inventory_002
📄 clear_inventory_003
📄 clear_inventory_004
📄 cursed_items
📄 cursed_items_002
📄 cursed_potion
📄 give_xp
📄 glow_when_mob
📄 healing_belt
📄 helm
📄 hurled_weapons
📄 item_weight
📄 key_rental
📄 lore_items
📄 npc_owners
📄 random_magic
📄 retrieve_ammo
📄 scimitar_of_dancing
📄 scroll_creation
📄 spawn_item
📄 spawn_item_002
📄 spawn_item_004
📄 stone_of_recall
📄 stone_of_recall_002
📄 summon_creature
📄 teleport_item
📄 torch
📄 weapon_upgrade