BEGIN VVBUTLER

IF ~Global("WaitForMoney","LOCALS",1)
	See(Player1)~ THEN BEGIN moneyMaster1F
   SAY ~Hello! Have you managed to get needed gold for buying castle?~
   IF ~~ THEN REPLY ~You served those monsters! Prepare to die!~  GOTO butlerFight
    IF ~PartyGoldGT(100000)~ THEN REPLY ~I'll buy this castle right now. I always wanted to have a castle.~ GOTO butlerBuyCastleF
	IF ~~ THEN REPLY ~I don't have such sum right now. But I will return.~ GOTO butlerNoMoney
END

IF ~See(Player1)
	NumberOfTimesTalkedTo(0)~ THEN BEGIN pledgeMaster1F
   SAY ~Hello! I am the butler of this castle. I served lord Daerthmac well, as my parents before. I see my lord been defeated and I came to greet you.~
   IF ~~ THEN DO ~~ GOTO pledgeMaster2F
END



IF ~~  pledgeMaster2F
   SAY ~I suggest you would like be a new owner of this place.~
   IF ~~ THEN REPLY ~You served those monsters! Prepare to die!~  GOTO butlerFight
   IF ~~ THEN REPLY ~Hello. What am I supposed to do with you?~  GOTO butlerWhatF
   IF ~~ THEN REPLY ~New owner?~ GOTO butlerCastleF
END

IF ~~ butlerFight
  SAY ~Uncultured pig!~
  IF ~~ THEN DO ~EscapeArea()~ EXIT
END

IF ~~ butlerWhatF
  SAY ~I serve butler from my teen years. I know everything about this castle.~
     IF ~~ THEN REPLY ~What will happen with castle?~ GOTO butlerCastleF
	 IF ~~ THEN REPLY ~You served those monsters! Prepare to die!~  GOTO butlerFight
END

IF ~~ butlerCastleF
   SAY ~You can buy this castle, if you want. The castle needs to be repaired and the papers for your ownership of castle must be paid. I ask sum of 100000 gold pieces. I will do all paper work myself.~
    IF ~PartyGoldGT(100000)~ THEN REPLY ~I'll buy this castle right now. I always wanted to have a castle.~ GOTO butlerBuyCastleF
	IF ~~ THEN REPLY ~I don't have such sum right now. But I will return.~ GOTO butlerNoMoney
	IF ~~ THEN REPLY ~You served those monsters! Prepare to die!~  GOTO butlerFight
END

IF ~~ butlerNoMoney
 SAY ~This castle is my house. I will wait here, until buyer will emerge.~
   IF ~~ THEN DO ~SetGlobal("WaitForMoney","LOCALS",1)~ EXIT
 END
 
 
IF ~~ butlerBuyCastleF
  SAY ~I am so happy that castle got an owner. Feel yourself at home. If you want to rest, buy supplies or fortify defences, talk to me.~
  IF ~~ THEN DO ~TakePartyGold(100000)
  DestroyGold(100000)
SetGlobal("VampireStronghold","GLOBAL",1)
SetGlobal("WaitForMoney","LOCALS",2)~ EXIT
END

 


IF ~~ butlerTalkF
  SAY ~I don't have time to idle talks, mistress.~
  IF ~~ THEN DO ~~ EXIT
END

IF ~~ butlerTalkM
  SAY ~I don't have time to idle talks, master.~
  IF ~~ THEN DO ~~ EXIT
END

IF ~Gender(Player1,FEMALE) 
  Global("VampireStronghold","GLOBAL",1)~ THEN BEGIN talkButlerSTRF
  SAY ~Hello, mistress. How can I serve you?~
  IF ~~ THEN REPLY ~I need to buy supplies.~ GOTO butlerSuppliesF
  IF ~~ THEN REPLY ~I need to rest.~ GOTO butlerTavernF
  IF ~~ THEN REPLY ~I want to buy defences for castle.~ GOTO butlerArmyM
  IF ~~ THEN REPLY ~Nevermind. Just wanted to check on you.~ GOTO butlerTalkF 
   IF ~~ THEN REPLY ~You served those monsters! Prepare to die!~  GOTO butlerFight  
END

IF ~!Gender(Player1,FEMALE) 
  Global("VampireStronghold","GLOBAL",1)~ THEN BEGIN talkButlerSTRM
  SAY ~Hello, master. How can I serve you?~
  IF ~~ THEN REPLY ~I need to buy supplies.~ GOTO butlerSuppliesM
  IF ~~ THEN REPLY ~I need to rest.~ GOTO butlerTavernM
  IF ~~ THEN REPLY ~I want to buy defences for castle.~ GOTO butlerArmyM
  IF ~~ THEN REPLY ~Nevermind. Just wanted to check on you.~ GOTO butlerTalkM 
   IF ~~ THEN REPLY ~You served those monsters! Prepare to die!~  GOTO butlerFight  
END


