Author Topic: Adding flirts to your NPC  (Read 4598 times)

Offline Kismet

  • Devil's Minion #5
  • Global Moderator
  • Planewalker
  • *****
  • Posts: 653
  • Gender: Female
  • Veni; Vidi; Velcro.
    • Pocket Plane Group
Adding flirts to your NPC
« on: June 21, 2004, 07:37:26 AM »
Apparently by popular demand.  Reposted from Forgotten Wars.

Okay, an example of some NPC and PC init flirts.  Here's my flirt setup with filler dialog for Cailean.  (note, this stuff isn't actually appearing the mod, I just put it in to make sure the flirts mechanically work)

The Cailean init flirts would look like:
C: I'm going to start a flirt now.
(random)
C: (Cailean gives you a kiss on the cheek.)

The PC init flirt menu would look like:
C: (Cailean notices you approach.)
PC1: Hold Cailean's hand.
PC2: Kiss Cailean
PC3: Cailean, I like you very much, but please don't flirt with me anymore.
PC4: (Say nothing.)

If you choose Kiss Cailean, you'd randomly get one of the kisses.

This gets appended to the J dialog file.
Code: [Select]
APPEND FWCailej

//Cailean init flirts
IF ~Global("FWCaiDisableFlirts","GLOBAL",0)
    See(Player1)
    !StateCheck(Player1,STATE_SLEEPING)
    CombatCounter(0)
    Global("FWCaileanRomanceActive","GLOBAL",1)
    Global("FWCaileanStartFlirt","GLOBAL",1)~ THEN BEGIN CaileanInitFlirts
  SAY ~I'm going to start a flirt now.~
  IF ~~ THEN DO ~IncrementGlobal("FWCaileanRandFlirt","LOCALS",1)~ GOTO CaileanInitHand
  IF ~RandomNum(2,1)~ THEN DO ~IncrementGlobal("FWCaileanRandFlirt","LOCALS",1)~ GOTO CaileanInitKiss
  IF ~RandomNum(2,2)~ THEN DO ~IncrementGlobal("FWCaileanRandFlirt","LOCALS",1)~ GOTO CaileanInitTickle
END

IF ~~ THEN BEGIN CaileanInitHand
  SAY ~(Cailean takes a hold of your hand.)~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN CaileanInitKiss
  SAY ~(Cailean gives you a kiss on the cheek.)~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN CaileanInitTickle
  SAY ~(Cailean tickles your ribs.)~
  IF ~~ THEN EXIT
END

//PC init flirts -- early
IF ~IsGabber(Player1)
    CombatCounter(0)
    GlobalGT("FWCaiInitLoveTalk","GLOBAL",6)
    Global("FWCaileanQuestCompleted","GLOBAL",1)
    Global("FWCaileanRomanceActive","GLOBAL",1)~ THEN BEGIN CaiFlirtBaseEarly
  SAY ~(Cailean notices your approach.)~
  + ~RandomNum(4,1)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold1
  + ~RandomNum(4,2)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold2
  + ~RandomNum(4,3)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold3
  + ~RandomNum(4,4)~ + ~(Hold Cailean's hand.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + HandHold1

  + ~RandomNum(4,1)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss1
  + ~RandomNum(4,2)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss2
  + ~RandomNum(4,3)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss3
  + ~RandomNum(4,4)~ + ~(Kiss Cailean.)~ DO ~IncrementGlobal("FWCaileanFlirtCount","LOCALS",1)~ + Kiss4
  ++ ~Cailean, I like you very much, but please don't flirt with me anymore.~ DO ~SetGlobal("FWCaiDisableFlirts","GLOBAL",1)~ EXIT
  ++ ~(Say nothing.)~ EXIT
END

IF ~~ THEN BEGIN HandHold1
  SAY ~Cailean holds your hand 1.~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN HandHold2
  SAY ~Cailean holds your hand 2.~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN HandHold3
  SAY ~Cailean holds your hand 3.~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Kiss1
  SAY ~Cailean kisses you 1.~
   = ~It's a really long kiss.~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Kiss2
  SAY ~Cailean kisses you 2.~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Kiss3
  SAY ~Cailean asks about the kiss~
  ++ ~Kiss answer 1.~ + Kiss3_1
  ++ ~Kiss answer 2.~ + Kiss3_2
  ++ ~Kiss answer 3.~ + Kiss3_3
END

IF ~~ THEN BEGIN Kiss3_1
  SAY ~Cailean kisses you 3_1~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Kiss3_2
  SAY ~Cailean kisses you 3_2~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Kiss3_3
  SAY ~Cailean kisses you 3_3.~
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN Kiss4
  SAY ~(Cailean kisses you 4.)~
  IF ~~ THEN EXIT
END
END

These script blocks get added to Cailean's script and are for triggering the Cailean init flirts.

Code: [Select]
//Resets Cailean's flirt timer if in combat
IF
    RealGlobalTimerExpired("FWCaileanFlirtTimer","LOCALS")
    !CombatCounter(0)
THEN
    RESPONSE #100
        SetGlobal("FWCaileanStartFlirt","GLOBAL",0)
        RealSetGlobalTimer("FWCaileanFlirtTimer","LOCALS",100)
END

//Cailean flirts with PC
IF
    RealGlobalTimerExpired("FWCaileanFlirtTimer","LOCALS")
    Global("FWCaileanStartFlirt","GLOBAL",0)
    Global("FWCaiDisableFlirts","GLOBAL",0)
    InParty(Myself)
    !StateCheck(Player1,STATE_SLEEPING)
    Global("FWCaileanRomanceActive","GLOBAL",1)
    See(Player1)
    CombatCounter(0)
    !See([ENEMY])
    !Range([NEUTRAL],10)
THEN
    RESPONSE #100
        SetGlobal("FWCaileanStartFlirt","GLOBAL",1)
        StartDialogueNoSet(Player1)
        Wait(1)
END

//Reset flirt timer after flirting
IF
    RealGlobalTimerExpired("FWCaileanFlirtTimer","LOCALS")
    Global("FWCaileanStartFlirt","GLOBAL",1)
THEN
    RESPONSE #100
        SetGlobal("FWCaileanStartFlirt","GLOBAL",0)
        RealSetGlobalTimer("FWCaileanFlirtTimer","LOCALS",1500)
END

//Start flirt timer for first time
IF
    Global("FWCaileanFlirtsStarted","LOCALS",0)
    GlobalGT("FWCaiInitLoveTalk","GLOBAL",4)
    OR(2)
      Global("FWCaileanRomanceActive","GLOBAL",1)
      Global("FWCaileanRomanceActive","GLOBAL",2)
THEN
    RESPONSE #100
        SetGlobal("FWCaileanFlirtsStarted","LOCALS",1)
        RealSetGlobalTimer("FWCaileanFlirtTimer","LOCALS",600)
END
Cailean - An archer NPC for the insatiably nosy!  Guaranteed more fun than shampooing cats!

 

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)?: