예제 #1
0
    def place_monsters_k05(self):
        self.create_npc_at(utils_obj.sec2loc(492, 451),
                           py06603_coe_encounters.CtrlShadow,
                           const_toee.rotation_0600_oclock, "k05", "shadow",
                           factions_zmod.FACTION_ENEMY)

        dagger = toee.game.obj_create(
            const_proto_weapon.PROTO_WEAPON_DAGGER_PLUS_1,
            utils_obj.sec2loc(495, 455))
        if (dagger):
            dagger.obj_set_int(toee.obj_f_secretdoor_flags,
                               const_toee.OSDF_SECRET_DOOR)
            dagger.obj_set_int(toee.obj_f_secretdoor_dc, 5)
            dagger.obj_set_int(toee.obj_f_secretdoor_effectname, 1200)

        key = toee.game.obj_create(const_proto_items.PROTO_KEY_IRON_RUSTY,
                                   utils_obj.sec2loc(495, 456))
        if (key):
            key.obj_set_int(toee.obj_f_key_key_id,
                            coe_consts.KEY_CRYPT1_DOOR_6_7)
            key.obj_set_int(toee.obj_f_secretdoor_flags,
                            const_toee.OSDF_SECRET_DOOR)
            key.obj_set_int(toee.obj_f_secretdoor_dc, 5)
            key.obj_set_int(toee.obj_f_secretdoor_effectname, 1200)
        return
예제 #2
0
    def place_encounter_k06(self):
        self.create_promter_at(
            utils_obj.sec2loc(463, 497), self.get_dialogid_default(), 60, 10,
            py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG, "Key Pool",
            const_toee.rotation_0700_oclock)

        def do_lock(locked_door, key_id):
            assert isinstance(locked_door, toee.PyObjHandle)
            if (locked_door):
                locked_door.portal_flag_set(toee.OPF_LOCKED)
                utils_locks.portal_setup_dc(locked_door, utils_locks.LOCK_DC_GOOD, key_id \
                 , utils_locks.HP_DOOR_WOODEN_STRONG, utils_locks.HARDNESS_DOOR_WOODEN_STRONG, utils_locks.BREAK_DC_DOOR_WOODEN_STRONG)
            return

        do_lock(
            utils_obj.find_nearest_obj_by_nameid_loc(
                utils_obj.sec2loc(467, 494), 10,
                coe_consts.NAME_DOOR_CRYPT1_DOOR_6_7, toee.OLC_PORTAL),
            coe_consts.KEY_CRYPT1_DOOR_6_7)
        do_lock(
            utils_obj.find_nearest_obj_by_nameid_loc(
                utils_obj.sec2loc(460, 494), 10,
                coe_consts.NAME_DOOR_CRYPT1_DOOR_6_8, toee.OLC_PORTAL),
            coe_consts.KEY_CRYPT1_DOOR_9_10)
        return
예제 #3
0
    def place_encounter_k11(self):
        p1 = self.create_promter_at(
            utils_obj.sec2loc(472, 478), self.get_dialogid_default(), 110, 10,
            py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
            "Supply Vault", const_toee.rotation_0200_oclock)
        p2 = self.create_promter_at(
            utils_obj.sec2loc(481, 478), self.get_dialogid_default(), 110, 10,
            py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
            "Supply Vault", const_toee.rotation_0700_oclock)
        p1.obj_set_obj(toee.obj_f_last_hit_by, p2)
        p2.obj_set_obj(toee.obj_f_last_hit_by, p1)

        if (1):
            loc = utils_obj.sec2loc(477, 478)
            chest = toee.game.obj_create(
                const_proto_containers.PROTO_CONTAINER_CHEST_WOODEN_MEDIUM,
                loc)
            if (chest):
                chest.move(loc, -8.485282, -8.485282)
                chest.rotation = math.radians(
                    const_toee.rotation_grad_south_east)
                utils_trap.setup_trap(chest, const_traps.TRAP_POISON_DARTS,
                                      6606)
                utils_item.item_create_in_inventory(
                    const_proto_armor.PROTO_SHIELD_SMALL_MASTERWORK_WOODEN,
                    chest, 1, 1)
        return
