Ejemplo n.º 1
0
def join_temple(temple_name_input):
    temple_name = str(temple_name_input)
    if temple_name == 'water':
        game.global_flags[112] = 1  # Oohlgrist has joined water temple
        if get_v(454) & 2**1 == 2**1:  # Water has already regrouped
            set_v(454, get_v(454) | 2**6)
    elif temple_name == 'fire':
        game.global_flags[118] = 1  # Oohlgrist has joined fire temple
        if get_v(454) & 2**3 == 2**3:  # Fire has already regrouped
            set_v(454, get_v(454) | 2**4)
    else:
        game.leader.damage(OBJ_HANDLE_NULL, D20DT_SUBDUAL, dice_new('500d1'))
        game.leader.float_mesfile_line('mes\\skill_ui.mes', 155)
    return SKIP_DEFAULT
Ejemplo n.º 2
0
def san_end_combat(attachee, triggerer):
    if attachee.name == 14811:  # The Beacon
        attachee.float_mesfile_line('mes\\script_activated.mes', 16, 1)
        countt_encroachers = 1
        countt_all = 1
        for npc in game.obj_list_vicinity(attachee.location, OLC_NPC):
            attachee.float_mesfile_line('mes\\test.mes', countt_all, 1)
            countt_all += 1
            if is_far_from_party(npc, 48) and npc.is_unconscious() == 0:
                attachee.float_mesfile_line('mes\\test.mes',
                                            countt_encroachers, 2)
                countt_encroachers += 1
                joe = party_closest(npc)
                #encroach(npc, joe)
        attachee.float_mesfile_line('mes\\script_activated.mes', 16, 1)
        if get_v('Beacon_Active') > 0:
            set_v('Beacon_Active', get_v('Beacon_Active') - 1)
        attachee.destroy()  #so combat won't get stuck
        attachee.float_mesfile_line('mes\\script_activated.mes', 16, 1)
        return RUN_DEFAULT
Ejemplo n.º 3
0
def san_enter_combat_backup_with_beacon_shit(attachee, triggerer):

    tag_strategy(attachee)

    if attachee.name == 14811:  # The Beacon
        attachee.scripts[16] = 446  #end combat round script
        attachee.float_mesfile_line('mes\\script_activated.mes', 13, 1)
        return RUN_DEFAULT

    if (can_see_party(attachee) == 0
            and is_far_from_party(attachee, 10) == 1) or is_far_from_party(
                attachee, 40):
        if is_far_from_party(attachee, 70) == 1:
            joe = party_closest(attachee)
            encroach(attachee, joe)
        attachee.obj_set_int(324, 119)  # Seek out low ac beacon
        game.particles("sp-Hold Person", attachee)
        if get_v('Beacon_Active') == 0:
            top_path = 0
            bottom_path = 0
            for pc in game.party:
                if within_rect_by_corners(pc, 467, 360, 467,
                                          388) and pc.is_unconscious() == 0:
                    top_path = top_path + 1
                if within_rect_by_corners(pc, 504, 355, 504,
                                          385) and pc.is_unconscious() == 0:
                    bottom_path = bottom_path + 1
            if top_path > bottom_path:
                primary_beacon_x = 470
                primary_beacon_y = 388
                tertiary_beacon_x = 492
                tertiary_beacon_y = 387
            else:
                primary_beacon_x = 492
                primary_beacon_y = 387
                tertiary_beacon_x = 470
                tertiary_beacon_y = 388
            beacon_loc = location_from_axis(primary_beacon_x, primary_beacon_y)
            beacon3_loc = location_from_axis(tertiary_beacon_x,
                                             tertiary_beacon_y)

            beacon = game.obj_create(14811, beacon_loc)
            beacon.move(location_from_axis(470, 388), 0, 0)
            beacon.obj_set_int(obj_f_npc_ac_bonus, -50)
            beacon.stat_base_set(
                stat_dexterity,
                -70)  #causes problems at end of round, or does it?
            #beacon.object_flag_set(OF_DONTDRAW) # this causes combat to lag at the beacon's turn
            beacon.object_flag_set(OF_CLICK_THROUGH)
            beacon.add_to_initiative()
            beacon.set_initiative(-20)
            game.update_combat_ui()
            beacon.scripts[16] = 446  #end combat round
            #beacon.scripts[14] = 446 # exit combat
            game.particles('sp-hold person', beacon)

            beacon2 = game.obj_create(14811, location_from_axis(483L, 395L))
            beacon2.move(location_from_axis(483, 395), 0, 0)
            beacon2.obj_set_int(obj_f_npc_ac_bonus, -40)
            #beacon2.object_flag_set(OF_DONTDRAW)
            beacon2.object_flag_set(OF_CLICK_THROUGH)
            beacon2.add_to_initiative()
            beacon2.set_initiative(-21)
            game.update_combat_ui()
            game.particles('sp-hold person', beacon2)

            beacon3 = game.obj_create(14811, beacon3_loc)
            beacon3.move(beacon3_loc, 0, 0)
            beacon3.obj_set_int(obj_f_npc_ac_bonus, -30)
            #beacon3.object_flag_set(OF_DONTDRAW)
            beacon3.object_flag_set(OF_CLICK_THROUGH)
            beacon3.add_to_initiative()
            beacon3.set_initiative(-23)
            game.update_combat_ui()
            game.particles('sp-hold person', beacon3)

            set_v('Beacon_Active', 3)
    elif is_far_from_party(attachee, 75):
        joe = party_closest(attachee)
        encroach(attachee, joe)
    else:
        get_melee_strategy(attachee)

    # Tried changing their standpoint midfight, didn't work.
    # attachee.standpoint_set(STANDPOINT_DAY, attachee.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
    # attachee.standpoint_set(STANDPOINT_NIGHT, attachee.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
    # if attachee.obj_get_int(obj_f_npc_pad_i_3) == 361 or attachee.obj_get_int(obj_f_npc_pad_i_3) == 362: #sentry standpoints
    #	hl(attachee)
    #	xx = 482
    #	yy = 417
    #	for npc in game.obj_list_vicinity(location_from_axis(xx,yy), OLC_NPC ):
    #		if npc.leader_get() == OBJ_HANDLE_NULL:
    #			npc.standpoint_set(STANDPOINT_DAY, npc.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
    #			npc.standpoint_set(STANDPOINT_NIGHT, npc.obj_get_int(obj_f_npc_pad_i_3) - 342 + 500)
    #			npc.npc_flag_set(ONF_KOS)
    #			npc.npc_flag_unset(ONF_KOS_OVERRIDE)
    return RUN_DEFAULT
