/* Brandock comes with ingredients */
/* POTN42 - potion of Regeneration */
/* Star Sapphire MISC41.itm */
/* octopus ink */
IF WEIGHT #-1
~OR(2)
Global("C#Br_BookRestore","GLOBAL",2)
Global("C#Br_BookRestore","GLOBAL",4)
OR(2) PartyHasItem("c#br0001") HasItem("c#br0001","C#Brandock")
OR(2) PartyHasItem("c#broink") HasItem("c#broink","C#Brandock")
Global("C#Br_HaveInk","MYAREA",0)
InMyArea(Player1)
InMyArea("C#Brandock")
OR(2) InParty("C#Brandock") Global("C#BrandockJoined","GLOBAL",2)
!StateCheck("C#Brandock",CD_STATE_NOTVALID)~ THEN ingredient_01
SAY @751 /* ~Ah, the young <CHARNAME> and <PRO_HISHER> unfortunate friend. I see you have ingredients I requested.~ */
IF ~~ THEN DO ~SetGlobal("C#Br_HaveInk","MYAREA",1)~ + ingredient_04
IF ~HasItem("c#broink","C#Brandock")~ THEN DO ~ActionOverride("C#Brandock",GiveItem("c#broink",Player1))
SetGlobal("C#Br_HaveInk","MYAREA",1)~ + ingredient_04
END
/* potion of regeneration */
IF WEIGHT #-1
~OR(2)
Global("C#Br_BookRestore","GLOBAL",2)
Global("C#Br_BookRestore","GLOBAL",4)
OR(2) PartyHasItem("c#br0001") HasItem("c#br0001","C#Brandock")
OR(2) PartyHasItem("POTN42") HasItem("POTN42","C#Brandock")
Global("C#Br_HavePotion","MYAREA",0)
InMyArea(Player1)
InMyArea("C#Brandock")
OR(2) InParty("C#Brandock") Global("C#BrandockJoined","GLOBAL",2)
!StateCheck("C#Brandock",CD_STATE_NOTVALID)~ THEN ingredient_02
SAY @751 /* ~Ah, the young <CHARNAME> and <PRO_HISHER> unfortunate friend. I see you have ingredients I requested.~ */
IF ~HasItem("POTN42","C#Brandock")~ THEN DO ~ActionOverride("C#Brandock",GiveItem("POTN42",Player1)) SetGlobal("C#Br_HavePotion","MYAREA",1)~ + ingredient_05
IF ~PartyHasItem("POTN42")~ THEN DO ~SetGlobal("C#Br_HavePotion","MYAREA",1)~ + ingredient_05
END
/* star saphire */
IF WEIGHT #-1
~OR(2)
Global("C#Br_BookRestore","GLOBAL",2)
Global("C#Br_BookRestore","GLOBAL",4)
OR(2) PartyHasItem("c#br0001") HasItem("c#br0001","C#Brandock")
OR(2) PartyHasItem("MISC41") HasItem("MISC41","C#Brandock")
Global("C#Br_HaveSaphire","MYAREA",0)
InMyArea(Player1)
InMyArea("C#Brandock")
OR(2) InParty("C#Brandock") Global("C#BrandockJoined","GLOBAL",2)
!StateCheck("C#Brandock",CD_STATE_NOTVALID)~ THEN ingredient_03
SAY @751 /* ~Ah, the young <CHARNAME> and <PRO_HISHER> unfortunate friend. I see you have ingredients I requested.~ */
IF ~HasItem("MISC41","C#Brandock")~ THEN DO ~ActionOverride("C#Brandock",GiveItem("MISC41",Player1))
SetGlobal("C#Br_HaveSaphire","MYAREA",1)~ + ingredient_06
IF ~PartyHasItem("MISC41")~ THEN DO ~SetGlobal("C#Br_HaveSaphire","MYAREA",1)~ + ingredient_06
END
/* octopus ink */
IF ~~ THEN ingredient_04
SAY @754 /* ~Octopus ink!~ */
IF ~~ THEN DO ~ActionOverride("FIREBE",TakePartyItem("c#broink"))
ActionOverride("FIREBE",DestroyItem("c#broink"))~ + ingredient_04_1
END
IF ~~ THEN ingredient_04_1
SAY @759 /* ~Always needed for the right consistency of magical ink.~ */
IF ~~ THEN + not_all_ingredients
IF ~Global("C#Br_HaveInk","MYAREA",1) Global("C#Br_HavePotion","MYAREA",1) Global("C#Br_HaveSaphire","MYAREA",1)~ THEN DO ~ActionOverride("C#Brandock",GiveItem("c#br0001",Player1))~ + bookrestore
IF ~Global("C#Br_HaveInk","MYAREA",1) Global("C#Br_HavePotion","MYAREA",1) Global("C#Br_HaveSaphire","MYAREA",1)
PartyHasItem("c#br0001")~ THEN + bookrestore
IF ~Global("C#Br_HaveSaphire","MYAREA",0)
HasItem("MISC41","C#Brandock")
~ THEN DO ~ActionOverride("C#Brandock",GiveItem("MISC41",Player1))
SetGlobal("C#Br_HaveSaphire","MYAREA",1)~ + ingredient_06
IF ~Global("C#Br_HaveSaphire","MYAREA",0) PartyHasItem("MISC41")~ THEN DO ~SetGlobal("C#Br_HaveSaphire","MYAREA",1)~ + ingredient_06
IF ~Global("C#Br_HavePotion","MYAREA",0) HasItem("POTN42","C#Brandock")~ THEN DO ~ActionOverride("C#Brandock",GiveItem("POTN42",Player1))
SetGlobal("C#Br_HavePotion","MYAREA",1)~ + ingredient_05
IF ~Global("C#Br_HavePotion","MYAREA",0) PartyHasItem("POTN42")~ THEN DO ~SetGlobal("C#Br_HavePotion","MYAREA",1)~ + ingredient_05
END
/* potion of regeneration */
IF ~~ THEN ingredient_05
SAY @762 /* ~A potion of Regeneration!~ */
IF ~~ THEN DO ~ActionOverride("FIREBE",TakePartyItemNum("POTN42",1))
ActionOverride("FIREBE",DestroyItem("POTN42"))~ + ingredient_05_1
END
IF ~~ THEN ingredient_05_1
SAY @983 /* ~A powerful magic, and useful in more than one way if you know how.~ */
IF ~~ THEN + not_all_ingredients
IF ~Global("C#Br_HaveInk","MYAREA",1) Global("C#Br_HavePotion","MYAREA",1) Global("C#Br_HaveSaphire","MYAREA",1)~ THEN DO ~ActionOverride("C#Brandock",GiveItem("c#br0001",Player1))~ + bookrestore
IF ~Global("C#Br_HaveInk","MYAREA",1) Global("C#Br_HavePotion","MYAREA",1) Global("C#Br_HaveSaphire","MYAREA",1)
PartyHasItem("c#br0001")~ THEN + bookrestore
IF ~Global("C#Br_HaveSaphire","MYAREA",0)
HasItem("MISC41","C#Brandock")~ THEN DO ~ActionOverride("C#Brandock",GiveItem("MISC41",Player1))
SetGlobal("C#Br_HaveSaphire","MYAREA",1)~ + ingredient_06
IF ~Global("C#Br_HaveSaphire","MYAREA",0) PartyHasItem("MISC41")~ THEN DO ~SetGlobal("C#Br_HaveSaphire","MYAREA",1)~ + ingredient_06
END
/* star spahire */
IF ~~ THEN ingredient_06
SAY @984 /* ~A Star Saphire!~ */
IF ~~ THEN DO ~ActionOverride("FIREBE",TakePartyItemNum("MISC41",1))
ActionOverride("FIREBE",DestroyItem("MISC41"))~ + ingredient_06_1
END
IF ~~ THEN ingredient_06_1
SAY @985 /* ~Always a sight for sore eyes.~ */
IF ~~ THEN + not_all_ingredients
IF ~Global("C#Br_HaveInk","MYAREA",1) Global("C#Br_HavePotion","MYAREA",1) Global("C#Br_HaveSaphire","MYAREA",1)~ THEN DO ~ActionOverride("C#Brandock",GiveItem("c#br0001",Player1))~ + bookrestore
IF ~Global("C#Br_HaveInk","MYAREA",1) Global("C#Br_HavePotion","MYAREA",1) Global("C#Br_HaveSaphire","MYAREA",1)
PartyHasItem("c#br0001")~ THEN + bookrestore
END
IF ~~ THEN not_all_ingredients
SAY @986 /* ~Come back when you have all needed ingredients.~ */
IF ~~ THEN EXIT
END
IF ~~ THEN bookrestore
SAY @987 /* ~Let us begin with preserving the remaining book snippets against further destruction, shall we?~ */
IF ~~ THEN DO ~ActionOverride("FIREBE",TakePartyItem("c#br0001"))
ActionOverride("FIREBE",DestroyItem("c#br0001")) SetGlobal("C#Br_BookRestore","GLOBAL",5)
//ClearAllActions() StartCutSceneMode() StartCutScene("c#brcu11")
~ EXIT
END