Username: Password:

Author Topic: [Share] Summerfeast -> Sunkiest Token Quest  (Read 1197 times)

Offline =Mindee=

  • Commander Shepard
  • BOT Developer Administrator
  • Dragon
  • *****
  • Posts: 2,749
  • Cookies 9018
  • We'll bang, OKAY?
    • View Profile
    • http://mindee-bot.com
[Share] Summerfeast -> Sunkiest Token Quest
« on: August 03, 2020, 03:46:48 PM »
BOT talks to Sunkiest, then talks to Helmit, takes Preliminaries from the chest in cave, goes to Sunkiest and receives Token.

You can enable/disable portal usage in script.
Script ignores monsters by default, but you can disable it too.

Start quest near Sunkiest.

Script:
Code: [Select]
###########################################
#         Summerfeast Preparations        #
#             (C) Mindee 2020             #
###########################################

# Use portal or walk.
# Set to False if your character has no portals or portal access.
# Default: True
PORTAL_USAGE = False
# Ignore monsters when doing quest.
# Default: True
IGNORE_MONSTERS = True
# Name for information messages.
QUEST_NAME = 'Summerfeast Preparations'

# Waypoints
init = 0
to_helmit = 1
to_helmit_tp = 2
to_forest = 3
to_sunkiest = 4
to_sunkies_tp = 5
to_forest_sunkiest = 6
to_forest_sunkiest_tp = 7
done = 8

###########################################
###########################################
###########################################
# Don't edit anything below!
CHEST = Location(31853, 32022, 8)

class Npc:
def __init__(self, name, location):
self.name = name
self.location = location

def __str__(self):
return self.name

NPC_SUNKIEST = Npc('Sunkiest', Location(31964, 31991, 7))
NPC_SUNKIEST_HELLO = ("Oh hello! Are you here to volunteer to help with Summerfeast preparations?", "Of course!")
NPC_SUNKIEST_2 = ("Wonderful! Also there is still one tiny obstacle before you can participate", "Yes.")
NPC_SUNKIEST_3 = "Good. Then listen closely. The preparations for the summerfeast" # end
NPC_SUNKIEST_NOQ = "Do you have the Preliminaries? No?"
NPC_SUNKIEST_NOBOOK = "Even if you acquired a copy somehow, you are not worthy yet."
NPC_SUNKIEST_NEXT_HELLO = ("Welcome back,", "Sure.")
NPC_SUNKIEST_FINISHED = "Excellent! You really have proven your worthiness." #1 How to help? (should end chat via funct, because next is just expl)
NPC_SUNKIEST_ISDONE = "You did prove your worthiness and are welcome to join the preparations." # need end chat via funct

NPC_HELMIT = Npc('Helmit', Location(31870, 32005, 7))
NPC_HELMIT_HELLO = ("Oh hello my son. Is it time for the sun greeting ceremony again?", "What?")
NPC_HELMIT_2 = ("The greeting ceremony! Are you dumb?", "Done nothing!")
NPC_HELMIT_3 = ("NOTHING?!? Then why am I not in the temple?", "Preliminaries.")
NPC_HELMIT_4 = "You seek a copy of the Preliminaries? Than you came to the right place." #end
NPC_HELMIT_NOQ = "Don't disturb me! Go away!"
NPC_HELMIT_NEXT_HELLO = ("Oh hello. I remember you... aren't you one of my pupils?", "The book!")
NPC_HELMIT_NEXT_2 = ("Which book? Do I look like a librarian?... Oh yes, you are the one asking", "Lost it?")
NPC_HELMIT_NEXT_3 = ("Yes, some days ago...", "Where did this happen?")
NPC_HELMIT_NEXT_4 = "Are you a little dum? I just told you" # end
NPC_HELMIT_NEXT_NOQ = "Oh hello. I remember you... you are a librarian aren't you? Sorry"

def onScriptActivation():
script.IgnoreMonsters(IGNORE_MONSTERS)
script.PauseMovement(False)
script.ToggleAutoloot(False)

if script.GetFreeBackpackSlot() == 255:
showStatusMessage("Please empty one slot in your backpack!", True)
return

key = 'sunkiestScriptPath' + script.GetUniqueKey()
if script.GetVar(key) == 0:
script.SetWay(init, 2)

def onScriptDeactivation():
script.IgnoreMonsters(False)
script.PauseMovement(False)
key = 'sunkiestScriptPath' + script.GetUniqueKey()
script.SetVar(key, script.GetWay())

def onChangeLocation(x, y, z):
loc = Location(x, y, z)
path = script.GetWay()

if isForestPath(path):
if loc == CHEST:
script.LookAt('left') # take item from chest
elif path == getHelmitPath():
if loc == NPC_HELMIT.location:
TalkTo(NPC_HELMIT)
elif (path == init) or (path == getSunkiestPath()):
if loc == NPC_SUNKIEST.location:
TalkTo(NPC_SUNKIEST)

