Пример #1
0
def shop(ID, m):
    h = existing_char(ID)
    if h != None:
        if m.lower() == "life potion":
            if db.select('character', 'gold', ID) >= 600:
                inventory = db.select_list("character", "inventory", ID)
                inventory.append("Life Potion")
                db.update_list("character", "inventory", ID, inventory)
                new_gold = db.select("character", "gold", ID) - 600
                db.update("character", "gold", ID, new_gold)
                return f"You have obtained a Life Potion. You have {db.select('character', 'gold', ID)} Gold remaining."
            if db.select('character', 'gold', ID) < 600:
                return "You do not have enough Gold."
        elif m.lower() == "stamina potion":
            if db.select('character', 'gold', ID) >= 600:
                inventory = db.select_list("character", "inventory", ID)
                inventory.append("Stamina Potion")
                db.update_list("character", "inventory", ID, inventory)
                new_gold = db.select("character", "gold", ID) - 600
                db.update("character", "gold", ID, new_gold)
                return f"You have obtained a Stamina Potion. You have {db.select('character', 'gold', ID)} Gold remaining."
            if db.select('character', 'gold', ID) < 600:
                return "You do not have enough Gold."
        else:
            return "This item is not in the shop"
    else:
        return "You do not have a character yet."
Пример #2
0
def dropboss(ID):
    with open("Drop.json", "r") as f:
        txt = json.load(f)
        bossname = db.select("boss", "name", ID)
        if bossname in txt:
            db.update_list("character", "inventory", ID, [txt[bossname][0]])
            db.update_list("character", "titleavailable", ID,
                           [txt[bossname][1]])
            return f"You have received the item: {txt[bossname][0]} and the title: {txt[bossname][1]}.{getexp(ID, txt[bossname][2])}{getgold(ID, txt[bossname][3])}"
Пример #3
0
def weartitle(ID, m):
    if m in db.select_list("character", "titleavailable", ID):
        cur_title = db.select("character", "titleequipped", ID)
        available = db.select_list("character", "titleavailable", ID)
        available.append(cur_title)
        available.remove(m)
        db.update_list("character", "titleavailable", ID, available)
        db.update("character", "titleequipped", ID, m)
        #db.update_list("character", "titleavailable", ID, cur_title)
        #db.update("character", "titleequipped", ID, m)
        #b = db.select_list("character", "titleavailable", ID)
        #b.remove(db.select("character", "titleequipped", ID))
        #db.update_list("character", "titleavailable", ID, b)
        return f"The title {db.select('character', 'titleequipped', ID)} has been equipped"
    else:
        return f"This is not an available title."
Пример #4
0
def skillafif(ID, m):  #for testing purposes
    if existing_char(ID) != None:
        if m.lower() == "passive":
            a = "Sin of Gluttony[Mythic]"
            db.update("character", "wornpasskill", ID, a)
            a = list(a)
            db.update_list("character", "passskills", ID, a)
            return f"You are the finest being and thus deserve this divine skill {a}"
        elif m.lower() == "active":
            b = "Divine Punishment[Mythic]"
            db.update("character", "wornactskill", ID, b)
            b = list(b)
            db.update_list("character", "passskills", ID, b)
            return f"You are the finest being and thus deserve this divine skill {b}"
    else:
        return "You didn't create a character yet."
Пример #5
0
def Yatori(ID):
    h = existing_char(ID)
    if h != None:
        if ID == 257115950623490049:
            if "God of Creation" not in db.select_list(
                    "character", "titleavailable",
                    ID) and "God of Creation" != db.select(
                        "character", "titleequipped", ID):
                add_title = db.select_list("character", "titleavailable", ID)
                add_title.append("God of Creation")
                db.update_list("character", "titleavailable", ID, add_title)
                db.update("character", "race", ID, "God")
                return "You have gotten your lost strength back"
            else:
                return "You already are divine, Master"

        else:
            return "You are not the creator of this bot"
    else:
        return "You have not created a character yet"
