// creator  : weidu.exe (version 23600)
// argument : KELDDA.DLG
// game     : .
// source   : ./override/KELDDA.DLG
// dialog   : lang\en_us/dialog.tlk
// dialogF  : (none)

BEGIN ~KELDDA~
//////////////////////////////////////////////////
// WARNING: this file contains non-trivial WEIGHTs
//////////////////////////////////////////////////

IF WEIGHT #3 /* Triggers after states #: 1 2 6 even though they appear after this state */
~  True()
~ THEN BEGIN 0 // from:
  SAY #2432 /* ~Welcome! The traveling adventurer is never turned away from a house of Lathander, as we strive to aid all who make a difference in the realms. If you are battle-worn, we can extend a number of necromantic restorations, whatever your need. A small donation is all the compensation that we require.~ */
  IF ~~ THEN REPLY #15297 /* ~What kind of aid can you give us?~ */ DO ~StartStore("tem3402",LastTalkedToBy(Myself))
~ EXIT
  IF ~  !Dead("BASSILUS")
~ THEN REPLY #15298 /* ~We don't require any help at the moment.~ */ GOTO 8
  IF ~  Dead("BASSILUS")
~ THEN REPLY #20626 /* ~We don't require any help at the moment.~ */ EXIT
  IF ~Global("X#KivanKeldath","GLOBAL",0)
InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#KivanKeldath","GLOBAL",1)~ EXTERN ~KIVANJ~ 216
END

IF WEIGHT #0 ~  Dead("bassilus")
PartyHasItem("MISC04")
!Global("BassilusDead","GLOBAL",2)
~ THEN BEGIN 1 // from:
  SAY #2435 /* ~By the Morning Lord, I see that you have the holy symbol of Bassilus. It must have been a difficult battle to take down such a powerful man. Yours is a service that will not soon be forgotten. It is a pleasure to give you the full reward for which you have worked.~ */
  IF ~~ THEN DO ~GiveGoldForce(5000)
SetGlobal("BassilusDead","GLOBAL",2)
AddexperienceParty(1000)
TakePartyItem("MISC04")
EraseJournalEntry(27203)
EraseJournalEntry(27204)
EraseJournalEntry(27097)
EraseJournalEntry(27090)
EraseJournalEntry(26865)
EraseJournalEntry(26866)
EraseJournalEntry(27205)
~ SOLVED_JOURNAL #27206 /* ~Bassilus the Murderer
I have been well rewarded for dispatching the foul Bassilus. No doubt this 5,000 gold shall come in quite handy.~ */ EXIT
  IF ~Global("X#KELDDA1","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#KELDDA1","GLOBAL",1)~ GOTO 12
  IF ~Global("X#KELDDA1","GLOBAL",0)
InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#KELDDA1","GLOBAL",1)~ EXTERN ~JAHEIJ~ 440
  IF ~Global("X#KELDDA1","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#KELDDA1","GLOBAL",1)~ GOTO 14
  IF ~Global("X#KELDDA1","GLOBAL",0)
