Aller au contenu

Photo

Custom Poison


  • Veuillez vous connecter pour répondre
4 réponses à ce sujet

#1
4Pop

4Pop
  • Members
  • 14 messages

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?


#2
Proleric

Proleric
  • Members
  • 2 354 messages

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.



#3
4Pop

4Pop
  • Members
  • 14 messages

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!



#4
Proleric

Proleric
  • Members
  • 2 354 messages

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.



#5
Proleric

Proleric
  • Members
  • 2 354 messages

Done.