Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  PRC compatible ILR
Author  Silvercloud & Ornedan
Submitted / Updated  01-05-2005 / 11-22-2006
Category  Rulesets
Expansions  NWN-1.65
View Code  

Select All Text | View Code in separate window
Format  Code Only
Type  Type - Other
Includes  BioWare Standard
Description
This script uses valuebased ILR checking (which takes into account prc items), that can be overridden by usage of the 'ilr_custom_override' variable (integer) on an item. Additionally it allows for you to set a deity variable called 'ilr_deity' (string) so that only if the player has that Deity name in his deity field will he be able to equip the item. And lastly you can forbid by type of item versus deity as well (which you will need to script by hand) and i have included an example of forbidding short swords to akadi worshippers Note: you do NOT need to set the module to item level restrictions on, you just have to put this script in the onequip script event under module properties. Note: Version 0.6 available here now, please use this version over any older ones!

Files

NameTypeSizeDownloads
prc_ilr0_7.rarprc_ilr0_7.rar
Submitted: 01-05-2005 / Last Updated: 05-20-2005
rar4.14Kb309
--
SCORE OUT OF 10
9.75
1 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS
No Images




You Must Be Logged In to Participate.
Comments (37):

  1  2 Next>

Posted by dsabrae at 2008-04-01 17:13:52    
solution available please feel free to email me for it here

Posted by dsabrae at 2008-03-08 07:57:33    
after implementing this players on my world found a easily reproduced exploit in about 24 hours id like to report but not in the open so as to destroy where this may be working well in the community. Is this forum actively monitored and I cna do it here or would someone like a stab at fixing it by IM or email?

Posted by DM Mask at 2006-02-19 15:27:30    Voted 9.75 on 02/19/06
Well done, the one improvement I can think of(That hasn't been mentioned) would be to turn of Deity auto-equip, instead having it lower the ILR of the weapons your deity follows. I.E. you follow Mask, instead of equipping any longsword, The check is fudged, so that using deity weapon reduces the items ILR by 5(Mod Level Variable). so a lvl 4 rogue of mask, could in that instance use a lvl 9 Longsword or below, as opposed to ANY longsword(Without other restrictions.)
_________________________
Itinerant Admin: RPGModding.com - Where Modders Muster.

CTP: [Release 1] [Release 2] [Generic Doors]
NWN1: [Core Tools] [Migrating Traps] [HiPS Restriction] [Tag Based Treats/Terrors]

If you need to, Contact Me
Its more effective than leaving a post on a vault entry you will probably never return to look at a second time

Posted by silvercloud at 2005-08-18 07:21:58    
Not compatible with 2.3 yet, I will add 2.3 compatibility in the future once 2.3 leaves BETA mode and goes full release (its still in ALPHA). Those levels you are referring to are a 2.3 feature.

Posted by Macros ( 66.69.xxx.xxx ) at 2005-08-12 19:02:05    
Can you add a switch to implement PRC ECL levels? ECL levels are basicly 'racial' class levels, and thus should count towards total class level for ILR restrictions

Posted by Macros ( 66.69.xxx.xxx ) at 2005-08-12 19:02:05    
Can you add a switch to implement PRC ECL levels? ECL levels are basicly 'racial' class levels, and thus should count towards total class level for ILR restrictions

Posted by silvercloud at 2005-05-20 13:33:59    
0.7 now up, new: fix for plot items

Posted by skivvylizard at 2005-05-11 09:30:01    
Sorry for those reposts, I don't know what the heck was going on????

around line 254, just change the goldpiece value lines to the following...

else
{
if (GetPlotFlag(oItem) == TRUE)
{
SetPlotFlag(oItem, FALSE);
iGPValue = GetGoldPieceValue(oItem);
SetPlotFlag(oItem, TRUE);
}
else
{
iGPValue = GetGoldPieceValue(oItem);
}

Posted by skivvylizard at 2005-05-09 19:41:24    
I got it. I was testing with plot flagged items. Even though the ILR works on biowares system with plot, the GP value returns 0. Pretty lame. All I did was add a seperate plot check, set the the plot false, check gold, set plot true, then continue, and all works well. Cheers.

Posted by skivvylizard at 2005-05-09 15:05:52    
I got it. I was testing with plot flagged items. Even though the ILR works on biowares system with plot, the GP value returns 0. Pretty lame. All I did was add a seperate plot check, set the the plot false, check gold, set plot true, then continue, and all works well. Cheers.

Posted by skivvylizard at 2005-05-09 13:43:14    
I got it. I was testing with plot flagged items. Even though the ILR works on biowares system with plot, the GP value returns 0. Pretty lame. All I did was add a seperate plot check, set the the plot false, check gold, set plot true, then continue, and all works well. Cheers.

Posted by silvercloud at 2005-05-09 10:14:37    
Hi Skylizzard, mayhaps this is something to share with the community? I'd be interested to see the code and maybe put it in an update.

Posted by skivvylizard at 2005-05-09 09:31:39    
I got it. I was testing with plot flagged items. Even though the ILR works on biowares system with plot, the GP value returns 0. Pretty lame. All I did was add a seperate plot check, set the the plot false, check gold, set plot true, then continue, and all works well. Cheers.

Posted by skivvylizard at 2005-05-09 09:04:02    
Doh, I meant equip, not unequip..Coffee has not set in yet..:)

Posted by skivvylizard at 2005-05-09 08:07:18    
Doh, I meant equip, not unequip..Coffee has not set in yet..:)

