EXTEND_TOP THALAN 2
  IF ~OR(3)
      PartyHasItem("GelJav0")
      NumItemsPartyGT("SPER02",1)
      PartyHasItem("SPER03")
  ~ THEN REPLY ~Can you alter or improve any of my spears?~ GOTO Gel_Talan_Hub
END

EXTEND_TOP THALAN 1
  IF ~OR(3)
      PartyHasItem("GelJav0")
      NumItemsPartyGT("SPER02",1)
      PartyHasItem("SPER03")
  ~ THEN REPLY ~Can you alter or improve any of my spears?~ GOTO Gel_Talan_Hub
END

APPEND THALAN

IF ~~ THEN BEGIN Gel_Talan_Hub
  SAY ~Show me what you have, and I will see whether it can be altered.~
    IF ~PartyHasItem("GelJav0") PartyHasItem("SPER02")~ THEN REPLY ~Can you enchant this Throwing Spear?~ GOTO Gel_Talan_Jav1
    IF ~NumItemsPartyGT("SPER02",1)~ THEN REPLY ~Can you make a stronger Throwing Spear from these Spears +1?~ GOTO Gel_Talan_Jav2
    IF ~PartyHasItem("SPER03")~ THEN REPLY ~Can you turn Backbiter into something less cursed?~ GOTO Gel_Talan_Frontbiter
    IF ~~ THEN REPLY ~Not right now.~ EXIT
END

IF ~~ THEN BEGIN Gel_Talan_Jav1
  SAY ~Yes. With a Spear +1 and 500 gold, I can enchant your Throwing Spear.~
    IF ~PartyHasItem("GelJav0") PartyHasItem("SPER02") PartyGoldGT(499)~
      THEN REPLY ~Do it.~
      DO ~TakePartyGold(500)
          DestroyGold(500)
          TakePartyItemNum("GelJav0",1)
          DestroyItem("GelJav0")
          TakePartyItemNum("SPER02",1)
          DestroyItem("SPER02")
          GiveItemCreate("GelJav1",Player1,1,1,1)
          CreateVisualEffect("spcrtwpn",[330.230])~
      EXIT
    IF ~~ THEN REPLY ~Not right now.~ GOTO Gel_Talan_Hub
END

IF ~~ THEN BEGIN Gel_Talan_Jav2
  SAY ~Yes. Two Spears +1 and 2,500 gold will suffice for a Throwing Spear +2.~
    IF ~NumItemsPartyGT("SPER02",1) PartyGoldGT(2499)~
      THEN REPLY ~Do it.~
      DO ~TakePartyGold(2500)
          DestroyGold(2500)
          TakePartyItemNum("SPER02",2)
          DestroyItem("SPER02")
          GiveItemCreate("GelJav2",Player1,1,1,1)
          CreateVisualEffect("spcrtwpn",[330.230])~
      EXIT
    IF ~~ THEN REPLY ~Not right now.~ GOTO Gel_Talan_Hub
END

IF ~~ THEN BEGIN Gel_Talan_Frontbiter
  SAY ~Backbiter is a crude curse, but not beyond redirection. Bring me Backbiter, a Cloak of Protection +1, a Wand of Paralyzation, and 5,000 gold.~
    IF ~PartyHasItem("SPER03") PartyHasItem("CLCK01") PartyHasItem("WAND04") PartyGoldGT(4999)~
      THEN REPLY ~Do it.~
      DO ~TakePartyGold(5000)
          DestroyGold(5000)
          TakePartyItemNum("SPER03",1)
          DestroyItem("SPER03")
          TakePartyItemNum("CLCK01",1)
          DestroyItem("CLCK01")
          TakePartyItemNum("WAND04",1)
          DestroyItem("WAND04")
          GiveItemCreate("GelJav3",Player1,1,1,1)
          CreateVisualEffect("spcrtwpn",[330.230])~
      EXIT
    IF ~~ THEN REPLY ~Not right now.~ GOTO Gel_Talan_Hub
END

END