示例#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
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
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
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
def general_chat(msg):
    '''Send message to #General chat'''
    mapserv.cmsg_chat_message(msg)
示例#7
0
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
def general_chat(msg):
    mapserv.cmsg_chat_message(msg)
示例#9
0
def general_chat(message):
    badge.is_afk = False
    mapserv.cmsg_chat_message(message)
示例#10
0
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
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)