Posted by skivvylizard at 2005-05-09 08:06:26    
I am trying to use this system, looks like something I was tyring to do myself by hand. The problem is with a standard item that has an ILR of 21, the script is returning 0's for everything, therefore allowing an unequip. I verified this by putting in debug statements in the case 0 checks. Do I have to change anything in the default script for the item based unequip? It doesn't look like it from what I can see, but other surely know more that I do...:)

Posted by schwag ( 68.209.xxx.xxx ) at 2005-04-19 19:11:00    
@Hey man ;)


Yea I know its in there twice. For some reason I couldn't get it to work unless ? Might have been what I had changed b4 I got down there ? Not sure man, But I'm digging on your work. Thanks again!

Posted by schwag ( 68.209.xxx.xxx ) at 2005-04-19 19:10:00    
@Hey man ;)


Yea I know its in there twice. For some reason I couldn't get it to work unless ? Might have been what I had changed b4 I got down there ? Not sure man, But I'm digging on your work. Thanks again!

Posted by silvercloud at 2005-04-14 07:13:00    
0.6 now up, fixes:
- Projectile problem
- Gold value based on 2da (small change to values)

Posted by silvercloud at 2005-04-14 05:42:00    
@SCHWAGMASTER: you edited the unequip to fire twice, the nAllow automatically fires the forceunequip if the result is -1.

so in your last bit of code which is this:
* if (iItemLevel > iClassLevel)
* {
* Result.nAllow = -1;
* Result.sMessage = "You are not high enough level to * equip " + GetName(oItem) + ", you must be at least
* level: " + IntToString(iItemLevel) + ".";
* SetCommandable(FALSE, oPC);
* DelayCommand(0.3, SetCommandable(TRUE, oPC));
*
* DelayCommand(0.7, AssignCommand(oPC,
* ClearAllActions(TRUE)));
* DelayCommand(1.0,AssignCommand(oPC,
* ActionUnequipItem(oItem)));
* }

you first call the forceunquip (by nAllow -1) and then unequip again. It would be more efficient to just unequip multiple times in the forceunequip if you wanted to do that.
Besides the whole commandable/clearallactions/etc. really doesnt help to prevent cheating.

Posted by Reydragon ( 200.120.xxx.xxx ) at 2005-03-10 20:55:00    
Hello, this script work in the world of lodor case of where ilr must be turn off?.


Greetings.