def onReceiveAddItemToBackpack(slot, itemId):
path = script.GetWay()
if isForestPath(path) and itemId == 5205: # Preliminaries
showStatusMessage("Taken Preliminaries.", False)
GoTo(NPC_SUNKIEST)

def onReachedNpc(uid, name):
if not script.TalkToNpc(uid):
script.StatusMessage('Can\'t talk to ' + name + '!')

def onTalkedWithNpc(uid, result):
if not result:
if not script.TalkToNpc(uid):
script.StatusMessage('Can\'t talk to ' + name + '!')

def onReceiveNpcDialogue(name, text, answers):
if name == NPC_SUNKIEST.name:
if NPC_SUNKIEST_ISDONE in text:
endQuest("You have already done this quest!")
elif (NPC_SUNKIEST_NOQ in text) or (NPC_SUNKIEST_3 in text):
GoTo(NPC_HELMIT)
elif NPC_SUNKIEST_NOBOOK in text:
GoToForest()
elif NPC_SUNKIEST_HELLO[0] in text:
PickChatOption(answers, NPC_SUNKIEST_HELLO)
elif NPC_SUNKIEST_2[0] in text:
PickChatOption(answers, NPC_SUNKIEST_2)
elif NPC_SUNKIEST_NEXT_HELLO[0] in text:
PickChatOption(answers, NPC_SUNKIEST_NEXT_HELLO)
elif NPC_SUNKIEST_FINISHED:
endQuest("Congratz! Quest is now finished!")
elif name == NPC_HELMIT.name:
if NPC_HELMIT_NOQ in text:
GoTo(NPC_SUNKIEST)
elif NPC_HELMIT_HELLO[0] in text:
PickChatOption(answers, NPC_HELMIT_HELLO)
elif NPC_HELMIT_2[0] in text:
PickChatOption(answers, NPC_HELMIT_2)
elif NPC_HELMIT_3[0] in text:
PickChatOption(answers, NPC_HELMIT_3)
elif NPC_HELMIT_4 in text:
TalkTo(NPC_HELMIT)
elif NPC_HELMIT_NEXT_HELLO[0] in text:
PickChatOption(answers, NPC_HELMIT_NEXT_HELLO)
elif NPC_HELMIT_NEXT_2[0] in text:
PickChatOption(answers, NPC_HELMIT_NEXT_2)
elif NPC_HELMIT_NEXT_3[0] in text:
PickChatOption(answers, NPC_HELMIT_NEXT_3)
elif (NPC_HELMIT_NEXT_NOQ in text) or (NPC_HELMIT_NEXT_4 in text):
GoToForest()

def SetVar(name, var):
script.SetRegVar(name + '' + script.GetUniqueName(), var)

def GetVar(name):
return script.GetRegVar(name + script.GetUniqueName())

def PickChatOption(answers, opt):
answer = opt[1]
if (answer is None) or (answer not in answers):
endQuest("Please fix your dialogs in script!")
else: script.ChooseNpcOption(script.GetAnswerId(answer, answers))

def endQuest(info):
showStatusMessage(info, True)
script.SetWay(done, 2)
script.PauseMovement(True)
script.ForgetNpc()

def showStatusMessage(info, alarm):
text = QUEST_NAME + ':\n' + info
script.StatusMessage(text)
if alarm: script.Alarm(text)

def isForestPath(path):
return (path == to_forest) or (path == to_forest_sunkiest) or (path == to_forest_sunkiest_tp)

def GoToForest():
way = script.GetWay()
if way == getHelmitPath():
script.SetWay(to_forest, 2)
elif (way == getSunkiestPath()) or (way == init):
if PORTAL_USAGE: script.SetWay(to_forest_sunkiest_tp, 2)
else: script.SetWay(to_forest_sunkiest, 2)
showStatusMessage("Going to forest to take book.", False)
script.ForgetNpc()

def TalkTo(npc):
if script.GoToNpcEx(npc.name):
showStatusMessage("Reaching: " + npc.name, False)
else:
showStatusMessage("Can't find: " + npc.name, True)

def GoTo(npc):
path = globals()["get" + npc.name + "Path"]()
if script.GetWay() != path:
script.SetWay(path, 2)
showStatusMessage("Going to npc: " + npc.name, False)
script.ForgetNpc()

def getHelmitPath():
if PORTAL_USAGE: return to_helmit_tp
return to_helmit

def getSunkiestPath():
if PORTAL_USAGE: return to_sunkies_tp
return to_sunkiest

Waypoints with script are attached below.
« Last Edit: August 03, 2020, 03:55:04 PM by =Mindee= »




Mindee-BOT creator, founder and developer.