def MakeSkillTrainer(skillName,cost):
    tin = long(cost[0])
    tin += cost[1] * 100L
    tin += cost[2] * 10000L
    tin += cost[3] * 1000000L
    tin += cost[4] * 100000000L
    money = GenMoneyText(tin)
    
    action = DBDialogAction()
    action.takeTin = tin
    action.trainSkill(skillName)
    
    skillReq = DBDialogRequirement()
    skillReq.addSkillRequirement(False,skillName)
    
    
    choice = DBDialogChoice(text=r'Learn the %s skill for %s.'%(skillName,money))
    choice.failLine = DBDialogLine(text= \
           "\\nI cannot teach you the %s skill at this time.\\n"%skillName)
    choice.successLine = DBDialogLine(text= \
           "\\nAlright, here's what you need to know!\\n")
    choice.successLine.addAction(action)
    choice.addRequirement(skillReq)
    
    greeting = DBDialogLine(text= \
               "Hello, would you like to learn the %s skill?\\n"%skillName)
    greeting.addChoice(choice)
    
    dialog = DBDialog(name="%s Trainer"%skillName,greeting=greeting)
def MakeClassTrainer(className,costgold, greetText,successText,failureText):
    costpp = costgold/100
    if costpp:
        costgold = costgold-costpp*100
    
    if costpp:
        money = "%i platinum pieces"%costpp
        if costgold:
            money = money[:-6]
            money+="and %i gold pieces"%costgold
    else:
        money = "%i gold pieces"%costgold
        
    
    greeting = DBDialogLine(text = greetText)
    
    choiceconfirm = DBDialogChoice(text=r'Yes, I want to train in the %s class for %s.'%(className,money))        
    choiceconfirm.failLine = DBDialogLine(text=failureText)
    choiceconfirm.successLine = DBDialogLine(text=successText)
    
    choicecancel = DBDialogChoice(text=r'No, I have chosen to reconsider.')        

    classReq = DBDialogRequirement()
    classReq.addClassRequirement(False,className)
    
    choice = DBDialogChoice(text=r'Train in the %s class for %s.'%(className,money))
    choice.addRequirement(req)
    choice.addRequirement(classReq)
    
    choice.successLine = DBDialogLine(text="\\nDo you really want to train in the %s for %s?\\n"%(className,money))
    choice.successLine.addChoice(choiceconfirm)
    choice.successLine.addChoice(choicecancel)
    
    action = DBDialogAction()
    action.takeGold = costgold
    action.takePlatinum = costpp
    action.trainClass = className
    
    choiceconfirm.successLine.addAction(action)
    
    greeting.addChoice(choice)
    
    dialog = DBDialog(name="%s Trainer"%className,greeting = greeting)
def MakeSkillTrainer(skillName, cost):
    tin = long(cost[0])
    tin += cost[1] * 100L
    tin += cost[2] * 10000L
    tin += cost[3] * 1000000L
    tin += cost[4] * 100000000L
    money = GenMoneyText(tin)

    action = DBDialogAction()
    action.takeTin = tin
    action.trainSkill(skillName)

    skillReq = DBDialogRequirement()
    skillReq.addSkillRequirement(False, skillName)

    choice = DBDialogChoice(text=r'Learn the %s skill for %s.' %
                            (skillName, money))
    choice.failLine = DBDialogLine(text= \
           "\\nI cannot teach you the %s skill at this time.\\n"%skillName)
    choice.successLine = DBDialogLine(text= \
           "\\nAlright, here's what you need to know!\\n")
    choice.successLine.addAction(action)
    choice.addRequirement(skillReq)

    greeting = DBDialogLine(text= \
               "Hello, would you like to learn the %s skill?\\n"%skillName)
    greeting.addChoice(choice)

    dialog = DBDialog(name="%s Trainer" % skillName, greeting=greeting)
def MakeClassTrainer(className, costgold, greetText, successText, failureText):
    costpp = costgold / 100
    if costpp:
        costgold = costgold - costpp * 100

    if costpp:
        money = "%i platinum pieces" % costpp
        if costgold:
            money = money[:-6]
            money += "and %i gold pieces" % costgold
    else:
        money = "%i gold pieces" % costgold

    greeting = DBDialogLine(text=greetText)

    choiceconfirm = DBDialogChoice(
        text=r'Yes, I want to train in the %s class for %s.' %
        (className, money))
    choiceconfirm.failLine = DBDialogLine(text=failureText)
    choiceconfirm.successLine = DBDialogLine(text=successText)

    choicecancel = DBDialogChoice(text=r'No, I have chosen to reconsider.')

    classReq = DBDialogRequirement()
    classReq.addClassRequirement(False, className)

    choice = DBDialogChoice(text=r'Train in the %s class for %s.' %
                            (className, money))
    choice.addRequirement(req)
    choice.addRequirement(classReq)

    choice.successLine = DBDialogLine(
        text="\\nDo you really want to train in the %s for %s?\\n" %
        (className, money))
    choice.successLine.addChoice(choiceconfirm)
    choice.successLine.addChoice(choicecancel)

    action = DBDialogAction()
    action.takeGold = costgold
    action.takePlatinum = costpp
    action.trainClass = className

    choiceconfirm.successLine.addAction(action)

    greeting.addChoice(choice)

    dialog = DBDialog(name="%s Trainer" % className, greeting=greeting)
from genesis.dbdict import DBDialog,DBDialogLine,DBDialogChoice,DBDialogAction
from mud.world.defines import *



#ghetto resurrection, hey it's free

action = DBDialogAction()

action.resurrect = True
action.playSound = "sfx/Pickup_HolyCross.ogg"

choice = DBDialogChoice(text = "Resurrect with no XP recovery for free.")
choice.failLine = DBDialogLine(text = "\\nI don't see anyone in need of resurrection!\\n")
choice.successLine = DBDialogLine(text = "\\nBring out yer dead!\\n")
choice.successLine.addAction(action)


action2 = DBDialogAction()
action2.resurrect = True
action2.resurrectXP = .5
action2.takeSilver = 10
choice2 = DBDialogChoice(text = "Resurrect with 50% XP recovery for 10 sp.")
choice2.failLine = DBDialogLine(text = "\\nBah!\\n")
choice2.successLine = DBDialogLine(text = "\\nBring out yer dead!\\n")
choice2.successLine.addAction(action2)


dialog = DBDialog()
dialog.name = "Ghetto Resurrection"
dialog.greeting = DBDialogLine(text = "This will never be displayed.  This is inserted into existing spawn dialog.")