Ejemplo n.º 4
0
def bugbear_room_increment_turn_counter(turn_num):
    set_v('bugbear_room_turn_counter', turn_num)
    set_v('bugbear_room_timevent_count', 0)
Ejemplo n.º 5
0
def council_heartbeat(attachee):
    c_time = council_time()
    #1 - between 22:00 and 22:30 on council day
    #2 - between 22:30 and 23:00
    #3 - between 19:00 and 22:00
    #4 - after council events ( >23:00 and beyond that day), but without ordinary council
    #5 - ordinary council time
    #0 - otherwise
    if traders_awol() == 1:
        set_v(435, 6)
    if c_time == 5:
        set_v(440, 1)
    elif c_time == 1:
        if get_v(435) == 1:
            set_v(435, 3)
        elif get_v(435) >= 5 or get_v(435) == 0 and get_v(440) == 0:
            set_v(440, 1)
        elif get_v(435) == 4:
            #council_events()
            dummy = 1
    elif c_time == 2:
        if get_v(435) == 3 or get_v(435) == 1:
            set_v(435, 4)
            set_v(436, 1)
            game.global_flags[432] = 1
            #council_events()
    elif c_time == 3:
        if get_v(435) == 2:
            set_v(435, 5)
            set_v(436, 5)
            game.global_vars[750] = 3
            game.global_vars[751] = 3
            if (game.party[0].reputation_has(23) == 0 and
                (game.global_flags[814] == 0 or game.global_flags[815] == 0)):
                game.party[0].reputation_add(23)
    elif (c_time == 0 or c_time == 4):
        if c_time == 0 and game.global_flags[336] == 1 and (get_v(435) == 1 or
                                                            get_v(435) == 2):
            set_v(435, 0)
        elif get_v(435) == 3 or get_v(435) == 4 or (get_v(435) == 1
                                                    and c_time == 4):
            ##chiefly used for the case where the whole thing played out without you
            if get_v(436) == 0:
                set_v(436, 1)
            set_v(435, 5)
            if (game.party[0].reputation_has(23) == 0 and
                (game.global_flags[814] == 0 or game.global_flags[815] == 0)):
                game.party[0].reputation_add(23)
        if npc_get(attachee, 10) == 0 and attachee.map == 5001 and c_time == 4:
            hommletans_go_home()
            npc_set(attachee, 10)
        if get_v(435) == 2 and c_time == 4:
            set_v(435, 5)
            set_v(436, 5)
            game.global_vars[750] = 3
            game.global_vars[751] = 3
            if (game.party[0].reputation_has(23) == 0 and
                (game.global_flags[814] == 0 or game.global_flags[815] == 0)):
                game.party[0].reputation_add(23)
        set_v(440, 0)
    return 1