Beispiel #1
0
def sit_or_stand(cmd, _):
    a = {"sit": 2, "stand": 3}
    try:
        action = a[cmd]
        mapserv.cmsg_player_change_act(0, action)
    except KeyError:
        pass
Beispiel #2
0
def sit_or_stand(cmd, _):
    '''Use /sit or /stand for corresponding action'''
    a = {"sit": 2, "stand": 3}
    try:
        action = a[cmd]
        mapserv.cmsg_player_change_act(0, action)
    except KeyError:
        pass
Beispiel #3
0
def sit_or_stand(cmd, _):
    '''Use /sit or /stand for corresponding action'''
    a = {"sit": 2, "stand": 3}
    try:
        action = a[cmd]
        mapserv.cmsg_player_change_act(0, action)
    except KeyError:
        pass
Beispiel #4
0
def attack(_, name_or_id):
    target_id = -10
    mob_db = monsterdb.monster_db

    try:
        target_id = int(name_or_id)
        if target_id not in mapserv.beings_cache:
            raise ValueError
    except ValueError:
        for b in mapserv.beings_cache:
            if b.name == name_or_id:
                target_id = b.id
                break
            if b.job in mob_db:
                if mob_db[b.job] == name_or_id:
                    target_id = b.id
                    break

    if target_id > 0:
        mapserv.cmsg_player_change_act(target_id, 7)
    else:
        debuglog.warning("Being %s not found", name_or_id)
Beispiel #5
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
Beispiel #6
0
def do_action(target, action):
    if action == 'attack':
        mapserv.cmsg_player_change_act(target.id, 7)
    elif action == 'pickup':
        mapserv.cmsg_item_pickup(target.id)
Beispiel #7
0
def cmd_sit(nick, message, is_whisper, match):
    if not is_whisper:
        return

    plugins.autofollow.follow = ''
    mapserv.cmsg_player_change_act(0, 2)
Beispiel #8
0
def cmd_sit(nick, message, is_whisper, match):
    if not is_whisper:
        return

    plugins.autofollow.follow = ''
    mapserv.cmsg_player_change_act(0, 2)
Beispiel #9
0
def do_action(target, action):
    if action == 'attack':
        mapserv.cmsg_player_change_act(target.id, 7)
    elif action == 'pickup':
        mapserv.cmsg_item_pickup(target.id)