Author Topic: How to make NPC hostile through dialouge  (Read 1275 times)

Offline crazyhybrid9999

  • Planewalker
  • *****
  • Posts: 1
How to make NPC hostile through dialouge
« on: July 17, 2004, 11:46:03 PM »
Hey I am creating a custom NPC and through certain strings of Dialouge would make the NPC go from nuetral to hostile. 

Code Tidbit: "IF ~~ THEN REPLY ~Ha ha ha ha ha~ Vlar! What a stupid name! Ha ha ha ha. Welcome aboard. We could use the comic releif.~ GOTO Enraged

IF ~~ THEN BEGIN Enraged
SAY ~You stupid little bastard. Insult me will you. I'm going to gut you like the pig that you are.~"

at the end of the Enraged Dialouge I want my NPC to then go hostile and then attack my PC. 

Offline Nebukad

  • Planewalker
  • *****
  • Posts: 4
  • Gender: Male
Re: How to make NPC hostile through dialouge
« Reply #1 on: July 18, 2004, 12:39:38 AM »
This should do the trick: IF ~~ DO ~Enemy() AttackNearestEnemyOf(Myself)~ EXIT
If you want him to attack <CHARNAME>, you could replace the AttackNearestEnemyOf(Myself) with something like Attack(Player1).

Edit: forgot to add this:
If you want him to attack the last one who he talked with use Attack(LastTalkedToBy)
« Last Edit: July 18, 2004, 12:44:57 AM by Nebukad »

Offline Ghreyfain

  • Moderator
  • Planewalker
  • *****
  • Posts: 4705
  • Gender: Male
    • Pocket Plane Group
Re: How to make NPC hostile through dialouge
« Reply #2 on: July 18, 2004, 03:15:45 AM »
You'll also get a parse error with this code:

~Ha ha ha ha ha~ Vlar! What a stupid name! Ha ha ha ha. Welcome aboard. We could use the comic releif.~
Earn Money Sleeping.

Offline Diana

  • Neophyte
  • Planewalker
  • *****
  • Posts: 251
  • Gender: Female
Re: How to make NPC hostile through dialouge
« Reply #3 on: July 18, 2004, 08:15:08 AM »
I wanted to do something similar kinda along the lines of the Kelsey/Anomen fight with this NPC and Haerdalis but didn't wanna go through the hassle of dual appending of scripts and editing the instigator's script.  I altered this from the Keldorn/Viconia fight in her Bviconi.d file but it's annoying when the kickout speech activates since both are in the party.  I guess I would have to set more global checks and timers like they did in the K/A fight. *sigh*  This is part of what would have been appended to the Bhaerda.dlg file

IF ~~ REPLY @100 DO ~IncrementGlobal("Evil","GLOBAL",1)
LeaveParty()
ActionOverride("MyNPC",LeaveParty())
Attack("MyNPC")
ActionOverride("MyNPC",Attack("Haerdalis"))~ EXIT
END
END

If I omit out the "ActionOverride("MyNPC",LeaveParty()) the sprite just stands there getting beat up by Haerdalis.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: