def san_use(attachee, triggerer): assert isinstance(attachee, toee.PyObjHandle) assert isinstance(triggerer, toee.PyObjHandle) print("san_use {} {}".format(attachee, triggerer)) #debug.breakp("san_use") if (not triggerer): print("py05001_bag_of_holding::san_use triggerer is none, exit") return toee.SKIP_DEFAULT bag = find_bag(triggerer) #bag = triggerer.obj_get_obj(toee.obj_f_container_notify_npc) if (not bag): print("py05001_bag_of_holding::san_use bag is none, exit") return toee.SKIP_DEFAULT ctrl = CtrlBagOfHolding.ensure(bag) assert isinstance(ctrl, CtrlBagOfHolding) #tell somehow, that it was already swpawned already_spwawned = attachee.object_flags_get() & toee.OF_STONED print("already_spwawned: {}".format(already_spwawned)) #debug.breakp("already_spwawned") if (not already_spwawned): utils_item.item_clear_all(attachee) ctrl.spawn(attachee) attachee.object_flag_set(toee.OF_STONED) return toee.RUN_DEFAULT
def after_created(self, npc): assert isinstance(npc, toee.PyObjHandle) #npc.scripts[const_toee.sn_dialog] = VILLAGE_NPC_DIALOG npc.faction_add(factions_zmod.FACTION_NEUTRAL_NPC) utils_item.item_clear_all(npc) self.make_up(npc) self.dress_up(npc) 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 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