Posted by Shadow_Avenger ( 81.152.xxx.xxx ) at 2005-03-03 00:55:00    
Nice, using a modified earlier version.
The delay command on the unequip was missing before, but i sorted that.
One note, it is still exploitable.
There is no way round this that I have found atm.
I would not expect many to findout how it is done, but some will.
I don't want to post the exploit for obvious reasons.
I would suggest you add script to onclient enter the runs the ilr based on client enter aswell, Then if a play has exploited, when they relogg, items are auto unequiped.

Posted by Anonymous ( 68.209.xxx.xxx ) at 2005-02-28 17:57:00    
//EDITED TO CORRECT OVER RUNNING SCRIPT ON AMUNITION
//Also edited to make it work right
// BY:SCHWAGMASTER 02-23-05

const string ILR_VARIABLE_NAME = "ilr_custom_override";
const string ITEM_DEITY_NAME = "ilr_deity";
// A structure for passing data around the functions here.
struct itemRestriction{
// This determines whether the wielder is allowed to wield the item
// Values to use:
// -1 Item use forbidden by this test, stop further testing.
// 0 Item use allowed by this test, pass to next test.
// 1 Item use allowed by this test, stop further testing.
int nAllow;
// Message to send to the equipping PC. This is ignored if nAllow is 0.
string sMessage;
};


void actionForceUnequipItem(object oItem, object oPC, string sMessage);
int GetIsInstanceOfPRCItem(string sResRef);
struct itemRestriction GetDeityRestriction(string sDeity, object oItem, object oPC);
struct itemRestriction GetItemLevelRestriction(object oItem, object oPC);
void main()
{
object oPC = GetPCItemLastEquippedBy();
object oItem = GetPCItemLastEquipped();
int iTyp = GetBaseItemType(oItem);
// Handle special PRC class items
string sResRef = GetResRef(oItem);
if(GetIsInstanceOfPRCItem(sResRef)) return;
if(iTyp == BASE_ITEM_ARROW)return;
if(iTyp == BASE_ITEM_BOLT)return;
if(iTyp == BASE_ITEM_BULLET)return;
if(iTyp == BASE_ITEM_DART)return;
if(iTyp == BASE_ITEM_SHURIKEN)return;
if(iTyp == BASE_ITEM_THROWINGAXE)return;


// DMs get to equip whatever they like
if(!GetIsDM(oPC) && GetIsPC(oPC))
{
struct itemRestriction Result;

// Example restriction block
/*
dataType Foo = GetData(oPC);
Result = GetSomeRestriction(foo, oItem, oPC);

switch(Result.nAllow){
case -1: actionForceUnequipItem(oItem, oPC, Result.sMessage);
case 0: break;

case 1: if(Result.sMessage != "") SendMessageToPC(oPC, Result.sMessage);
return;
}
*/


// Handle deity restriction
string sDeity = GetDeity(oPC);
Result = GetDeityRestriction(sDeity, oItem, oPC);

switch(Result.nAllow){
case -1: actionForceUnequipItem(oItem, oPC, (Result.sMessage != "" ? Result.sMessage : sDeity + " does not allow you to wield " + GetName(oItem)));
case 0: break;

case 1: if(Result.sMessage != "") SendMessageToPC(oPC, Result.sMessage);
return;
}


// Handle restriction by item level
Result = GetItemLevelRestriction(oItem, oPC);
switch(Result.nAllow){
case -1: actionForceUnequipItem(oItem, oPC, Result.sMessage);
case 0: break;

case 1: if(Result.sMessage != "") SendMessageToPC(oPC, Result.sMessage);
return;
}
}
}

void actionForceUnequipItem(object oItem, object oPC, string sMessage = "")
{
if(sMessage != "") SendMessageToPC(oPC, sMessage);

SetCommandable(FALSE, oPC);
DelayCommand(0.3, SetCommandable(TRUE, oPC));

AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionUnequipItem(oItem));
}

