Player Resource Consortium

 

Author Topic: Another item property question  (Read 3520 times)

0 Members and 2 Guests are viewing this topic.

November 21, 2012, 09:29:02 PM
  • Jr. Associate
  • **
  • Posts: 52
  • Karma: +0/-0
    • View Profile

SInce I'm enjoying creating some new items I thought I'd ask this question here. Some brand new item properties were added by the PRC, like PNP Holy Avenger and Divinity/Wizardry. How do you do that? I guess I'm looking for a tutorial if someone can point me to one, or just some tips if there isn't one. I understand the basics of scripting and 2da files, what I don't know is what links itempropdef.2da to an actual script that does something? Where is the actual code for something like Wizarddry and what are the rules, parameters etc.

If it helps, my dream is to create on "on hit spell" property that is percentage based, like the on hit properties, so the spell doesnt go off every hit like it does now, which is always overpowered.


November 22, 2012, 02:55:53 PM
Reply #1
  • Hero Member
  • *****
  • Posts: 1439
  • Karma: +27/-0
  • Gender: Male
    • View Profile

Most scripting functions for new item porperties are stored in prc_inc_itmrstr.nss. CheckPRCLimitations() is called from Equip/Unequip events and applies all required effects.

Wouldn't it be easier to add a local int to the item and then test against that int in the spellhook? IIRC local variables set in Toolset are not removed after server reset, so this should be rather safe method.


November 27, 2012, 12:04:51 PM
Reply #2
  • Jr. Associate
  • **
  • Posts: 60
  • Karma: +5/-0
  • New Member
    • View Profile

It seems like the easiest way to do with you are looking for is to use Tag Based Scripting + Unique On Hit item property that already exists to create an item that runs a customer script each time it hits.

In that way, you can write up a script with whatever % you want and whatever effects you want.

If you are unfamiliar with tag based scripting take a look at this tutorial:
http://www.nwnlexicon.com/index.php/Grimlar_-_Introduction_To_Tag_Based_Scripting

If you go that route, you won't need to edit any 2DAs or make any changes directly to the PRC files.