예제 #4
0
	def place_encounters(self, new_map):
		print("new_map: {}".format(new_map))
		print("place_encounters.encounters_placed == {}".format(self.encounters_placed))
		startup_zmod.zmod_templeplus_config_apply()
		startup_zmod.zmod_conditions_apply_pc()

		if (self.encounters_placed and new_map == 0): return

		this_entrance_time = toee.game.time.time_game_in_hours2(toee.game.time)
		print("this_entrance_time == {}".format(this_entrance_time))
		if (not self.encounters_placed):
			self.first_entered_shrs = this_entrance_time
		self.last_entered_shrs = this_entrance_time
		if (not self.last_leave_shrs):
			self.last_leave_shrs = this_entrance_time

		if (not self.encounters_placed):
			self.create_npc_at(utils_obj.sec2loc(478, 508), py14710_smith.CtrlVillageSmith, const_toee.rotation_0900_oclock, "merchant", "smith", None, 0, 1)
			self.create_npc_at(utils_obj.sec2loc(476, 505), py14711_smith_wife.CtrlVillageSmithWife, const_toee.rotation_0800_oclock, "merchant", "smith_wife", None, 0, 1)
			self.create_npc_at(utils_obj.sec2loc(503, 477), py14712_wizard.CtrlVillageWizard, const_toee.rotation_0200_oclock, "merchant", "wizard", None, 0, 1)
			self.create_npc_at(utils_obj.sec2loc(494, 506), py14713_priest.CtrlVillagePriest, const_toee.rotation_1100_oclock, "merchant", "priest", None, 0, 1)
			self.create_npc_at(utils_obj.sec2loc(475, 475), py14714_mayor.CtrlVillageMayor, const_toee.rotation_1000_oclock, "authority", "mayor", None, 0, 1)
			self.generate_crowd()

		self.encounters_placed += 1
		self.factions_existance_refresh()
		self.check_sleep_status_update(1)

		#toee.game.fade_and_teleport(0, 0, 0, self.get_map_default(), 479, 494) #smith
		toee.game.fade_and_teleport(0, 0, 0, self.get_map_default(), 466, 468) #near fontain entrance
		utils_obj.scroll_to_leader()
		return
예제 #5
0
    def place_encounter_k08(self):
        self.create_promter_at(
            utils_obj.sec2loc(460, 488), self.get_dialogid_default(), 80, 10,
            py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
            "The Gauntlet", const_toee.rotation_0400_oclock)

        door = utils_obj.find_nearest_obj_by_nameid_loc(
            utils_obj.sec2loc(460, 474), 10,
            coe_consts.NAME_DOOR_CRYPT1_DOOR_8_9, toee.OLC_PORTAL)
        if (door):
            utils_trap.setup_trap(door, const_traps.TRAP_SCYTHE_20x20_2, 6605)
        else:
            debug.breakp("no door!")
        return
예제 #6
0
    def place_encounter_k10(self):
        self.create_promter_at(
            utils_obj.sec2loc(458, 451), self.get_dialogid_default(), 100, 10,
            py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
            "Supply Vault", const_toee.rotation_0400_oclock)

        if (not coe_consts.ISDEBUG):
            door = utils_obj.find_nearest_obj_by_nameid_loc(
                utils_obj.sec2loc(460, 457), 10,
                coe_consts.NAME_DOOR_CRYPT1_DOOR_9_10, toee.OLC_PORTAL)
            if (door):
                utils_locks.portal_setup_dc(door, utils_locks.LOCK_DC_GOOD, coe_consts.KEY_CRYPT1_DOOR_9_10 \
                 , utils_locks.HP_DOOR_WOODEN_STRONG, utils_locks.HARDNESS_DOOR_WOODEN_STRONG, utils_locks.BREAK_DC_DOOR_WOODEN_STRONG)
            else:
                debug.breakp("no door!")
        return