int GetIsInstanceOfPRCItem(string sResRef)
{
if(sResRef == "base_prc_skin") return TRUE;
if(sResRef == "pnp_shft_tstpkup") return TRUE;
if(sResRef == "listenerhide") return TRUE;
if(sResRef == "shifterhide") return TRUE;
if(sResRef == "lichamulet") return TRUE;
if(sResRef == "soul_gem") return TRUE;
if(sResRef == "platinumarmor4") return TRUE;
if(sResRef == "platinumarmor6") return TRUE;
if(sResRef == "platinumarmor8") return TRUE;
if(sResRef == "wp_arr_imbue_1") return TRUE;
if(sResRef == "runescarreddagge") return TRUE;
if(sResRef == "codi_mw_katana") return TRUE;
if(sResRef == "codi_mw_short") return TRUE;

return FALSE;
}

struct itemRestriction GetDeityRestriction(string sDeity, object oItem, object oPC)
{
struct itemRestriction Result;
Result.nAllow = 0;
Result.sMessage = "";

sDeity = GetStringLowerCase(sDeity);
string sItemDeity = GetStringLowerCase(GetLocalString(oItem, ITEM_DEITY_NAME));
if(sItemDeity != "")
{
if(sItemDeity != sDeity)
{
Result.nAllow = -1;
Result.sMessage = "This item is restricted to followers of " + sItemDeity + ".";
}
}

return Result;
}


struct itemRestriction GetItemLevelRestriction(object oItem, object oPC)
{
struct itemRestriction Result;
Result.nAllow = 0;
Result.sMessage = "";

int iItemLevel = 1;
int iClassLevel = GetLevelByPosition(1,oPC) + GetLevelByPosition(2, oPC) + GetLevelByPosition(3, oPC);

if(GetLocalInt(oItem, ILR_VARIABLE_NAME))
{
iItemLevel = GetLocalInt(oItem, ILR_VARIABLE_NAME);
}
else
{
int iGPValue = GetGoldPieceValue(oItem);

if (iGPValue > 4000000) iItemLevel = 40;
else if (iGPValue > 3800000) iItemLevel = 39;
else if (iGPValue > 3600000) iItemLevel = 38;
else if (iGPValue > 3400000) iItemLevel = 37;
else if (iGPValue > 3200000) iItemLevel = 36;
else if (iGPValue > 3000000) iItemLevel = 35;
else if (iGPValue > 2800000) iItemLevel = 34;
else if (iGPValue > 2600000) iItemLevel = 33;
else if (iGPValue > 2400000) iItemLevel = 32;
else if (iGPValue > 2200000) iItemLevel = 31;
else if (iGPValue > 2000000) iItemLevel = 30;
else if (iGPValue > 1800000) iItemLevel = 29;
else if (iGPValue > 1600000) iItemLevel = 28;
else if (iGPValue > 1400000) iItemLevel = 27;
else if (iGPValue > 1200000) iItemLevel = 26;
else if (iGPValue > 1000000) iItemLevel = 25;
else if (iGPValue > 750000) iItemLevel = 24;
else if (iGPValue > 500000) iItemLevel = 23;
else if (iGPValue > 250000) iItemLevel = 22;
else if (iGPValue > 130000) iItemLevel = 21;
else if (iGPValue > 109999) iItemLevel = 20;
else if (iGPValue > 89999) iItemLevel = 19;
else if (iGPValue > 74999) iItemLevel = 18;
else if (iGPValue > 64999) iItemLevel = 17;
else if (iGPValue > 49999) iItemLevel = 16;
else if (iGPValue > 39999) iItemLevel = 15;
else if (iGPValue > 34999) iItemLevel = 14;
else if (iGPValue > 29999) iItemLevel = 13;
else if (iGPValue > 24999) iItemLevel = 12;
else if (iGPValue > 18499) iItemLevel = 11;
else if (iGPValue > 14999) iItemLevel = 10;
else if (iGPValue > 11999) iItemLevel = 9;
else if (iGPValue > 8999) iItemLevel = 8;
else if (iGPValue > 6499) iItemLevel = 7;
else if (iGPValue > 4999) iItemLevel = 6;
else if (iGPValue > 3499) iItemLevel = 5;
else if (iGPValue > 2499) iItemLevel = 4;
else if (iGPValue > 1499) iItemLevel = 3;
else if (iGPValue > 999) iItemLevel = 2;
}

if (iItemLevel > iClassLevel)
{
Result.nAllow = -1;
Result.sMessage = "You are not high enough level to equip " + GetName(oItem) + ", you must be at least level: " + IntToString(iItemLevel) + ".";
SetCommandable(FALSE, oPC);
DelayCommand(0.3, SetCommandable(TRUE, oPC));

DelayCommand(0.7, AssignCommand(oPC, ClearAllActions(TRUE)));
DelayCommand(1.0,AssignCommand(oPC, ActionUnequipItem(oItem)));
}

return Result;
}

