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
def give_scroll(pc, proto): assert isinstance(pc, toee.PyObjHandle) assert isinstance(proto, int) scroll = utils_item.item_create_in_inventory(proto, pc, 1, 1) scroll.item_flag_set(toee.OIF_IDENTIFIED) announce(pc, scroll) return scroll
def give_fighter_potion(pc): assert isinstance(pc, toee.PyObjHandle) item = utils_item.item_create_in_inventory( const_proto_potions.PROTO_POTION_OIL_OF_MAGIC_WEAPON, pc, 1, 1) item.item_flag_set(toee.OIF_IDENTIFIED) announce(pc, item) return item
def after_created(self, npc): assert isinstance(npc, toee.PyObjHandle) #utils_obj.obj_scripts_clear(npc) #npc.scripts[const_toee.sn_start_combat] = COE_ENCOUNTERS #npc.scripts[const_toee.sn_enter_combat] = COE_ENCOUNTERS # create inventory utils_item.item_create_in_inventory( const_proto_armor.PROTO_ARMOR_LEATHER_ARMOR_BROWN, npc) item = utils_item.item_create_in_inventory( const_proto_cloth.PROTO_CLOTH_BOOTS_LEATHER_BOOTS_COMBAT, npc) if (item): item.item_flag_set(toee.OIF_NO_LOOT) utils_item.item_create_in_inventory( const_proto_weapon.PROTO_WEAPON_FALCHION, npc) npc.item_wield_best_all() return
def give_used_wand(pc, proto, uses): assert isinstance(pc, toee.PyObjHandle) assert isinstance(proto, int) assert isinstance(uses, int) wand = utils_item.item_create_in_inventory(proto, pc, 1, 1) wand.item_flag_set(toee.OIF_IDENTIFIED) wand.obj_set_int(toee.obj_f_item_spell_charges_idx, uses) announce(pc, wand) return wand
def after_created(self, npc): assert isinstance(npc, toee.PyObjHandle) #utils_obj.obj_scripts_clear(npc) #npc.scripts[const_toee.sn_start_combat] = COE_ENCOUNTERS #npc.scripts[const_toee.sn_enter_combat] = COE_ENCOUNTERS # create inventory utils_item.item_create_in_inventory( const_proto_armor.PROTO_ARMOR_PADDED_ARMOR_TAN, npc) utils_item.item_create_in_inventory( const_proto_cloth.PROTO_CLOTH_BOOTS_PADDED_TAN, npc).item_flag_set(toee.OIF_NO_LOOT) utils_item.item_create_in_inventory( const_proto_weapon.PROTO_WEAPON_CROSSBOW_LIGHT_MASTERWORK, npc) utils_item.item_create_in_inventory( const_proto_weapon.PROTO_AMMO_BOLT_QUIVER, npc) utils_item.item_create_in_inventory( const_proto_weapon.PROTO_WEAPON_DAGGER, npc) npc.item_wield_best_all() return
def after_created(self, npc): assert isinstance(npc, toee.PyObjHandle) npc.scripts[const_toee.sn_dialog] = self.get_proto_id() npc.faction_add(factions_zmod.FACTION_NEUTRAL_NPC) utils_item.item_clear_all(npc) box = toee.game.obj_create( const_proto_containers.PROTO_CONTAINER_CHEST_GENERIC, npc.location) box.object_flag_set(toee.OF_DONTDRAW) box.obj_set_int(toee.obj_f_container_inventory_source, 0) npc.substitute_inventory = box # create inventory utils_item.item_create_in_inventory( const_proto_cloth.PROTO_CLOTH_COAT_LONG_BLACK, npc, 1, 1) utils_item.item_create_in_inventory( const_proto_cloth.PROTO_CLOTH_BOOTS_LEATHER_BOOTS_BLACK, npc, 1, 1) npc.item_wield_best_all() return
def make_new_weapon(pc): assert isinstance(pc, toee.PyObjHandle) newweapon = None weapon = pc.item_worn_at(toee.item_wear_weapon_primary) if (weapon): protoid = weapon.proto if (protoid in const_proto_list_weapons_masterwork. PROTOS_WEAPON_2MASTERWORK): protoid = const_proto_list_weapons_masterwork.PROTOS_WEAPON_2MASTERWORK[ protoid] if (protoid): if (not utils_item.item_has(pc, protoid)): newweapon = utils_item.item_create_in_inventory( protoid, pc, 1, 1) announce(pc, newweapon) return newweapon
def dress_up(self, npc): # create inventory utils_item.item_create_in_inventory( const_proto_cloth.PROTO_CLOTH_CIRCLET_HOODLESS, npc, 1, 1) robe = toee.game.random_range( const_proto_cloth.PROTO_CLOTH_GARB_VILLAGER_BLUE, const_proto_cloth.PROTO_CLOTH_GARB_VILLAGER_RED) if (robe): utils_item.item_create_in_inventory(robe, npc, 1, 1) if (npc.obj_get_int(toee.obj_f_critter_gender) == toee.gender_male): cloak = const_proto_cloth.PROTO_CLOAKS[toee.game.random_range( 0, len(const_proto_cloth.PROTO_CLOAKS) - 1)] if (cloak): utils_item.item_create_in_inventory(cloak, npc, 1, 1) utils_item.item_create_in_inventory( const_proto_cloth.PROTO_CLOTH_BOOTS_LEATHER_BOOTS_BLACK, npc, 1, 1) npc.item_wield_best_all() return
def after_created(self, npc): assert isinstance(npc, toee.PyObjHandle) npc.scripts[const_toee.sn_dialog] = self.get_proto_id() npc.scripts[const_toee.sn_heartbeat] = self.get_proto_id() npc.faction_add(factions_zmod.FACTION_NEUTRAL_NPC) utils_item.item_clear_all(npc) # create inventory utils_item.item_create_in_inventory(const_proto_cloth.PROTO_CLOTH_CIRCLET_HOODLESS, npc, 1, 1) utils_item.item_create_in_inventory(const_proto_cloth.PROTO_CLOTH_GARB_NOBLE_PURPLE, npc, 1, 1) utils_item.item_create_in_inventory(const_proto_cloth.PROTO_CLOTH_BOOTS_LEATHER_BOOTS_WHITE, npc, 1, 1) utils_item.item_create_in_inventory(const_proto_cloth.PROTO_CLOAK_VIOLET, npc, 1, 1) npc.item_wield_best_all() self.vars["shout_mode"] = 1 self.vars["shout_cooldown"] = 0 return
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