コード例 #1
0
def being_action(data):
    # global last_time_attacked
    global aa_next_time

    if data.type in (0, 10):

        if data.src_id == charserv.server.account:
            # last_time_attacked = time.time()
            aa_next_time = time.time() + 5.0

        if (auto_heal_others and data.dst_id != charserv.server.account
                and data.dst_id in mapserv.beings_cache
                and mapserv.beings_cache[data.dst_id].type == 'player'):

            players_taken_damage[data.dst_id] = players_taken_damage.get(
                data.dst_id, 0) + data.damage

            if players_taken_damage[data.dst_id] >= player_damage_heal:
                mapserv.cmsg_chat_message("#inma {}".format(
                    mapserv.beings_cache[data.dst_id].name))
                players_taken_damage[data.dst_id] = 0
コード例 #2
0
ファイル: battlebot.py プロジェクト: mekolat/manachat
def being_action(data):
    # global last_time_attacked
    global aa_next_time

    if data.type in (0, 10):

        if data.src_id == charserv.server.account:
            # last_time_attacked = time.time()
            aa_next_time = time.time() + 5.0

        if (auto_heal_others and
                data.dst_id != charserv.server.account and
                data.dst_id in mapserv.beings_cache and
                mapserv.beings_cache[data.dst_id].type == 'player'):

            players_taken_damage[data.dst_id] = players_taken_damage.get(
                data.dst_id, 0) + data.damage

            if players_taken_damage[data.dst_id] >= player_damage_heal:
                mapserv.cmsg_chat_message("#inma {}".format(
                    mapserv.beings_cache[data.dst_id].name))
                players_taken_damage[data.dst_id] = 0
コード例 #3
0
ファイル: battlebot.py プロジェクト: Tezer123/manachat
def being_action(data):
    if not auto_attack:
        return

    global target_id
    if data.type in (0, 10):

        if (auto_attack and target_id == 0 and
                data.dst_id == charserv.server.account):
            target_id = data.src_id
            mapserv.cmsg_player_change_act(target_id, 7)

        if (auto_heal_others and
                data.dst_id != charserv.server.account and
                data.dst_id in mapserv.beings_cache and
                mapserv.beings_cache[data.dst_id].type == 'player'):

            players_taken_damage[data.dst_id] = players_taken_damage.get(
                data.dst_id, 0) + data.damage

            if players_taken_damage[data.dst_id] >= player_damage_heal:
                mapserv.cmsg_chat_message("#inma {}".format(
                    mapserv.beings_cache[data.dst_id].name))
                players_taken_damage[data.dst_id] = 0
コード例 #4
0
def general_chat(msg):
    '''Send message to #General chat'''
    mapserv.cmsg_chat_message(msg)
コード例 #5
0
ファイル: chatbot.py プロジェクト: mekolat/manachat
def answer_random(nick, message, is_whisper, answers):
    resp = random.choice(answers)
    if is_whisper:
        chat.send_whisper(nick, resp)
    else:
        mapserv.cmsg_chat_message(resp)
コード例 #6
0
ファイル: commands.py プロジェクト: mekolat/manachat
def general_chat(msg):
    '''Send message to #General chat'''
    mapserv.cmsg_chat_message(msg)
コード例 #7
0
ファイル: chatbot.py プロジェクト: Tezer123/manachat
def answer_info(nick, message, is_whisper, match):
    if is_whisper:
        mapserv.cmsg_chat_whisper(nick, "answer to !info")
    else:
        mapserv.cmsg_chat_message("You are too curious, {}".format(nick))
コード例 #8
0
ファイル: commands.py プロジェクト: Tezer123/manachat
def general_chat(msg):
    mapserv.cmsg_chat_message(msg)
コード例 #9
0
ファイル: chat.py プロジェクト: Helianthella/manachat
def general_chat(message):
    badge.is_afk = False
    mapserv.cmsg_chat_message(message)
コード例 #10
0
ファイル: autospell.py プロジェクト: Helianthella/manachat
def autospell_logic(ts):
    global times, next_ts
    if times > 0 and ts >= next_ts:
        times -= 1
        next_ts = ts + delay
        mapserv.cmsg_chat_message(spell)
コード例 #11
0
ファイル: chatbot.py プロジェクト: wushin/manachat
def answer_random(nick, message, is_whisper, answers):
    resp = random.choice(answers)
    if is_whisper:
        chat.send_whisper(nick, resp)
    else:
        mapserv.cmsg_chat_message(resp)