Пример #6
0
def randomskill(ID, m):
    active = [
        "Slash[Common]", "Cut[Common]", "Thunderbolt[Common]",
        "Firebolt[Common]", "Triple Slash[Rare]", "Storm[Rare]",
        "Sword of Judgement[Epic]", "Flames of Destruction[Epic]",
        "Azrael[Legendary]", "Amaterasu[Legendary]",
        "Divine Punishment[Mythic]", "Divine Light[Mythic]"
    ]
    passive = [
        "Regeneration[Common]", "Focus[Common]",
        "Warrior's Determination[Rare]", "Sage's Determination[Rare]",
        "Golem's Strength[Epic]", "Eye of Serluth[Epic]",
        "Partial Draconic Transformation[Legendary]",
        "Dragon's Wisdom[Legendary]", "Sin of Envy[Mythic]",
        "Sin of Wrath[Mythic]", "Sin of Gluttony[Mythic]",
        "Sin of Lust[Mythic]", "Sin of Pride[Mythic]", "Sin of Sloth[Mythic]",
        "Sin of Greed[Mythic]"
    ]
    if existing_char(ID) != None:
        if m.lower(
        ) == "active":  #i'd recommend taking an active skill since i did not add the passive skill features yet
            a = random.choices(
                active,
                weights=[15, 15, 15, 15, 10, 10, 5, 5, 3.5, 3.5, 1.5, 1.5],
                k=1)
            db.update("character", "wornactskill", ID, a[0])
            db.update_list("character", "actskills", ID, a)
            return f"<@{ID}> has obtained the active skill {a[0]}. You have directly worn it."
        elif m.lower() == "passive":
            b = random.choices(passive,
                               weights=[
                                   30, 30, 10, 10, 5, 5, 3.25, 3.25, 0.5, 0.5,
                                   0.5, 0.5, 0.5, 0.5, 0.5
                               ],
                               k=1)
            db.update("character", "wornpassskill", ID, b[0])
            db.update_list("character", "passskills", ID, b)
            return f"<@{ID}> has obtained the passive skill {b[0]}. You have directly worn it."
    else:
        return "You didn't create a character yet."
Пример #7
0
def use(ID, m):
    h = existing_char(ID)
    if h != None:
        if m.lower() == "life potion":
            m = "Life Potion"
            if m in db.select_list("character", "inventory", ID):
                if (db.select("character", "hp", ID) -
                        db.select("character", "curhp", ID)) < 50 and (
                            db.select("character", "hp", ID) -
                            db.select("character", "curhp", ID)) != 0:
                    gainedhp = db.select("character", "hp", ID) - db.select(
                        "character", "curhp", ID)
                    max_hp = db.select("character", "hp", ID)
                    db.update("character", "curhp", ID, max_hp)
                    inventory = db.select_list("character", "inventory", ID)
                    new_inventory = inventory.remove("Life Potion")
                    db.update_list("character", "inventory", ID, new_inventory)
                    return f"{gainedhp} hp have been added, you are now full health."
                elif (db.select("character", "hp", ID) -
                      db.select("character", "curhp", ID)) >= 50:
                    more_hp = db.select("character", "curhp", ID) + 50
                    db.update("character", "curhp", ID, more_hp)
                    inventory = db.select_list("character", "inventory", ID)
                    new_inventory = inventory.remove("Life Potion")
                    db.update_list("character", "inventory", ID, new_inventory)
                    return f"50 hp have been added. You currently have {db.select('character', 'curhp', ID)}/{db.select('character', 'hp', ID)}hp."
                elif (db.select("character", "hp", ID) -
                      db.select("character", "curhp", ID)) == 0:
                    return "You are already full health."
        elif m.lower() == "stamina potion":
            m = "Stamina Potion"
            if m in db.select_list("character", "inventory", ID):
                if (db.select("character", "mana", ID) -
                        db.select("character", "curmana", ID)) < 50 and (
                            db.select("character", "mana", ID) -
                            db.select("character", "curmana", ID)) != 0:
                    gained_stamina = db.select("character", "mana",
                                               ID) - db.select(
                                                   "character", "curmana", ID)
                    max_stamina = db.select("character", "mana", ID)
                    db.update("character", "curmana", ID, max_stamina)
                    inventory = db.select_list("character", "inventory", ID)
                    new_inventory = inventory.remove("Stamina Potion")
                    db.update_list("character", "inventory", ID, new_inventory)
                    return f"{gained_stamina}stamina has been added, you are now at max Stamina"
                elif (db.select("character", "mana", ID) -
                      db.select("character", "curmana", ID)) >= 50:
                    more_stamina = db.select("character", "curmana", ID) + 50
                    db.update("character", "curmana", ID, more_stamina)
                    inventory = db.select_list("character", "inventory", ID)
                    new_inventory = inventory.remove("Stamina Potion")
                    db.update_("character", "inventory", ID, new_inventory)
                    return f"50 Stamina has been added. You currently have {db.select('character', 'curmana', ID)}/{db.select('character', 'mana', ID)}stamina"
                elif (db.select("character", "mana", ID) -
                      db.select("character", "curmana", ID)) == 0:
                    return "You already are at max Stamina."
        else:
            return "You do not have that item in your inventory."
    else:
        return "You do not have a character yet."