Posted by Anonymous ( 68.209.xxx.xxx ) at 2005-02-28 17:52:00    
hi ,

I've been using your script.

You may want to put

if(basitemarrow)return; or something
and just let bolts arrows and bullets go past the irl..

If not, your script gets called many times when the archers or slingers start running out of ammunition, and , when bio execute starts look thru inventory to equip them.

A lot of people will go thru and stack their arrows in stacks of 10 or so, heh amazing the holes people find. So they can bypass the irl. So I figured, they have to have passed ilr to use their weapon such as bow, xbow, sling etc. Just let the ammo go thru until a better fix is around.

Posted by silvercloud at 2005-02-26 16:48:00    
You're right, you can send me the updated script if you want to contribute. I'm willing to put the bioware values back into the script and make an update.

Posted by Rusty_Dunestalker at 2005-02-21 14:16:00    
I used the script, and one of my players noticed something odd. One piece of armour (which I had labelled as a level 10 item) was telling him he had to be level 11 to wear it. I checked the code, and the value was wrong. In fact, all of the values before level 21 are wrong. The value for level 11 should be 19500, not 18499. Here's what I posted to him on my forums in response to his irritation:

I didn't type in the number wrong. Apparently the script I got to replace Bioware's ILR has an error in it. I will check it out, and see what's going on.

I went through all of the values up to 21st level items, and I figured out what the script did wrong. There are two things, really. 1- Bioware's system works off odd values to start a new level for ILR. So, to be a 2nd level item, it needs to have a value of 1001 gp. The script looks for a value of > 999, which would include 1000, which is wrong. That, however, was not the problem for the +3 studded leather with bull strength. What happened there was they simply put in a very wrong value. I figure they just simply made a typo, or got sloppy in checking ILR levels.
The STRANGEST part of the script is that they got the first 20 levels wrong, and then did it right for levels 21+. Not that I've checked the values, but that they set it so 21st level is > 130000, instead of 129999. It's like 2 completely different people wrote the script, and didn't bother to check each other's values... or someone realized their mistake half way through, and was too lazy to go back and fix it (it only took me a minute or two to go through and retype the values... so they're even lazier programmers than I am, and that's saying something...) ;)

Posted by silvercloud at 2005-02-10 11:25:00    
0.5 now added here, it prevents cheating, in the fact that it wont allow the bug by evergrey to work, but you can still equip an item visually, even though its abilities and properties do not affect the creature.

Posted by Evergrey ( 213.36.xxx.xxx ) at 2005-02-10 10:02:00    
Nice script here, but you have the same problem that the one i sue for my module, players can cheat with this script...

I'll mail you the problem, maybe you will be able to find an issue.

Posted by silvercloud at 2005-01-31 16:04:00    
0.4 sorry about the bug in 0.3 that didnt allow it to unequip

Posted by silvercloud at 2005-01-23 03:14:00    
I updated both files, just make sure it says 0.3 beta on the top

  1  2 Next>

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Tools


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters