I have totally re-written the socket item system and the way it works.
You now target the socket items with the gem's unique power (Just as it should be) instead of vice versa.
You can use the item's unique power to check how many socket slots are left on the item.
Becase so much of the code has been optimized and modified, it is no longer compatible with the old socket items and gems, however this one is far superior and has alot more options so it's in your best interest ti change over.
You can use both this and the old version together, but I would recommend just using this one.
For those of you who don't know what socketed items are I will explain... A socketed item is a normal item like a sword for example; except it has sockets in it that special gems can be placed into for adding bonuses to it (i.e. Keen, Enhancement Bonus etc...).
Items that can be socketed:
Armour
Melee Weapons
Cloaks
Bracers
Gloves
Helmets
Boots
Shields
Rings
Amulets
Staffs
Bows and Crossbows
Gems you can make for socketing
Attack Bonus
Damage Bonuses
Enhancement Bonuses
Keen
Bonus Spell Slots
Mighty
Extra Ranged Damage
Unlimitted Ammo
AC Bonus
Bonus Feats
Cast Spell
On-Hit Cast Spell
Damage Resistance
Haste
Freedom
Improved Evasion
Spell Resistance
Saving Throws
Skill Points
Regeneration
Ability Bonuses
Holy Avenger
True seeing
Massive Criticals
Vampiric Regeneration
More to come soon :)
Damage types for Damage Bonuses and Damage Resistances are: Acid, Bludgeioning, cold, Divine, Electrical, Fire, Magical, Negative, Piercing, Positive, Slashing, Sonic. Other customizable options:
Allow gems of the same bonus type to be stacked (i.e. +2 regen & +2 regen = +4 regen)
If you set the stackable gems switch then there is another switch that allows you to decide if you want gems of the same type to take up a seperate socket or if you want them to occupy the same socket as a gem already socketed with the same bonus type.
Set the maximum amount of each bonus allowed on an item... for example you could set it to only allow a maximum of +8 Attack Bonus, or a maximum of +12 AC Bonus etc...
You just create your socketed items and gems, add some simple local variables onto them via toolset; customize the constants in the include script and you are ready to go.
WARNING!!
Variables on items are automatically deleted when sold from standard merchants that have their inventory items set to "Infinite" (blame Bioware for that). If items are NOT set to "Infinite"; then they will retain their variables and the system will work; please bare that in mind when using this system.
There me be other possible compatibility problems with some scripts that use CopyItem(). If you use any scripts that involve socket items and the CopyItem() function, be sure to make sure the last paramter bCopyVars = TRUE otherwise vars are lost and socket items and gems will break. Some armour dying kits and crafting can cause this issue, but it is an easy fix by doing as suggested above.
Compiled Previous Updates:
Fixed incorrect variables on pre-made damage bonus gems.
Fixed function that allows limiting of damage bonus & massive criticals.
Added a new function to display maximum dice roll damage allowed on a weapon.
Added function to allow skill points gems.
Added functions to allow cast spells to be added to items.
Added functions to allow On-Hit cast spells to be added to items.
Update 7th August 07:
Added functions to socket ranged weapons.
Added functions for mighty.
Added functions for Extra Ranged Damage.
Added functions for Unlimited Ammo.
Added functions for Bonus Spell Slots.
Fixed broken variable on Acid damage pre-made gem.
Created a heap more socketed items, gems and weapons.
Added a new function for checks to be made that will now allow the user to use other types of items as gems instead of just "Misc Small".
Fixed variables small bugs.
Update 18th September 07:
Fixed a bug where damage resistance was stacking over the maximum specified in the config script.
Myths And Lies All Answered Here:
Please do not believe the utter nonsense being spread by a certain troll on Bioware forums, this system has NO dupe bugs, and does NOT lag servers, a well known expert in scripting Looked at the code, and couldn't find ANYTHING that would allow duping (Check link in my comments), you can also have this proven if you want to log onto my fairly popular PW server and try it out for yourself. As for efficiency, here is my proof:
NWNX and the Profiler plugin was left running on my PW for 2 hours with 15 players (early morning).
Average Results:
sf_sockets - 4 msec - 56 calls
This is calls per profiler update, this is extremely fast, lets compare it to an unmodified default Bioware spell:
NW_S0_AcidArrow - 31 msec - 28 calls
Now let's face it, Acid arrow isn't exactly a laggy spell is it, it has low visual effects and the code is very small in size yet it's read time is 15 times slower than my socket scripts.
What does this mean? It means trolls can't be trusted :)
The reason I posted this in the description is to clear up any misinformation being spread by trolls who know very little about scripting.
Please post REAL bugs found; on our forums. the forum link is in the forum link box above, thanks.
I'll look into all of the bugs as soon as I get the time, sorry I've been so busy lately. _________________________ §çà®Fãçë? NWN1 Submissions: [Persistent Banking] - [Character Appearance Modifier] [XP/GP Distribution] - [Item Crafting] - [Socketed Items] NWN2 Submissions: [Persistent Banking]
Posted by WhiteKnightX2000 at 2008-09-1915:37:31
Example: GreatAxe Takes: +6 Dex, +6 Char, +20 Hide, +20 Concentration, + 2d6 Bludge and +2d6 Piercing. BastardSword Takes: +20 concentration, +20 Discipline, +20 Hide and +20 Move Silently. but shortsword will only take damage type gems, any other gem we recieve a (this type of gem cannot be socketed into this type of weapon) Considering that the two weapons above fall into the Melee Weapon catagory , which ShortSword does too, but shortsword does not take any of the gems that the weapons above do. It only started to work when I omitted your security settings to make sure certain types of gems don't work on certain types of weapons.
Posted by +scarface+ at 2008-09-1808:33:36
Are you saying for example, a Greataxe will allow haste? _________________________ §çà®Fãçë? NWN1 Submissions: [Persistent Banking] - [Character Appearance Modifier] [XP/GP Distribution] - [Item Crafting] - [Socketed Items] NWN2 Submissions: [Persistent Banking]
Posted by WhiteKnightX2000 at 2008-09-0815:58:27
Sorry, maybe I didn't word it correctly, Short swords are the ONLY Weapon type that doesn't take anything besides attack/damage bonus gems, while all the other types of weapons do, including gloves.
Posted by +scarface+ at 2008-09-0811:31:26
That's the way it was designed to work, offensive buffs on weapons, and defensive buffs on armour type items. _________________________ §çà®Fãçë? NWN1 Submissions: [Persistent Banking] - [Character Appearance Modifier] [XP/GP Distribution] - [Item Crafting] - [Socketed Items] NWN2 Submissions: [Persistent Banking]
Posted by WhiteKnightX2000 at 2008-09-0801:48:42
Hey, love the script, a problem I found is that the short swords do not take skill type gems example: Concentration, Discipline.. stuff like that.. looked over the script seems to be fine. Just thought you'd like to know.
Posted by +scarface+ at 2008-08-3111:00:27
Sure it is, easy, open up the script named sf_sockets, and insert this piece of code finto line 20, like so: void main() { if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) { return; } object oPC = GetItemActivator(); // if no wizard class if ( !GetLevelByClass ( CLASS_TYPE_WIZARD, oPC ) ) { // display a message, and exit the script FloatingTextStringOnCreature ( "Thi sitem is only usable by Wizards!", oPC ); return; } object oTarget = GetItemActivatedTarget(); object oActivated = GetItemActivated(); _________________________ §çà®Fãçë? NWN1 Submissions: [Persistent Banking] - [Character Appearance Modifier] [XP/GP Distribution] - [Item Crafting] - [Socketed Items] NWN2 Submissions: [Persistent Banking]
Posted by Samji83 at 2008-05-2515:18:39
Any suggestion on how to make gems only usable by wizards?
Posted by +scarface+ at 2008-03-2912:22:41
oniyen, this is a known issue and will be fixed in the next update, although I can't say when that will be. DarK WulF, include files do not compile directly, they are compiled when a script that includes it is compiled, use the toolset feature "Build Module" and make sure "Compile Scripts" is checked. _________________________ §çà®Fãçë? NWN1 Submissions: [Persistent Banking] - [Character Appearance Modifier] [XP/GP Distribution] - [Item Crafting] - [Socketed Items] NWN2 Submissions: [Persistent Banking]
Posted by DarK at 2008-03-2704:46:03
HEY DUDE GREAT SYSTEM! do they use your system on the pw shadow mountain? anyways the thing is i cant tweak the settings in your settings script cuz it wont save and compile afterward it says your missing the void main thing and then asks if you want to save it as a conditional script instead but when you do that it fails to compile do to no starting thing so whats wrong there?