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