IF ~~ butlerArmyM
 SAY ~I can sell you the undead creatures. They will guard your castle from intruders. I can summon skeleton warriors, ghouls, ghasts, vampiric wolves, vampire maids and servants and flesh golems. They will guard castle well.~
 IF ~PartyGoldGT(2000)~ THEN REPLY ~I want to buy skeleton warrior.~ GOTO buySkeleton
 IF ~PartyGoldGT(1000)~ THEN REPLY ~I want to buy zombie.~ GOTO buyZombie
 IF ~PartyGoldGT(3000)~ THEN REPLY ~I want to buy ghoul.~ GOTO buyGhoul
 IF ~PartyGoldGT(3500)~ THEN REPLY ~I want to buy ghast.~ GOTO buyGhast
 IF ~PartyGoldGT(2500)~ THEN REPLY ~I want to buy vampiric wolf.~  GOTO buyWolf
 IF ~PartyGoldGT(7000)~ THEN REPLY ~I want to buy vampire maid.~  GOTO buyFVampire
 IF ~PartyGoldGT(7000)~ THEN REPLY ~I want to buy vampire servant.~  GOTO buyMVampire
 IF ~PartyGoldGT(5000)~ THEN REPLY ~I want to buy flesh golem.~  GOTO buyMFleshGolem 
 IF ~~ THEN REPLY ~I don't want to buy nothing right now.~ GOTO talkButlerSTRM
END

IF ~~ buySkeleton
  SAY ~I summon you, skeleton guard!~
  IF ~~ THEN DO ~TakePartyGold(2000)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVSKELAR",[792.459],S)
  ~ EXIT
END

IF ~~ buyZombie
  SAY ~I summon you, zombie!~
  IF ~~ THEN DO ~TakePartyGold(1000)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVZOMBIE",[793.459],S)
  ~ EXIT
END

IF ~~ buyGhoul
  SAY ~I summon you, ghoul guard!~
  IF ~~ THEN DO ~TakePartyGold(3000)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVGHOUL",[792.459],S)
  ~ EXIT
END


IF ~~ buyGhast
  SAY ~I summon you, ghast guard!~
  IF ~~ THEN DO ~TakePartyGold(3500)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVGHAST",[791.460],S)
  ~ EXIT
END



IF ~~ buyWolf
  SAY ~I summon you, vampiric wolf!~
  IF ~~ THEN DO ~TakePartyGold(2500)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVWOLFVA",[791.460],S)
  ~ EXIT
END




IF ~~ buyFVampire
  SAY ~I summon you, vampire maid!~
  IF ~~ THEN DO ~TakePartyGold(7000)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVVAMPIF",[791.460],S)
  ~ EXIT
END



IF ~~ buyMVampire
  SAY ~I summon you, vampire servant!~
  IF ~~ THEN DO ~TakePartyGold(7000)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVVAMPIM",[791.460],S)
  ~ EXIT
END



IF ~~ buyMFleshGolem
  SAY ~I summon you, flesh golem!~
  IF ~~ THEN DO ~TakePartyGold(7000)
		CreateVisualEffect("spfleshs",[792.459])
		Wait(1)
	CreateCreature("VVGOLEMF",[791.460],S)
  ~ EXIT
END


IF ~~ butlerSuppliesF
SAY ~Here are my goods, mistress.~
IF ~~ THEN DO ~StartStore("COHNTA",LastTalkedToBy(Myself))~ EXIT
END
 

IF ~~ butlerSuppliesM
SAY ~Here are my goods, master.~
IF ~~ THEN DO ~StartStore("COHNTA",LastTalkedToBy(Myself))~ EXIT
END

IF ~~ butlerTavernF
SAY ~Here are my goods, mistress.~
IF ~~ THEN DO ~StartStore("COHNTA",LastTalkedToBy(Myself))~ EXIT
END
 

IF ~~ butlerTavernM
SAY ~Here are my goods, master.~
IF ~~ THEN DO ~StartStore("COHNTA",LastTalkedToBy(Myself))~ EXIT
END

INTERJECT VVBUTLER pledgeMaster1F DaerthmacTalksAboutCastle
  == LORDVAMP     IF ~IsValidForPartyDialog("LORDVAMP")~ THEN 
    ~I am defeated but not dead, Clara.~
  == VVBUTLER     IF ~IsValidForPartyDialog("LORDVAMP")~ THEN 
    ~It's good to hear, my lord.~
  == LORDVAMP    IF ~IsValidForPartyDialog("LORDVAMP")
Gender(Player1,MALE)~ THEN 
    ~No, Clara, I am no longer a lord of this lands. <CHARNAME> is a new master here.~
  == LORDVAMP    IF ~IsValidForPartyDialog("LORDVAMP")
!Gender(Player1,MALE)~ THEN 
    ~No, Clara, I am no longer a lord of this lands. <CHARNAME> is a new mistress here.~
  == VVBUTLER    IF ~IsValidForPartyDialog("LORDVAMP")
Gender(Player1,MALE)~ THEN 
    ~Well, <CHARNAME> will be a master, if he will manage to gather needed sum. Taxmen are active these days, so we will need to issue ownership by all laws applicable.~
  == VVBUTLER    IF ~IsValidForPartyDialog("LORDVAMP")
!Gender(Player1,MALE)~ THEN 
    ~Well, <CHARNAME> will be a mistress, if he will manage to gather needed sum. Taxmen are active these days, so we will need to issue ownership by all laws applicable.~
  == CLAIRIS     IF ~IsValidForPartyDialog("LORDVAMP")
IsValidForPartyDialog("CLAIRIS")~ THEN 
    ~You are such bureaucrat, Clara.~	
END VVBUTLER pledgeMaster2F