예제 #7
0
def print_distances_at_origin(locx, locy):
	print("Distances locx, locy: {}, {}".format(locx, locy))
	loc = utils_obj.sec2loc(locx, locy)
	for npc in game.obj_list_vicinity(loc, OLC_NPC | OLC_PC):
		dist = npc.distance_to(loc)
		print("{}: distance: {:06.2f} | id: {}".format(npc, dist, npc.id))
	return
예제 #8
0
	def quest_everflame_recieved(self):
		toee.game.quests[coe_consts.QUEST_EVERFLAME].state = toee.qs_accepted
		utils_storage.ca("mayor_uptal").quest_everflame_recieved()

		exit_loc = utils_obj.sec2loc(505, 473)
		objs = utils_storage.Storage().objs
		assert isinstance(objs, dict)
		m3 = copy.copy(self.m2)
		for minfo in m3:
			assert isinstance(minfo, monster_info.MonsterInfo)
			#print("minfo.name: {}, minfo.id: {}".format(minfo.name, minfo.id))
			if (minfo.name.find("crowd") != -1):
				id = minfo.id
				self.m2.remove(minfo)
				del self.monsters[minfo.name]
				del objs[id]
				#npc = minfo.get_npc()
				npc = utils_toee.get_obj_by_id(id)
				print(npc)
				assert isinstance(npc, toee.PyObjHandle)
				if (npc):
					#print("npc.runoff(), {}".format(npc))
					npc.runoff(exit_loc, 0, 0)
				#else: print("npc not found: {}, id: {}".format(npc, id))
		return
예제 #9
0
 def place_encounter_k05(self):
     self.create_promter_at(
         utils_obj.sec2loc(498, 459), self.get_dialogid_default(), 50, 10,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
         "Shadowy Shapes", const_toee.rotation_0600_oclock)
     if (not self.delayed_monsters()):
         self.place_monsters_k05()
     return
예제 #10
0
 def place_encounter_k04(self):
     self.create_promter_at(
         utils_obj.sec2loc(488, 470), self.get_dialogid_default(), 40, 5,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
         "Hungry Beetle", const_toee.rotation_0600_oclock)
     if (not self.delayed_monsters()):
         self.place_monsters_k04()
     return
예제 #11
0
 def place_encounter_k03(self):
     self.create_promter_at(
         utils_obj.sec2loc(500, 466), self.get_dialogid_default(), 30, 10,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
         "Wailing Survivor", const_toee.rotation_0400_oclock)
     if (not self.delayed_monsters()):
         self.place_monsters_k03()
     return
예제 #12
0
 def place_encounter_k09(self):
     self.create_promter_at(
         utils_obj.sec2loc(463, 468), self.get_dialogid_default(), 90, 5,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
         "The Shield Guardian", const_toee.rotation_0400_oclock)
     if (not self.delayed_monsters()):
         self.place_monsters_k09()
     return
예제 #13
0
 def place_encounter_k01(self):
     self.create_promter_at(
         utils_obj.sec2loc(480, 499), self.get_dialogid_default(), 10, 10,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG, "Entry Hall",
         const_toee.rotation_1100_oclock)
     if (not self.delayed_monsters()):
         self.place_monsters_k01()
     return
예제 #14
0
 def place_encounter_k12(self):
     self.create_promter_at(
         utils_obj.sec2loc(477, 459), self.get_dialogid_default(), 120, 10,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
         "Chamber of the Bloody Dead", const_toee.rotation_0400_oclock)
     if (not self.delayed_monsters()):
         self.place_monsters_k12()
     return
예제 #15
0
def mayor_walk2():
    mayor = utils_storage.ca("mayor_uptal").npc_get()
    print(mayor)
    #mayor.anim_goal_push_goto(utils_obj.sec2loc(461, 474), 0)
    #mayor.standpoint_set_ex(toee.STANDPOINT_DAY, utils_obj.sec2loc(461, 474))
    mayor.standpoint_set(toee.STANDPOINT_DAY, -1, utils_obj.sec2loc(459, 456),
                         0, 0, 0)
    return
