// creator  : weidu.exe (version 23100)
// argument : WISH.DLG
// game		 : .
// source	 : ./DATA/DIALOG.BIF
// dialog	 : ./DIALOG.TLK
// dialogF  : (none)

BEGIN ~WISH~

IF ~Global("wishjames","LOCALS",0)
~ THEN BEGIN 0 // from:
  SAY #58535 /* ~I am the channel through which your wish shall be fulfilled. You may ask for a wish I can repeat, or you may ask for a wish that will happen once only. Decide.~ */
  IF ~~ THEN REPLY #58536 /* ~A repeatable wish.~ */ DO ~SetGlobal("wishjames","LOCALS",1)
~ GOTO 12
  IF ~~ THEN REPLY #58537 /* ~A one time wish.~ */ DO ~SetGlobal("wishjames","LOCALS",1)
~ GOTO 1
  IF ~~ THEN REPLY #58584 /* ~I reconsider. I will make no wish at this time.~ */ DO ~SetGlobal("wishjames","LOCALS",1)
~ GOTO 2
END

IF ~~ THEN BEGIN 1 // from: 12.9 0.1
  SAY #58538 /* ~Choose wisely then, as I can perform each of these tasks once and once only.~ */
  IF ~~ THEN REPLY #58539 /* ~Actually, I'd rather have a repeatable wish.~ */ GOTO 12
  IF ~~ THEN REPLY #58540 /* ~I don't want a wish of any kind right now.~ */ GOTO 2
  IF ~CheckStatGT(LastTalkedToBy,9,WIS)
Global("wishRich","GLOBAL",0)~ THEN REPLY #58541 /* ~I wish to be rich.~ */ DO ~SetGlobal("wishRich","GLOBAL",1)~ GOTO 3
  IF ~CheckStatGT(LastTalkedToBy,10,WIS)
Global("wishArmor","GLOBAL",0)~ THEN REPLY #58542 /* ~I wish for a powerful magical item.~ */ DO ~SetGlobal("wishArmor","GLOBAL",1)~ GOTO 6
  IF ~CheckStatGT(LastTalkedToBy,3,WIS)
Global("wishXP","GLOBAL",0)~ THEN REPLY #58543 /* ~I wish to be more experienced.~ */ DO ~SetGlobal("wishXP","GLOBAL",1)~ GOTO 7
  IF ~CheckStatGT(LastTalkedToBy,11,WIS)
Global("wishGlasses","GLOBAL",0)~ THEN REPLY #58544 /* ~I wish to see all as it really is.~ */ DO ~SetGlobal("wishGlasses","GLOBAL",1)~ GOTO 11
  IF ~CheckStatGT(LastTalkedToBy,9,WIS)
!Dead("dennis")
!Global("DennisHasGong","GLOBAL",1)
Global("wishQuest","GLOBAL",0)~ THEN REPLY #58545 /* ~I wish for an adventure like none I've ever experienced before.~ */ DO ~SetGlobal("wishQuest","GLOBAL",1)~ GOTO 8
  IF ~CheckStatGT(LastTalkedToBy,13,WIS)
Global("wishTime","GLOBAL",0)~ THEN REPLY #58546 /* ~I wish for control over time.~ */ DO ~SetGlobal("wishTime","GLOBAL",1)~ GOTO 9
  IF ~CheckStatGT(LastTalkedToBy,5,WIS)
Global("wishShape","GLOBAL",0)~ THEN REPLY #58547 /* ~I wish to be anything I desire.~ */ DO ~SetGlobal("wishShape","GLOBAL",1)~ GOTO 10
  IF ~CheckStatGT(LastTalkedToBy,9,WIS)
Global("wishContigency","GLOBAL",0)~ THEN REPLY #58548 /* ~I wish to be prepared for anything.~ */ DO ~SetGlobal("wishContigency","GLOBAL",1)~ GOTO 5
  IF ~CheckStatGT(LastTalkedToBy,11,WIS)
Global("wishWail","GLOBAL",0)~ THEN REPLY #58549 /* ~I wish that all my enemies will die.~ */ DO ~SetGlobal("wishWail","GLOBAL",1)~ GOTO 4
END

IF ~~ THEN BEGIN 2 // from: 12.10 1.1 0.2
  SAY #58550 /* ~Very well then.  I am gone.~ */
  IF ~~ THEN DO ~SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 3 // from: 1.2
  SAY #58551 /* ~Rich you want, then rich you shall be.~ */
  IF ~~ THEN DO ~GiveItemCreate("misc38",LastTalkedToBy,0,0,0)
GiveItemCreate("misc36",LastTalkedToBy,0,0,0)
GiveItemCreate("misc35",LastTalkedToBy,0,0,0)
GiveItemCreate("misc43",LastTalkedToBy,0,0,0)
GivePartyGold(2000)
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 4 // from: 1.10
  SAY #58552 /* ~Then let your enemies fall now!~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ForceSpell(Myself,WIZARD_WAIL_OF_THE_BANSHEE))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 5 // from: 1.9
  SAY #58553 /* ~Contingencies are the key to preparation.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ForceSpell(Myself,WIZARD_CHAIN_CONTINGENCY))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 6 // from: 1.3
  SAY #58554 /* ~Then you shall have it.~ */
  IF ~~ THEN DO ~GiveItemCreate("plat19",LastTalkedToBy,0,0,0)
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 7 // from: 1.4
  SAY #58556 /* ~(chuckle)  Fight well and experience you will earn.~ */
  IF ~~ THEN DO ~CreateCreatureObjectEffect("golada01","SPDIMNDR",LastTalkedToBy)
CreateCreatureObjectEffect("golsan01","SPDIMNDR",LastTalkedToBy)
CreateCreatureObjectEffect("goljug01","SPDIMNDR",LastTalkedToBy)
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 8 // from: 1.6
  SAY #58557 /* ~Soon you will have your quest, my Master.~ */
  IF ~~ THEN DO ~GiveItemCreate("wishscrl",LastTalkedToBy,0,0,0)
DisplayStringHead(Myself,3089)
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 9 // from: 1.7
  SAY #58558 /* ~Time is now your ally, Master.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WIZARD_TIME_STOP))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 10 // from: 1.8
  SAY #58559 /* ~I give you then the ability to shapechange... use it wisely for it will not last forever.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WIZARD_SHAPECHANGE))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 11 // from: 1.5
  SAY #58560 /* ~With these glasses no item will be beyond your ability to comprehend.~ */
  IF ~~ THEN DO ~GiveItemCreate("misc3p",LastTalkedToBy,0,0,0)
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 12 // from: 1.0 0.0
  SAY #58561 /* ~Choose then, but be aware that unwise wishes shall leave the wisher wanting.~ */
  IF ~CheckStatGT(LastTalkedToBy,9,WIS)~ THEN REPLY #58562 /* ~I wish for my entire party to be healed.~ */ GOTO 13
  IF ~CheckStatLT(LastTalkedToBy,10,WIS)~ THEN REPLY #58563 /* ~I wish that none of my party would die of their wounds.~ */ GOTO 14
  IF ~CheckStatGT(LastTalkedToBy,15,WIS)~ THEN REPLY #58564 /* ~I wish that spells I have cast would be restored, that I might cast them again!~ */ GOTO 15
  IF ~CheckStatLT(LastTalkedToBy,16,WIS)~ THEN REPLY #58565 /* ~I wish for my spells to be restored!~ */ GOTO 16
  IF ~CheckStatGT(LastTalkedToBy,11,WIS)~ THEN REPLY #58566 /* ~I wish to make my party invulnerable.~ */ GOTO 17
  IF ~CheckStatLT(LastTalkedToBy,12,WIS)~ THEN REPLY #58567 /* ~I wish that magic would fail to affect me or my party.~ */ GOTO 18
  IF ~~ THEN REPLY #58568 /* ~I wish to summon a horde to overrun my enemies.~ */ GOTO 19
  IF ~CheckStatGT(LastTalkedToBy,9,WIS)~ THEN REPLY #58569 /* ~I wish to be protected from the undead.~ */ GOTO 20
  IF ~CheckStatLT(LastTalkedToBy,10,WIS)~ THEN REPLY #58570 /* ~I wish to be protected from undead right now.~ */ GOTO 21
  IF ~~ THEN REPLY #58571 /* ~I want to ask for a one time wish instead.~ */ GOTO 1
  IF ~~ THEN REPLY #58572 /* ~I do not want a wish now~ */ GOTO 2
END

IF ~~ THEN BEGIN 13 // from: 12.0
  SAY #58573 /* ~Then all shall be healed.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WISH_HEAL_PARTY))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)
~ EXIT
END

IF ~~ THEN BEGIN 14 // from: 12.1
  SAY #58574 /* ~Granted.  All will die of other afflictions, but not of the wounds they have.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WISH_POISON))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 15 // from: 12.2
  SAY #58575 /* ~Then I shall grant your wish and restore some of your lost spells.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WISH_MEMORIZE))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 16 // from: 12.3
  SAY #58576 /* ~Granted. Your spells have been restored to the way they were before you memorized them.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WISH_LOSE_SPELL))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 17 // from: 12.4
  SAY #58577 /* ~Invulnerability you shall have!~ */
  IF ~~ THEN DO ~ActionOverride(Player1,ReallyForceSpell(Myself,WISH_GLOBE))
ActionOverride(Player2,ReallyForceSpell(Myself,WISH_GLOBE))
ActionOverride(Player3,ReallyForceSpell(Myself,WISH_GLOBE))
ActionOverride(Player4,ReallyForceSpell(Myself,WISH_GLOBE))
ActionOverride(Player5,ReallyForceSpell(Myself,WISH_GLOBE))
ActionOverride(Player6,ReallyForceSpell(Myself,WISH_GLOBE))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 18 // from: 12.5
  SAY #58578 /* ~A curious request, but consider it granted. None of your spells shall function.~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WISH_SPELL_FAILURE))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 19 // from: 12.6
  SAY #58579 /* ~A horde?  As you wish...~ */
  IF ~~ THEN DO ~ActionOverride(LastTalkedToBy,ReallyForceSpell(Myself,WISH_RABBIT))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 20 // from: 12.7
  SAY #58580 /* ~Protection granted.~ */
  IF ~~ THEN DO ~ActionOverride(Player1,ReallyForceSpell(Myself,CLERIC_NEGATIVE_PLANE_PROTECTION))
ActionOverride(Player2,ReallyForceSpell(Myself,CLERIC_NEGATIVE_PLANE_PROTECTION))
ActionOverride(Player3,ReallyForceSpell(Myself,CLERIC_NEGATIVE_PLANE_PROTECTION))
ActionOverride(Player4,ReallyForceSpell(Myself,CLERIC_NEGATIVE_PLANE_PROTECTION))
ActionOverride(Player5,ReallyForceSpell(Myself,CLERIC_NEGATIVE_PLANE_PROTECTION))
ActionOverride(Player6,ReallyForceSpell(Myself,CLERIC_NEGATIVE_PLANE_PROTECTION))
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END

IF ~~ THEN BEGIN 21 // from: 12.8
  SAY #58581 /* ~Protection from undead granted, and I shall have to summon some undead for you to be protected from.~ */
  IF ~~ THEN DO ~DayNight(MIDNIGHT)
CreateCreatureObjectEffect("vamanc01","SPDIMNDR",LastTalkedToBy)
CreateCreatureObjectEffect("vamver01","SPDIMNDR",LastTalkedToBy)
CreateCreatureObjectEffect("vamold01","SPDIMNDR",LastTalkedToBy)
CreateCreatureObjectEffect("vammat01","SPDIMNDR",LastTalkedToBy)
CreateCreatureObjectEffect("vammat01","SPDIMNDR",LastTalkedToBy)
CreateCreatureObjectEffect("vammat01","SPDIMNDR",LastTalkedToBy)
SetInterrupt(FALSE)
ForceSpell(Myself,DRYAD_TELEPORT)~ EXIT
END
