Tired of the same old standard magical weapons? The Random Weapon Generator uses new scripting functions found in version 1.67 of Neverwinter Nights to create random magical items complete with random appearances and descriptive names, similar to games like Baldur's Gate: Dark Alliance or Champions of Norrath. There is almost half a million possible combinations, and that's not including weapon types or appearances!
If you have no scripting experience, three scripts are included that you can use as is. The first creates random weapons in placeables, and the second creates random weapons for an NPC to give to a PC. The third script can be placed on creatures so that they will drop a random magical weapon as loot when killed.
If you have a little more scripting experience, you can call the random weapon generator function itself, and limit weapon types, alignment restrictioms, level requirements, and more. You can even have the function use additional weapon appearances found in the CEP.
Now updated to version 1.2. The creature drops should now work if the monster is killed by a henchmen, familiar, or other associate of the PC. Arrows, bolts, and bullets are now created. The largest change is that there are now two separate variables for level and feat restrictions, instead of just one.
Posted by Inayity at 2008-09-29 15:55:07 Voted 10.00 on 09/29/08
I can't believe I didn't wind up voting on this when I'd downloaded it earlier. If you're working on a PW with item drops of this nature you could do far worse than really taking a good look at how this script is done and the thinking behind it. There are other Diablo-esque (for lack of a better term) human-readable loot droppers on the vault (and some with many more votes) but if you look at this one it reaches and attains something a little past the rest.
I would love to see any updates you have to this system and also the Armor generator. Simply fabulous, well-thought-out work. Thank you!
Posted by tagnus at 2008-06-29 15:04:26 Voted 10.00 on 06/29/08
Can't wait to see that armor generator!! Very slick Merle! Bu
Posted by Vampiric at 2008-04-12 05:44:56 Voted 10.00 on 04/12/08
awesomeness! This is just what I was looking for!! :D _________________________ VämÞï®ìç
I haven't had a lot of time to work with NWN in the last month or so, but I have gotten some questions about the armor generator. It's partially complete at this point (about 75% or so). I'm planning on cleaning it and releasing a sort of incomplete beta version to let everyone take a look at it until I get the time to seriously get back to work on it. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
Posted by RoadWyrm at 2006-07-23 13:14:13 Voted 8.75 on 07/23/06
If you consider useing a hak for the 2DA Id strongly suggest making a new download in the HAKs section.
Useing the base_2da thats already there seems to be the way to go, maybe no need for a hak to use it?
Great job...still waiting on armor and other items :D
Anon, if that's the case, I will definitely be looking at 2das. Hopefully nobody will mind a small hakpak containing 2das for data management. (If anyone does think that will be a bad idea, then let me know.) I'll probably be saving that for the version after next. I'm still working on implementing random armor generation, which is the main focus of the next version. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
Posted by Anonymous ( 24.161.xxx.xxx ) at 2006-05-18 16:34:32
Meryle, in new versions of NWN, the 2das's gets tored into memory the first time theya re acecssed. Hence it doesn't read them from the file each time but recalls the values from memory. Its similar to how variables are stored. Because of this, theres not a performance hit like there once was in the past.
lylver, I've thought about using 2das. It would make some things a lot easier. A lot of lookup functions I use can be replaced by using Get2DAString. However, my understanding is that Get2DAString can be very slow, and that using it inside of a loop is a bad idea. There's a lot of looping when a random weapon is generated, unfortunately. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
You can clarify your script by the use & preload (local var in memory) of a 2da file.
This will give more flexibility for future modifications.
Good job _________________________ TN Bouchon 2 (PW-RP), un des "bouchons lyonnais"
Fleshmelter, I'll change that in the next version. Make it so that there is a chance for items to drop, based on the creature's Challenge Rating. The higher the rating, the greater the chance of a randomly created weapon being dropped. I'll also let it check a variable on the creature if the designer wants to set the percentage chance of an item being dropped. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
Posted by Fleshmelter at 2006-05-14 20:50:37 Voted 9.50 on 05/04/06
hey Merle works kinda nice, but having a item drop everytime you kill a critter would make it monty haul-ish.
Perhaps a random chance to drop an item on creatures, and also maybe random spawn chance of more than one item being created for the overall system.
But as it stand it's still great. _________________________ PW Action Server:
| Chaosgate |
Fleshmelter, I believe I fixed the problem with the creature drops. I tested it with a familiar and a summoned creature, and it should work now. The items are now restricted to the creature's hit dice/level plus a small random number.
For other 1.2 changes, I separated the nUseCheck variable into two variables: nFeatCheck and nLevelCheck. There is also a new option for nLevelCheck that checks the range between the bottom and top levels as they are, without considering the PC's levels.
Finally, arrows, bolts, and bullets are now in.
I'm working on random magical armor now, and it looks like eventually this will become a random magical ITEM (not just weapon) generator at the rate I'm going. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
Posted by Fleshmelter at 2006-05-09 15:29:27 Voted 9.50 on 05/04/06
Well the skinny on Creature Drops:
Got a TMI error when my summoned dire wolf killed a kobold, which resulted in the 'dummy chest' not getting destroyed. Also no treasure generated when my summon killed a critter. You think maybe if the creatures generated the weapon onspawn as oppose to ondeath will help....of course this will probaly make your feats option useless for creature drops, but still can be used on placeable treasure.
Also i leveled up a character to level 15 and killed the kobolds, which is to be expected....but just i don't think kobolds should drop weapons on par with my level. Perhaps a CR table is needed to regulate the creature drops.
Fleshmelter, if you find a bug, don't hesitate to let me know. I like getting feedback and comments. It helps me improve things. I should have another update later this week, and I'll see if I can't throw in some simple treasure like rings, boots, and the like. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
Posted by Fleshmelter at 2006-05-08 14:23:26 Voted 9.50 on 05/04/06
Awesome job, i meant to comment on the items being identified before, but hate abusing my posting rights. Actually if you get random armour done when ammo gets done, i'll more than likely change over from the other random items script i use. I really like that yours uses on-hit props for weapons, which i find that the one i use now does not.
Also if you hadn't thought of it...(lol i gots lots to say) Bracers,Boots,Belts,Amulets,Rings and all that jazz can probaly be added rather quickly "of course i say this, cuz i'm not the one scripting it."
All in all this seems to be shaping up into a great treasure system now. _________________________ PW Action Server:
| Chaosgate |
I just uploaded version 1.1. I didn't get as much time to work on everything as I would have liked, so it's a fairly small update. It includes a script to place on the OnDeath of creatures & NPCs so that they will drop a random magical weapon (thanks for the idea, Fleshmelter). I also added Ransom's idea, so that by setting nUseCheck to 5, the random weapon generator will look at the levels for the PC, but not their feats. Finally, one small bug fix. The sample module automatically identifies the weapons... the scripts in the ERF will not anymore. I meant to take that out last time and forgot. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
Posted by Ransom at 2006-05-06 07:54:16 Voted 10.00 on 05/05/06
As I said in my vote, this is excellent.
After playing with it a little, it would be really nice to see an option that doesn't care if the PC can use the weapon, but DOES check the PC's level. For truly random, but level-appropriate treasure generation.
Posted by Ransom at 2006-05-05 11:07:52 Voted 10.00 on 05/05/06
This is quite excellent. I'm thinking of using this to add a random weapon merchant to my module in progress.
Rami, thanks for your comment, if you figure out how to use it in your PW let me know.
Fleshmelter, I hope to get random ammo in the script as well, and eventually have random armor as well. And I never even considered creature drops for some reason... it's easy enough to do, and so for the next version I'll make that available. _________________________ Recent scripts I wrote for NWN: Random Weapon Generator & Wordlock / Riddle Creator
Posted by Fleshmelter at 2006-05-04 15:03:28 Voted 9.50 on 05/04/06
The good: very slick NPC usage
The not so good: only weapons are randomized, and no creature drops. I'm sure both can be remedied. _________________________ PW Action Server:
| Chaosgate |
Posted by Fleshmelter at 2006-05-04 14:49:33 Voted 9.50 on 05/04/06
Posted by Rami_Ahmed at 2006-05-04 10:23:27 Voted 9.75 on 05/04/06
Wow this is really cool, although I cant use it in my own PW (or maybe I can, just cant figure it out right now, heh) this is certainly well done, I haven't looked at the code yet but it sounds very nice. _________________________ NWN2 stuff:
- Persistent Player Owned Shop System
Posted by Rami_Ahmed at 2006-05-04 10:22:58 Voted 9.75 on 05/04/06
Wow this is really cool, although I cant use it in my own PW (or maybe I can, just cant figure it out right now, heh) this is certainly well done, I haven't looked at the code yet but it sounds very nice. _________________________ NWN2 stuff:
- Persistent Player Owned Shop System