예제 #16
0
 def place_encounter_j02(self):
     self.create_promter_at(
         utils_obj.sec2loc(465, 485), self.get_dialogid_default(), 20, 10,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG, "Wolfs",
         const_toee.rotation_1100_oclock)
     self.create_npc_at(utils_obj.sec2loc(456, 488),
                        py06603_coe_encounters.CtrlWolf,
                        const_toee.rotation_0800_oclock, "j02", "wolf1",
                        factions_zmod.FACTION_WILDERNESS_HOSTILE)
     self.create_npc_at(utils_obj.sec2loc(458, 491),
                        py06603_coe_encounters.CtrlWolf,
                        const_toee.rotation_0900_oclock, "j02", "wolf2",
                        factions_zmod.FACTION_WILDERNESS_HOSTILE)
     self.create_npc_at(utils_obj.sec2loc(461, 493),
                        py06603_coe_encounters.CtrlWolf,
                        const_toee.rotation_0100_oclock, "j02", "wolf3",
                        factions_zmod.FACTION_WILDERNESS_HOSTILE)
     return
예제 #17
0
 def place_monsters_k12(self):
     self.create_npc_at(utils_obj.sec2loc(480, 456),
                        py06603_coe_encounters.CtrlSkeletonHumanBloody,
                        const_toee.rotation_0400_oclock, "k12",
                        "bskeleton1", factions_zmod.FACTION_ENEMY)
     self.create_npc_at(utils_obj.sec2loc(478, 453),
                        py06603_coe_encounters.CtrlSkeletonHumanBloody,
                        const_toee.rotation_0400_oclock, "k12",
                        "bskeleton2", factions_zmod.FACTION_ENEMY)
     self.create_npc_at(utils_obj.sec2loc(476, 453),
                        py06603_coe_encounters.CtrlSkeletonHumanBloody,
                        const_toee.rotation_0400_oclock, "k12",
                        "bskeleton3", factions_zmod.FACTION_ENEMY)
     self.create_npc_at(utils_obj.sec2loc(474, 456),
                        py06603_coe_encounters.CtrlSkeletonHumanBloody,
                        const_toee.rotation_0400_oclock, "k12",
                        "bskeleton4", factions_zmod.FACTION_ENEMY)
     return
예제 #18
0
 def display_encounter_k06(self):
     key = toee.game.obj_create(const_proto_items.PROTO_KEY_GOLD,
                                utils_obj.sec2loc(463, 504))
     if (key):
         key.obj_set_int(toee.obj_f_key_key_id,
                         coe_consts.KEY_CRYPT1_DOOR_9_10)
         key.obj_set_int(toee.obj_f_secretdoor_flags,
                         const_toee.OSDF_SECRET_DOOR)
         key.obj_set_int(toee.obj_f_secretdoor_dc, 27)
         key.obj_set_int(toee.obj_f_secretdoor_effectname, 1200)
         key.obj_set_int(toee.obj_f_key_pad_i_1, toee.OIF_IS_MAGICAL)
     return
예제 #19
0
    def place_encounter_j01(self):
        self.create_promter_at(
            utils_obj.sec2loc(479, 475), self.get_dialogid_default(), 10, 10,
            py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
            "First Fight", const_toee.rotation_1100_oclock)
        npc = self.create_npc_at(utils_obj.sec2loc(487, 471),
                                 py06603_coe_encounters.CtrlOrc,
                                 const_toee.rotation_0200_oclock, "j01",
                                 "orc1")[0]
        #npc.condition_add("Deal_Subdual_Damage")

        npc = self.create_npc_at(utils_obj.sec2loc(476, 470),
                                 py06603_coe_encounters.CtrlOrc,
                                 const_toee.rotation_0800_oclock, "j01",
                                 "orc2")[0]
        #npc.condition_add("Deal_Subdual_Damage")

        npc = self.create_npc_at(utils_obj.sec2loc(473, 474),
                                 py06603_coe_encounters.CtrlOrc,
                                 const_toee.rotation_0800_oclock, "j01",
                                 "orc3")[0]
        #npc.condition_add("Deal_Subdual_Damage")
        return