InParty("sharteel")
InMyArea("sharteel")
!StateCheck("sharteel",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#KELDDA1","GLOBAL",1)~ EXTERN ~SHARTJ~ 309
END

IF WEIGHT #1 ~  Dead("bassilus")
!PartyHasItem("MISC04")
!Global("BassilusDead","GLOBAL",2)
~ THEN BEGIN 2 // from:
  SAY #2436 /* ~So you come here to claim the reward for the slaying of Bassilus. Good on you if this is true, but you must produce proof. Bring his Cyric holy symbol to me and you will be paid what you deserve. This is my word.~ */
  IF ~~ THEN DO ~StartStore("tem3402",LastTalkedToBy(Myself))
~ EXIT
END

IF ~~ THEN BEGIN 3 // from:
  SAY #2437 /* ~ 'Tis a great service you have done the people of this area, but it merely makes up for your previous acts of violence within these walls. You will get but 2,000 gold, and then you will leave my sight! Be thankful the guard does not place you in chains, let alone reward you!~ */
  IF ~~ THEN DO ~GivePartyGold(2000)
~ EXIT
END

IF ~~ THEN BEGIN 4 // from:
  SAY #2438 /* ~I realize that it takes two to fight, but you took it too far. As soon as you used other means than your fists you were essentially using a weapon on an unarmed opponent. Now, because you were provoked you will be let off with only a fine, but if this happens again you'll be in the guardhouse!~ */
  IF ~~ THEN DO ~TakePartyGold(300)
~ UNSOLVED_JOURNAL #27145 /* ~Duke Eltan's Illness
The recent trouble has one of the former guards planning to desert the Flaming Fist. According to Kent, Eltan's healer Rashad frequents a brothel called the Undercellar. The place is so foul that the entrance lies through the city sewers.~ */ EXIT
END

IF ~~ THEN BEGIN 5 // from:
  SAY #2439 /* ~It's unfortunate that people will often come to blows to settle their differences, but it is something we must live with. Ganging up on one man, however, is reprehensible! Now, because you were provoked, you will be let off with only a fine, but if this happens again you'll be in the guardhouse!~ */
  IF ~~ THEN EXIT
END

IF WEIGHT #2 ~  PartyHasItem("MISC52")
!Global("wyvernp","GLOBAL",1)
~ THEN BEGIN 6 // from:
  SAY #2440 /* ~You must be powerful heroes to have brought down such a great beast. I will take the wyvern head and give you 2,000 gold for your troubles.~ */
  IF ~~ THEN DO ~GiveGoldForce(2000)
TakePartyItem("MISC52")
SetGlobal("wyvernp","GLOBAL",1)
EraseJournalEntry(26918)
~ SOLVED_JOURNAL #31969 /* ~Wyvern Hunting Season
I have been well rewarded for delivering a wyvern head to Kelddath. No doubt this 2,000 gold shall come in quite handy.~ */ EXIT
  IF ~Global("X#CoranWyvernReward","GLOBAL",0)
InParty("coran")
InMyArea("coran")
!StateCheck("coran",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#CoranWyvernReward","GLOBAL",1)~ EXTERN ~CORANJ~ 118
END

IF ~~ THEN BEGIN 7 // from:
  SAY #2441 /* ~Without the beast's head, I cannot give you the reward. I hope you understand.~ */
  IF ~~ THEN EXIT
END

IF ~~ THEN BEGIN 8 // from: 10.1 9.1 0.1 KIVANJ:217.1 KIVANJ:216.1
  SAY #10717 /* ~Then I will bid you farewell. Before you leave, know that there is a madman by the name of Bassilus who roams the wilderness killing any innocents that happen along his path. If you were to... dispose of him and bring back his holy symbol, there is a large reward offered. It is a grisly task, but sometimes there is little choice.~ */
  IF ~~ THEN UNSOLVED_JOURNAL #27204 /* ~Bassilus the Murderer
Kelddath Ormlyr told us that there is a price on the head of a man named Bassilus. His holy symbol should be worth a substantial reward.~ */ EXIT
  IF ~Global("X#AjantisKaldathBassilus","GLOBAL",0)
InParty("ajantis")
InMyArea("ajantis")
!StateCheck("ajantis",CD_STATE_NOTVALID)
~ THEN DO ~SetGlobal("X#AjantisKaldathBassilus","GLOBAL",1)~ EXTERN ~AJANTJ~ 54
END

IF ~~ THEN BEGIN 9 // from: KIVANJ:216.5
  SAY #45560 /* ~And have you forsaken hope, my son?~ */
  IF ~~ THEN REPLY #15297 /* ~What kind of aid can you give us?~ */ DO ~StartStore("tem3402",LastTalkedToBy(Myself))
~ EXIT
  IF ~  !Dead("BASSILUS")
~ THEN REPLY #15298 /* ~We don't require any help at the moment.~ */ GOTO 8
  IF ~  Dead("BASSILUS")
~ THEN REPLY #20626 /* ~We don't require any help at the moment.~ */ EXIT
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN GOTO 10
  IF ~  InParty("kivan")
InMyArea("kivan")
!StateCheck("kivan",CD_STATE_NOTVALID)
~ THEN EXTERN ~KIVANJ~ 217
END

IF ~~ THEN BEGIN 10 // from: 9.3 KIVANJ:217.3 KIVANJ:216.3
  SAY #45562 /* ~Gaze upon the sun as it rises, elf. It is born anew every morn - here and everywhere in this world... on this plane. Rejoice, for you are blessed by its rays.~ */
  IF ~~ THEN REPLY #15297 /* ~What kind of aid can you give us?~ */ DO ~StartStore("tem3402",LastTalkedToBy(Myself))
~ EXIT
  IF ~  !Dead("BASSILUS")
~ THEN REPLY #15298 /* ~We don't require any help at the moment.~ */ GOTO 8
  IF ~  Dead("BASSILUS")
~ THEN REPLY #20626 /* ~We don't require any help at the moment.~ */ EXIT
END

IF ~~ THEN BEGIN 11 // from:
  SAY #47318 /* ~I shall keep that in mind.~ */
  IF ~~ THEN DO ~GiveGoldForce(2000)
TakePartyItem("MISC52")
SetGlobal("wyvernp","GLOBAL",1)
EraseJournalEntry(26918)
~ SOLVED_JOURNAL #31969 /* ~Wyvern Hunting Season
I have been well rewarded for delivering a wyvern head to Kelddath. No doubt this 2,000 gold shall come in quite handy.~ */ EXIT
END

IF ~~ THEN BEGIN 12 // from: 1.1
  SAY #50383 /* ~Your help was indeed much appreciated.~ */
  IF ~~ THEN DO ~GiveGoldForce(5000)
SetGlobal("BassilusDead","GLOBAL",2)
AddexperienceParty(1000)
TakePartyItem("MISC04")
EraseJournalEntry(27203)
EraseJournalEntry(27204)
EraseJournalEntry(27097)
EraseJournalEntry(27090)
EraseJournalEntry(26865)
EraseJournalEntry(26866)
EraseJournalEntry(27205)
~ SOLVED_JOURNAL #27206 /* ~Bassilus the Murderer
I have been well rewarded for dispatching the foul Bassilus. No doubt this 5,000 gold shall come in quite handy.~ */ EXIT
END

IF ~~ THEN BEGIN 13 // from: JAHEIJ:440.1
  SAY #50383 /* ~Your help was indeed much appreciated.~ */
  IF ~~ THEN DO ~GiveGoldForce(5000)
SetGlobal("BassilusDead","GLOBAL",2)
AddexperienceParty(1000)
TakePartyItem("MISC04")
EraseJournalEntry(27203)
EraseJournalEntry(27204)
EraseJournalEntry(27097)
EraseJournalEntry(27090)
EraseJournalEntry(26865)
EraseJournalEntry(26866)
EraseJournalEntry(27205)
~ SOLVED_JOURNAL #27206 /* ~Bassilus the Murderer
I have been well rewarded for dispatching the foul Bassilus. No doubt this 5,000 gold shall come in quite handy.~ */ EXIT
END

IF ~~ THEN BEGIN 14 // from: 1.3
  SAY #50381 /* ~Have a care, lest your head have a price on it, one day.~ */
  IF ~~ THEN DO ~GiveGoldForce(5000)
SetGlobal("BassilusDead","GLOBAL",2)
AddexperienceParty(1000)
TakePartyItem("MISC04")
EraseJournalEntry(27203)
EraseJournalEntry(27204)
EraseJournalEntry(27097)
EraseJournalEntry(27090)
EraseJournalEntry(26865)
EraseJournalEntry(26866)
EraseJournalEntry(27205)
~ SOLVED_JOURNAL #27206 /* ~Bassilus the Murderer
I have been well rewarded for dispatching the foul Bassilus. No doubt this 5,000 gold shall come in quite handy.~ */ EXIT
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN GOTO 15
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN EXTERN ~JAHEIJ~ 441
END

IF ~~ THEN BEGIN 15 // from: JAHEIJ:441.1 14.1
  SAY #50383 /* ~Your help was indeed much appreciated.~ */
  IF ~~ THEN DO ~GiveGoldForce(5000)
SetGlobal("BassilusDead","GLOBAL",2)
AddexperienceParty(1000)
TakePartyItem("MISC04")
EraseJournalEntry(27203)
EraseJournalEntry(27204)
EraseJournalEntry(27097)
EraseJournalEntry(27090)
EraseJournalEntry(26865)
EraseJournalEntry(26866)
EraseJournalEntry(27205)
~ SOLVED_JOURNAL #27206 /* ~Bassilus the Murderer
I have been well rewarded for dispatching the foul Bassilus. No doubt this 5,000 gold shall come in quite handy.~ */ EXIT
END

IF ~~ THEN BEGIN 16 // from:
  SAY #50381 /* ~Have a care, lest your head have a price on it, one day.~ */
  IF ~~ THEN DO ~GiveGoldForce(5000)
SetGlobal("BassilusDead","GLOBAL",2)
AddexperienceParty(1000)
TakePartyItem("MISC04")
EraseJournalEntry(27203)
EraseJournalEntry(27204)
EraseJournalEntry(27097)
EraseJournalEntry(27090)
EraseJournalEntry(26865)
EraseJournalEntry(26866)
EraseJournalEntry(27205)
~ SOLVED_JOURNAL #27206 /* ~Bassilus the Murderer
I have been well rewarded for dispatching the foul Bassilus. No doubt this 5,000 gold shall come in quite handy.~ */ EXIT
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN GOTO 17
  IF ~  InParty("jaheira")
InMyArea("jaheira")
!StateCheck("jaheira",CD_STATE_NOTVALID)
~ THEN EXTERN ~JAHEIJ~ 442
END

IF ~~ THEN BEGIN 17 // from: JAHEIJ:442.1 16.1
  SAY #50383 /* ~Your help was indeed much appreciated.~ */
  IF ~~ THEN DO ~GiveGoldForce(5000)
SetGlobal("BassilusDead","GLOBAL",2)
AddexperienceParty(1000)
TakePartyItem("MISC04")
EraseJournalEntry(27203)
EraseJournalEntry(27204)
EraseJournalEntry(27097)
EraseJournalEntry(27090)
EraseJournalEntry(26865)
EraseJournalEntry(26866)
EraseJournalEntry(27205)
~ SOLVED_JOURNAL #27206 /* ~Bassilus the Murderer
I have been well rewarded for dispatching the foul Bassilus. No doubt this 5,000 gold shall come in quite handy.~ */ EXIT
END
