Author Sticky: Post Working Scripts Here
Invizible420 Posted: Sunday, 23 June 07:58PM
Script Name: NPC Attacks on specific dialog

What it does: Causes an NPC faction to change to hate upon hearing a specific conversation dialog then attack the PC

Notes: This is really easy, but I'm sure alot of you new scripters out there will find it usefull.

Paint your NPC (or just add the dialog you want)
Example of how a simple dialog might look:

--- NPC "Greetings"
+|-- PC "Hi!"
++ |-- NPC "Hi!"[END DIALOG]
+|-- PC "Fight me, you coward."
++ |-- NPC "Very well, prepare to die."[END DIALOG]

For the last bit of dialog (Very well, prepare to die), add this script under 'Action taken'.

NWScript:
void main()

{

    // Change NPC faction to -100 Hatred

    AdjustReputation(GetPCSpeaker(), OBJECT_SELF, -100);

    DetermineCombatRound(GetPCSpeaker());

}



Of course, you could have figured this out easily with the wizard. As I said, this is for the new scripters.