예제 #20
0
	def generate_crowd(self):
		num = 0
		x = 464
		while (x <= 472-2):
			x += 2
			y = 468
			while (y <= 486-2):
				x1 = x + toee.game.random_range(0, 1)
				y += 2 + toee.game.random_range(0, 1)
				num += 1
				cl = py06601_village_npc.CtrlVillageManRandom
				if (toee.game.random_range(0, 1)):
					cl = py06601_village_npc.CtrlVillageWomanRandom
				self.create_npc_at(utils_obj.sec2loc(y, x1), cl, const_toee.rotation_0500_oclock, "crowd", "person_{}".format(num), None, 0, 1)
		return
예제 #21
0
 def place_monsters_k01(self):
     self.create_npc_at(utils_obj.sec2loc(482, 489),
                        py06603_coe_encounters.CtrlSkeletonEntry,
                        const_toee.rotation_0500_oclock, "k01", "skeleton1")
     self.create_npc_at(utils_obj.sec2loc(480, 489),
                        py06603_coe_encounters.CtrlSkeletonEntry,
                        const_toee.rotation_0500_oclock, "k01", "skeleton2")
     self.create_npc_at(utils_obj.sec2loc(479, 489),
                        py06603_coe_encounters.CtrlSkeletonEntry,
                        const_toee.rotation_0500_oclock, "k01", "skeleton3")
     self.create_npc_at(utils_obj.sec2loc(480, 491),
                        py06603_coe_encounters.CtrlSkeletonEntry,
                        const_toee.rotation_0500_oclock, "k01", "skeleton4")
     self.create_npc_at(utils_obj.sec2loc(485, 495),
                        py06603_coe_encounters.CtrlSkeletonEntry,
                        const_toee.rotation_0300_oclock, "k01", "skeleton5")
     self.create_npc_at(utils_obj.sec2loc(476, 495),
                        py06603_coe_encounters.CtrlSkeletonEntry,
                        const_toee.rotation_0600_oclock, "k01", "skeleton6")
     return
예제 #22
0
 def place_monsters_k04(self):
     self.create_npc_at(utils_obj.sec2loc(487, 469),
                        py06603_coe_encounters.CtrlBeetleBombardier,
                        const_toee.rotation_0900_oclock, "k04", "beetle1",
                        factions_zmod.FACTION_WILDERNESS_HOSTILE)
     return
예제 #23
0
def mayor_walk():
    mayor = utils_storage.ca("mayor_uptal").npc_get()
    print(mayor)
    mayor.anim_goal_push_goto(utils_obj.sec2loc(461, 474), 0)
    return
예제 #24
0
	def quest_everflame_recieved(self):
		self.npc_get().standpoint_set(toee.STANDPOINT_DAY, -1, utils_obj.sec2loc(459, 456), 0, 0, 0)
		self.npc_get().standpoint_set(toee.STANDPOINT_NIGHT, -1, utils_obj.sec2loc(461, 452), 0, 0, 0)
		return
예제 #25
0
 def place_monsters_k09(self):
     self.create_npc_at(utils_obj.sec2loc(463, 460),
                        py06603_coe_encounters.CtrlGolemWoodKassen,
                        const_toee.rotation_0400_oclock, "k09", "golem",
                        factions_zmod.FACTION_ENEMY)
     return
예제 #26
0
 def place_monsters_k03(self):
     self.create_npc_at(utils_obj.sec2loc(496, 466),
                        py06603_coe_encounters.CtrlRoldare,
                        const_toee.rotation_0500_oclock, "k03", "roldare",
                        factions_zmod.FACTION_NEUTRAL_NPC, 1, 1)
     return
예제 #27
0
 def place_encounter_k07(self):
     self.create_promter_at(
         utils_obj.sec2loc(466, 486), self.get_dialogid_default(), 70, 10,
         py06122_cormyr_prompter.PROMTER_DIALOG_METHOD_DIALOG,
         "Room of Reflection", const_toee.rotation_0400_oclock)
     return
