View Single Post
Old 06-20-2007, 02:54 PM   #2
stoffe
Network Caretaker
 
stoffe's Avatar
 
Status: Administrator
Join Date: Apr 2002
Posts: 5,833
Helpful! 10 year veteran! Notable contributor 
Quote:
Originally Posted by master zionosis
Hey people I'm at the near end of a mod and i need two scripts.

1. A script to give an amount of influence (e.g 50).
Code:
void main() {
    ModifyInfluence(NPC_KREIA, 50);
}
...where 50 is the amount of influence (on the 0 - 100 scale) to give (it accepts negative values for influence decreases), and NPC_KREIA is the party table slot of the party member to modify the influence of.

If this is for use in a dialog there are already the standard a_influence_inc and a_influence_dec scripts you can use instead of making your own, where you set the P1 parameter to the NPC to modify.

Quote:
Originally Posted by master zionosis
2. A script to check for an amount of influence (e.g 50) and if you have 50 influence with that person the dialog line will be accessible to choose.
There are standard dialog conditional scripts for this:
  • c_influence_bet - check if NPC P1's influence is between values in P2 and P3
  • c_influence_eq - check if the influence of NPC P1 is exactly the value in P2
  • c_influence_gt - check if the influence of NPC P1 is greater than the value in P2
  • c_influence_lt - check if the influence of NPC P1 is lower than the value in P2

The P1 parameter of all those scripts should be set to the Party Table slot number of the NPC to check (equivalent of NPC_* constants, or row number 0 - 11 in npc.2da.)

stoffe is offline   you may: quote & reply,