Author Topic: Custom Poison  (Read 445 times)

Legacy_4Pop

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Custom Poison
« on: August 31, 2015, 03:57:49 am »


               

Hello. I've created a custom poison in my module, and so far I've been unsuccessful. 


 


The resref of the item is cr_alch_nighthpo


The script name for the poison is cr_alch_nighthpo


 


The above script..


 


void main()

{

 

object oPC = GetItemActivator();

object oTarget = GetItemActivatedTarget();

 

itemproperty ipConfuse =   ItemPropertyOnHitProps(IP_CONST_ONHIT_CONFUSION, 15);

 

AddItemProperty(DURATION_TYPE_TEMPORARY, ipConfuse, oTarget, 900.0);

}

 

I've been targeting an equipped dagger in game when using the item. The item property is activate item, 1 charge use. However, nothing seems to happen. Can anyone provide some magical insight?


               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Custom Poison
« Reply #1 on: August 31, 2015, 09:54:34 am »


               

If you're using the tag-based scripting hook from OnItemActivated, ensure that the script name is the same as the tag (not necessarily the same as the resref).


 


If that's OK, try putting some SendMessageToPC statements in your script temporarily, to check that the script is being called, that the name of the target item is what you'd expect, and that the item property is added. That would pin down where it's failing.



               
               

               
            

Legacy_4Pop

  • Newbie
  • *
  • Posts: 28
  • Karma: +0/-0
Custom Poison
« Reply #2 on: August 31, 2015, 10:02:57 pm »


               

Okay! Looks like the script is firing. Hm.  I'm guessing it's just the adding item property part not working.


 


EDIT: I had to replace 15 with IP_CONST_ONHIT_SAVEDC_16!



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Custom Poison
« Reply #3 on: August 31, 2015, 10:41:06 pm »


               

Looks like an error in the Lexicon:

http://www.nwnlexico...pertyOnHitProps


"You must specify .... the save DC constant (IP_CONST_ONHIT_SAVEDC_*), which range From 14 to 26"


There is a link to IP_CONST_ONHIT_SAVEDC_* which contradicts this (they represent DC14 to DC26, but that isn't the value range), so I propose to delete the misleading statement about the range, unless anyone has better information.



               
               

               
            

Legacy_Proleric

  • Hero Member
  • *****
  • Posts: 1750
  • Karma: +0/-0
Custom Poison
« Reply #4 on: September 01, 2015, 12:53:53 pm »


               

Done.