예제 #28
0
    def place_encounter_k02(self):
        chest_with_key_num = toee.game.random_range(1, 3)
        chest_with_key = None
        # first chest
        if (1):
            loc = utils_obj.sec2loc(494, 508)
            chest = toee.game.obj_create(
                const_proto_containers.PROTO_CONTAINER_CHEST_WOODEN_MEDIUM,
                loc)
            if (chest):
                chest.move(loc, -8.485282, -8.485282)
                chest.rotation = math.radians(
                    const_toee.rotation_grad_south_east)
                chest.obj_set_int(toee.obj_f_secretdoor_flags,
                                  const_toee.OSDF_SECRET_DOOR)
                chest.obj_set_int(toee.obj_f_secretdoor_dc, 5)
                chest.obj_set_int(toee.obj_f_secretdoor_effectname, 1200)
                if (chest_with_key_num == 1): chest_with_key = chest
                utils_trap.setup_trap(chest, const_traps.TRAP_PIT_TRAP,
                                      const_traps.TRAP_SCRIPT_PIT_TRAP)
        # second chest
        if (1):
            loc = utils_obj.sec2loc(503, 498)
            chest = toee.game.obj_create(
                const_proto_containers.PROTO_CONTAINER_CHEST_WOODEN_MEDIUM,
                loc)
            if (chest):
                chest.move(loc, -8.485282, -14.1421356)
                chest.rotation = math.radians(
                    const_toee.rotation_grad_south_west)
                chest.obj_set_int(toee.obj_f_secretdoor_flags,
                                  const_toee.OSDF_SECRET_DOOR)
                chest.obj_set_int(toee.obj_f_secretdoor_dc, 5)
                chest.obj_set_int(toee.obj_f_secretdoor_effectname, 1200)
                if (chest_with_key_num == 2): chest_with_key = chest
                utils_trap.setup_trap(chest, const_traps.TRAP_PIT_TRAP,
                                      const_traps.TRAP_SCRIPT_PIT_TRAP)
        # third chest
        if (1):
            loc = utils_obj.sec2loc(494, 487)
            chest = toee.game.obj_create(
                const_proto_containers.PROTO_CONTAINER_CHEST_WOODEN_MEDIUM,
                loc)
            if (chest):
                chest.move(loc, -9.899495, -12.7279215)
                chest.rotation = math.radians(
                    const_toee.rotation_grad_south_east)
                chest.obj_set_int(toee.obj_f_secretdoor_flags,
                                  const_toee.OSDF_SECRET_DOOR)
                chest.obj_set_int(toee.obj_f_secretdoor_dc, 5)
                chest.obj_set_int(toee.obj_f_secretdoor_effectname, 1200)
                if (chest_with_key_num == 3): chest_with_key = chest
                utils_trap.setup_trap(chest, const_traps.TRAP_PIT_TRAP,
                                      const_traps.TRAP_SCRIPT_PIT_TRAP)

        if (chest_with_key):
            key = utils_item.item_create_in_inventory(
                const_proto_items.PROTO_KEY_IRON_RUSTY, chest_with_key)
            if (key):
                key.obj_set_int(toee.obj_f_key_key_id,
                                coe_consts.KEY_CRYPT1_DOOR_2)
                #key.obj_set_int(toee.obj_f_description, toee.game.make_custom_name("Crypt key"))

            locked_door = utils_obj.find_nearest_obj_by_nameid_loc(
                utils_obj.sec2loc(499, 485), 10,
                coe_consts.NAME_DOOR_CRYPT1_DOOR_2, toee.OLC_PORTAL)
            if (locked_door):
                locked_door.portal_flag_set(toee.OPF_LOCKED)
                utils_locks.portal_setup_dc(locked_door, utils_locks.LOCK_DC_AVERAGE, coe_consts.KEY_CRYPT1_DOOR_2 \
                 , utils_locks.HP_DOOR_WOODEN_GOOD, utils_locks.HARDNESS_DOOR_WOODEN_GOOD, utils_locks.BREAK_DC_DOOR_WOODEN_GOOD)
        return